Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clean up Memo column in MySQL
Message
De
16/04/2012 05:56:32
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/04/2012 13:01:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01541570
Message ID:
01541597
Vues:
41
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform