Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clean up Memo column in MySQL
Message
From
16/04/2012 05:56:32
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/04/2012 13:01:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01541570
Message ID:
01541597
Views:
40
>I'm using VFP with MySQL database
>
>anyone has any experience how to clean up the Enter key in the memo column in MySQL?
>
>thanks for the help.

Is this about memos containing only CRs, or are there also memos containing real text and having extra multiple CRs in the end?

In both cases you could just

replace all myMemo with rtrim(mymemo, 1, chr(13))

and then do a tableupdate() or whichever method of updating the db you use. If you have paragraphs with multiple CRs between them, you may first go in record by record
scan
   do while chr(13)+chr(13) $ myMemo
      replace mymemo with strtran(mymemo, chr(13)+chr(13), chr(13))
   enddo
   replace myMemo with rtrim(mymemo, 1, chr(13))
endscan
Of course, if your memo contains linefeeds as well (chr(10)), then this gets a bit more complicated - CR and LF may be in any combination, in any order. Then you may just replace each LF with a CR (using chrtran()) before the Do While above.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform