Double quotes when exporting to tab delimited file

J

jjk98

When exporting a worksheet to a tab delimited text file (.txt), fields
explicitly typed as text which contain a double quote (") are changed by
replacing each occurence of the single " with a pair of them.

For example the text in the spreadsheet reads: "Tin Foil" Revenues the
exported text is ""Tin Foil"" Revenues.

How do I stop this action? I have Excell 2007 and my spreadsheet has many
thousands of quoted strings.
 
J

JR Hester

Excel will always place text inside quotes when exporting as described. One
option is to run a find replace on eth resulting text file from Wordpad or
another text editor. replace "" with " should work for you.

HTH
 
J

jjk98

Unfortunately your solution does not work. If the string contains a comma
(and potentially other non-alphabetic characters, I'm still experimenting)
Excel will place a double quote at the start and end of the string upon
export in addition to doubling any instances of the double quote character.
Thus the string

Roy Rogers sang "Adios, Amigo"

becomes

"Roy Rogers sang ""Adios, Amigo"""

If one replaces the paired double quotes with a single instance, then after
replacement one has

"Roy Rogers sang "Adios, Amigo""

And a second replacement yields

"Roy Rogers sang "Adios, Amigo

which is not the original string.

Why does Excel do this?

Is there any other export format that does not modify the source text? For
subsequent processing I must have the output as a text file but I do not care
what the delimiter is (tab is best, any non printable character is OK) and
there are a few printable characters such as =, <, >, \, |, {, }, and few
others that are also OK.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top