Excel 2007 - How to export a sheet to tab delimited text file without doublequotes

Q

qu4dman

Hello all,

I have a little problem to resolve. I have worked on an Excel 2007
sheet and am trying to export it to a tab delimited text file (Save
As...) but when the file is exported, and when I open it with a text
editor such as Notepad then I view a lot of doublequotes added to some
values... Do you have a clue about that ? I'd like to get a text file
that has nothing added to it when exporting it...

Thanks
 
D

Dave Peterson

Q

qu4dman

Excel does what it thinks is right.

You could use a macro and write code and have complete control over what you
write.

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:http://www.mcgimpsey.com/excel/textfiles.html

Earl's program may work right out of the box.

I did not say that Excel does a bad job :) Hehe.
I found a macro and that does what I need. I thought of programming
such a macro but as there are many one out there, I use them :)

Thank you :)
 
Q

qu4dman

Excel does what it thinks is right.

You could use a macro and write code and have complete control over what you
write.

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:http://www.mcgimpsey.com/excel/textfiles.html

Earl's program may work right out of the box.

Just in case this could help others in the same case and that would
get on this thread, the VBA macro I use is the following one, that can
be found on the URL
http://www.developerfood.com/comma-...6ba2-336b-4e8f-bc06-5298ee062614/article.aspx

I Public Sub TextNoModification()
Const DELIMITER As String = vbTab
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String

nFileNum = FreeFile
Open "D:\outputfiles\datafile1.txt" For Output As #nFileNum
For Each myRecord In Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells(1), _
Cells(.Row, Columns.Count).End(xlToLeft))
sOut = sOut & DELIMITER & myField.Text
Next myField
Print #nFileNum, Mid(sOut, 2)
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub
 
D

Dave Peterson

This is JE McGimpsey's code just posted (without attribution) somewhere else.

And by the way, you may have wanted to try Earl Kioserud's workbook. It offers
options and may require less knowledge of VBA than the others.
 

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