ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Double quotes when exporting to tab delimited file (https://www.excelbanter.com/excel-discussion-misc-queries/253116-double-quotes-when-exporting-tab-delimited-file.html)

jjk98

Double quotes when exporting to tab delimited file
 
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.
--
Thanks for your help - jjk98

JR Hester

Double quotes when exporting to tab delimited file
 
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

"jjk98" wrote:

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.
--
Thanks for your help - jjk98


jjk98

Double quotes when exporting to tab delimited file
 
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.


--
Thanks for your help - jjk98


"JR Hester" wrote:

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

"jjk98" wrote:

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.
--
Thanks for your help - jjk98



All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com