Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delimited text files 1

Status
Not open for further replies.

dzdncnfsd

MIS
Jul 14, 2000
118
US
Is there any way to export a table to a text file delimited only with semi-colons? I do not want the double quotes around the character fields.
Thanks, [sig]<p>Gladys Clemmer<br><a href=mailto:gladys.clemmer@fifsg.com>gladys.clemmer@fifsg.com</a><br><a href= > </a><br> [/sig]
 
Bizarre, but OK:

[tt]copy to MyFile.txt delimited with &quot;;&quot; [/tt]

See also: delimited with character &quot;x&quot;, which replaces the comma with &quot;x&quot;.
[sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Thanks, I specified delimited with &quot;;&quot; but it still included the quotes around the fields, too.
Thanks.
[sig]<p>Gladys Clemmer<br><a href=mailto:gladys.clemmer@fifsg.com>gladys.clemmer@fifsg.com</a><br><a href= > </a><br> [/sig]
 
Open the resulting file and replace all '&quot;' with ''. That is replace all the quotes with blanks.
[sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href= </a><br>ICQ #9466492<br>
ICQ VFP ActiveList #73897253[/sig]
 
FoxDev wrote:
copy to MyFile.txt delimited with &quot;;&quot;

Gladys wrote:
Thanks, I specified delimited with &quot;;&quot; but it still included the quotes around the fields, too.

Did you type it in exactly as shown? I just tried it again (VFP6, SP3) and I got the expected results: no quotes, but semicolons. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Maybe Clemmer put the quotes in with the delimeter? [sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br><a href= </a><br>ICQ #9466492<br>
ICQ VFP ActiveList #73897253[/sig]
 
I tried it two ways:

1)delimited with &quot;;&quot;
2)delimted with character &quot;;&quot;

1)gives fields delimted with ; and &quot;&quot; (&quot;field1&quot;;&quot;field2&quot;;)
2)gives fields delimited with ; and , (field1;,;field2;,)

I am using VFP5.

Thanks. [sig]<p>Gladys Clemmer<br><a href=mailto:gladys.clemmer@fifsg.com>gladys.clemmer@fifsg.com</a><br><a href= > </a><br> [/sig]
 
Use &quot;delimited with ' ' with character ';'&quot;
Looks like this is most appropriate, however, you will see spaces, like in sample data below:
441;8; CCITY ; CCITY ; CCITY ; C ;25;0; ;F
I tried space(0) instead of ' ', but VFP generates error. When place '' - VFP will add single quote.
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
If you are still having trouble with Foxpro strippng quotes, suggest using Monarch. Monarch will strip the quotes and is also very good at taking a text file and converting it back to a VFP .dbf file. We use it for sending files back and forth to the bank. [sig][/sig]
 
I finally solved this problem by exporting the database to a text file delimited with &quot;;&quot;. I then opened the text file from within FoxPro and did a search for &quot;&quot; and replaced it with nothing. It was much much faster than NotePad or WordPad.
Thanks. [sig]<p>Gladys Clemmer<br><a href=mailto:gladys.clemmer@fifsg.com>gladys.clemmer@fifsg.com</a><br><a href= > </a><br> [/sig]
 
I have a new problem related to this one. VFP 6 seems to allow &quot;copy to &myfile delimited with blank&quot;. This works for me for a table with numeric fields in it, but if I have a table with character fields, it still puts double quotes around them - eg: &quot;field1&quot;field2&quot;. Anyone know why? This is contrary to what the documentation says.

Thanks,

Simon
 
DELIMITED Creates a delimited file with comma as the default dlimeter.
As per help file .... &quot;A delimited file is an ASCII text file in which each record ends with a carriage return and linefeed. The default field separator is a comma. Since character data may include commas, character fields are additionally delimited with double quotation marks.&quot;

PLease try with the code ...
COPY TO (myfile) TYPE DELIMITED WITH BLANK
This could solve your problem.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top