Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Derrick Bruce
  Where is Derrick Bruce?
 Charlestown
 Indiana - United States
 Derrick Bruce
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Carriage Return Symbol Stored in Data
Thread ID: 228691 Message ID: 228820 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, May 21, 2009 7:51:05 PM         
   


> >
> > Yeah, already had to do this on one field to clear out characters that would crap out the import - it would end up being about 25 fields to clean up in the end and was really hoping that the edit box had a function on it that did this similar to supressing the line feeds. Thanks. This is a single row cursor, before anyone gets on me for my very general UPDATE command.
> >
>
> Hey, why do you use SQL Update ... :-)
>
> >
cpjob = csrcontrol.pojob
> > IF EMPTY(cpjob)
> > cpjob = ''
> > ELSE
> > cpjob = STRTRAN(cpjob,"'",' ')
> > cpjob = STRTRAN(cpjob,'"',' ')
> > cpjob = STRTRAN(cpjob,'`',' ')
> > cpjob = STRTRAN(cpjob,'~',' ')
> > UPDATE csrcontrol SET pojob = cpjob
> > endif

>
> Seriously, I'd use ChrTran() and Replace, e.g.:
>
>
> REPLACE pojob WITH CHRTRAN(pojob, ['"`~],'') in csrcontrol
> 

>
>
> -Stefan



Not sure, I got talked off of using REPLACE a long time ago, probably because I have a bad habit of doing a lot of looping and forgetting to re-select the table I wanted to do the replace in and calling some other table inside the loop. That set of code was a little organic too, as the only way I could figure out what characters I couldn't use was to give them each a run through and try an import - so they were more visible to me like that.

D

ENTIRE THREAD

Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/20/2009 8:42:24 PM
RE: Carriage Return Symbol Stored in Data Posted by Ammar Hadi @ 5/20/2009 9:03:14 PM
RE: Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/21/2009 4:30:11 PM
RE: Carriage Return Symbol Stored in Data Posted by Camil Ghircoias @ 5/20/2009 9:04:44 PM
RE: Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/21/2009 4:39:16 PM
RE: Carriage Return Symbol Stored in Data Posted by Stefan Wuebbe @ 5/21/2009 4:48:58 PM
RE: Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/21/2009 7:51:05 PM