Solved

saving excel 2007 as text file

Posted on 2011-09-20
9
171 Views
Last Modified: 2012-08-13
Hi Experts

I am trying to save a column of numbers enclosed by single quotes and delimited by a comma as a text file. But when I try to do it, each cell is enclosed by double quotes.

So in excel I see this:

'001232',
'003232',
'787201'

and when I view the text file that I have exported I see this:

"'001232',"
"'003232',"
"'787201'"

Does anyone know how I can save cells as a text file - without the extra double quotation marks?

Thanks
0
Comment
Question by:stummj
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 3

Accepted Solution

by:
dahesi earned 500 total points
ID: 36565851
maybe this workaround will help:

search & replace >"< with >< nothing (via notepad).
0
 

Author Comment

by:stummj
ID: 36565878
That was an obvious workaround that I missed! Trying to overengineer this!! Thank you. I'll keep this open in case anyone knows how to do it properly but I will reward you with points before I close the question. Thanks
0
 
LVL 5

Expert Comment

by:DerZauberer
ID: 36565891
Hmm strage. I tried to reproduce, but i get text without double quotes, no matter what output type i choose ...
What is your Cell format like is it "Text"?
What exact formula is shown for your cells?
Is it like this >''001232',< starting with two double quotes?
0
 
LVL 50

Expert Comment

by:teylyn
ID: 36566052
Hello,

the data sample that you show above contains the comma within the cell.

'001232',
'003232',
'787201'

If you export that data to a text file, Excel will add double quotes around each cell value that contains a comma, in order to distinguish the comma that is part of the data from the comma that separates the fields in a comma separated file.

Does that make sense?

If you want to avoid the double quotes in the text file, you will need to remove the commas from the cells before saving as text file.

cheers, teylyn
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:stummj
ID: 36566315
That makes perfect sense teyln - except I'm saving as dos text, so I was expecting like for like. I wasnt saving as a csv. If I remove the comma, Im breaking the integrity of the data, as the data itself needs a comma within the string.
0
 
LVL 50

Expert Comment

by:teylyn
ID: 36566326
If you need the comma in the data, then you will have to live with the double quotes upon export to txt. The Search and Replace from the first comment seems like the best workaround in that situation.

cheers, teylyn
0
 
LVL 5

Expert Comment

by:DerZauberer
ID: 36587009
Can you try if you still get the double quotes if you save using a macro like this:

ActiveWorkbook.SaveAs Filename:="D:\TEMP\exceltest.txt", FileFormat:= xlTextMSDOS, CreateBackup:=False

Open in new window

0
 
LVL 50

Expert Comment

by:teylyn
ID: 36590655
Yes, if you export to DOS txt format, the same thing will happen to cells that have commas in the text.

As a workaround, you could copy and paste the cells into a Word document (as unformatted text), then save the Word document as a Plain Text file. Or copy and paste into Notepad or plain text editor.

cheers, teylyn

0
 

Author Closing Comment

by:stummj
ID: 36715135
Thank you very much. Not pretty but a very useable workaround.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now