Hi,

I have a text file in which every 'field' is fixed length, separated with
',' and character fields are DELIMITED with "" i.e.

"Field1","Field2","Name contains double quots in data "a"", 999

However in some rows third column contains double quotes inside data.

What should be APPEND FROM .... in this case so that the result should be:
Field1 Field2 Name contains double quots in data "a" 999


TIA

Kamran

Re: APPEND FROM text file containing " in data by Gene

Gene
Fri Jul 01 15:39:15 CDT 2005

On Fri, 1 Jul 2005 15:24:16 -0400, "Kamran Ahmad"
<kahmad@gcom2-nnn.com> wrote:

>I have a text file in which every 'field' is fixed length, separated with
>',' and character fields are DELIMITED with "" i.e.
>
>"Field1","Field2","Name contains double quots in data "a"", 999
>
>However in some rows third column contains double quotes inside data.
>
>What should be APPEND FROM .... in this case so that the result should be:
>Field1 Field2 Name contains double quots in data "a" 999

The closest that I could get was
append from <filename> delimited with ,
This would give a result of
"Field1" "Field2" "Name contains double quots in data
"a"" 999
You would have to strip out the first and last quote for each
character column, as in
replace all <columnname> with;
substr(rtrim(<columnname>),2,len(rtrim(<columnname>))-2)

Sincerely,

Gene Wirchenko


SV: APPEND FROM text file containing " in data by Anders

Anders
Fri Jul 01 16:31:32 CDT 2005

Append the textfile to string andlook for rows that contain too many quotes
s= FILETOSTR('mytext.txt')
FOR i = 1 TO MEMLINES(s)
x = MLINE(s)
IF OCCURS('"', x) > <expected number>
? i, x
ENDIF
NEXT
Fix these lines, then append.
Tell your text provider not to do this again. <g>

-Anders


Den 05-07-01 21.24, i artikeln uN9T0JnfFHA.2700@TK2MSFTNGP15.phx.gbl, skrev
"Kamran Ahmad" <kahmad@gcom2-nnn.com>:

> Hi,
>
> I have a text file in which every 'field' is fixed length, separated with
> ',' and character fields are DELIMITED with "" i.e.
>
> "Field1","Field2","Name contains double quots in data "a"", 999
>
> However in some rows third column contains double quotes inside data.
>
> What should be APPEND FROM .... in this case so that the result should be:
> Field1 Field2 Name contains double quots in data "a" 999
>
>
> TIA
>
> Kamran
>
>


Re: APPEND FROM text file containing " in data by Cindy

Cindy
Tue Jul 05 14:43:00 CDT 2005

In cases where there are problematic quotes, good choices for delimiters are
Tab, tilde (~) and bar (|).

--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
cindy_winegarden@msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"Anders" <anders.altberg@telia.com> wrote in message
news:BEEB82D4.1701%anders.altberg@telia.com...
> Tell your text provider not to do this again. <g>