Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

saving excel 2007 as text file

Posted on 2011-09-20
9
174 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
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
 

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:Ingeborg Hawighorst
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:Ingeborg Hawighorst
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Excel Formula Help 3 31
Clear a Text Box 7 23
Excel: How to compare data in two columns 17 28
Excel VBA 30 32
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

792 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