# Saving an Excel work sheet as text

**URL:** <https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735>\
**Category:** Factual Questions\
**Created:** [December 12, 2007, 1:20pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735 "2007-12-12T13:20:23Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 1:20pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/1 "2007-12-12T13:20:23Z")

</div>

I’m trying to manipulate data in a txt file (\*.cfg) in Excel and then save it as pure text. I’m having problems using “save as” from Excel because it insists on puting some of the text in quotes “”. Here is an example:

Original text

```auto

[GeneralEngineData]
engine_type=5
Engine.0=0.4, -2.5, 0.3 // was -1
Engine.1=0.4 , 2.5, 0.3 
Engine.2=0.4, -2.5, 0.3 
Engine.3=0.4 , 2.5, 0.3 
fuel_flow_scalar=1.203 // was 0.987, 1.122
min_throttle_limit=-0.299927

```

Text saved from Excel

```auto

[GeneralEngineData]
engine_type=5
"Engine.0=0.4, -2.5, 0.3 // was -1"
"Engine.1=0.4 , 2.5, 0.3 "
"Engine.2=0.4, -2.5, 0.3 "
"Engine.3=0.4 , 2.5, 0.3 "
"fuel_flow_scalar=1.203 // was 0.987, 1.122"
min_throttle_limit=-0.299927

```

This was done without doing any manipulation of the data at all, no “text to columns” or anything.

Any ideas on how to do this properly?

---

<div class="post-metadata">

**Author:** ![don\_t\_ask](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@don\_t\_ask](https://boards.straightdope.com/u/don_t_ask)\
**Post date:** [December 12, 2007, 1:22pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/2 "2007-12-12T13:22:50Z")

</div>

Copy it and paste it in notepad.

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 1:34pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/3 "2007-12-12T13:34:23Z")

</div>

[QUOTE=don’t ask]  
Copy it and paste it in notepad.  
[/QUOTE]

Thanks, I was trying to avoid copy/paste because I will eventually want to use a macro to do this, is it possible to get a macro to copy/paste into another program?

---

<div class="post-metadata">

**Author:** ![Pushkin](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@Pushkin](https://boards.straightdope.com/u/Pushkin)\
**Post date:** [December 12, 2007, 2:01pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/4 "2007-12-12T14:01:56Z")

</div>

Could you just have a macro to select all then copy so that all you have to do is ctrl-v to paste it in Notepad?

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 2:40pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/5 "2007-12-12T14:40:47Z")

</div>

At the moment it is probably just as easy to click on the top left square and then CTRL+C.

---

<div class="post-metadata">

**Author:** ![msmith537](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@msmith537](https://boards.straightdope.com/u/msmith537)\
**Post date:** [December 12, 2007, 2:43pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/6 "2007-12-12T14:43:54Z")

</div>

Usually saving it as either a CSV or TXT file works. CSV is really just a text file where each cell is separated by a comma (Comma Separated Values)

---

<div class="post-metadata">

**Author:** ![CookingWithGas](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cookingwithgas/32/485_2.png) [@CookingWithGas](https://boards.straightdope.com/u/CookingWithGas)\
**Post date:** [December 12, 2007, 3:03pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/7 "2007-12-12T15:03:51Z")

</div>

[QUOTE=msmith537]  
Usually saving it as either a CSV or TXT file works. CSV is really just a text file where each cell is separated by a comma (Comma Separated Values)  
[/QUOTE]  
It doesn’t work in this case. That is the nature of the problem. Excel is storing each cell in the .txt file, separating cells in the same row with a comma. When the text in a cell contains a comma, Excel must enclose the cell in quotes to ensure that any program reading the data will also interpret it as a single cell, rather than two cells separated by the comma.

You cannot write a macro that will copy then paste into an application that does not support VBA (you could copy and paste into Word with a single macro, for example, but not into Notepad).

> [@1920s Style "Death Ray"](#):
>
> I’m trying to manipulate data in a txt file (\*.cfg) in Excel…

When I see people having trouble with something like this I usually go back to the beginning. Why are you manipulating this data in Excel? What are you doing to it? From what is shown in the OP it looks like you are not treating the data as numbers in separate cells, but as lines of text. Excel might not be the best solution.

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 3:48pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/8 "2007-12-12T15:48:19Z")

</div>

> [@](#):
>
> Excel is storing each cell in the .txt file, separating cells in the same row with a comma. When the text in a cell contains a comma, Excel must enclose the cell in quotes to ensure that any program reading the data will also interpret it as a single cell, rather than two cells separated by the comma.

Can I fix this by using TAB separated and making sure there are no tabs in the text? _Edit: Apparently not as there don’t appear to be any tabs but the problem still occurs in tab separated .txt._

> [@](#):
>
> When I see people having trouble with something like this I usually go back to the beginning. Why are you manipulating this data in Excel? What are you doing to it? From what is shown in the OP it looks like you are not treating the data as numbers in separate cells, but as lines of text. Excel might not be the best solution.

A good idea.

I’m trying to make a spreadsheet that can edit the aircraft configuration files from Microsoft Flightsim 2004. Specifically I want to be able to tell it how many passengers and cargo I want on my aeroplane. There is a small amount of data manipulation, no more complicated than simple arithmetic and multiplication. I’d like it to use Excel, because I’d like to have it in the same workbook as my fuel calculations.

I have no problems with any of it except for saving it. At the moment I’ve taken **don’t ask** ’s suggestion and am just copy/pasting.

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 3:55pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/9 "2007-12-12T15:55:21Z")

</div>

[QUOTE=1920s Style “Death Ray”]  
Specifically I want to be able to tell it how many passengers and cargo I want on my aeroplane.  
[/QUOTE]

I am aware that FS2004 already has a facility for doing this but I’d like to intergrate it into other things such as fuel planning etc.

---

<div class="post-metadata">

**Author:** ![Quartz](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/quartz/32/267_2.png) [@Quartz](https://boards.straightdope.com/u/Quartz)\
**Post date:** [December 12, 2007, 4:09pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/10 "2007-12-12T16:09:32Z")

</div>

If it’s just the text you want, try printing it to a file. You’ll need to install a Generic Text-only printer

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 4:44pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/11 "2007-12-12T16:44:27Z")

</div>

That would be almost perfect except it ends up with lots of these "" which seems to “break” the file. Any ideas on what would cause those? I tried copying some into this post but they came out as line breaks.

_Edit: the symbol that should’ve been in the quotes is a square character that you sometimes see when you don’t have the correct font installed._

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 12, 2007, 5:26pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/12 "2007-12-12T17:26:47Z")

</div>

It seems that the text printer driver is adding line breaks (probably not a problem) and also cutting off text (problem.) Text print drivers that appear to work properly are quite expensive!

---

<div class="post-metadata">

**Author:** ![iwakura43](https://avatars.discourse-cdn.com/v4/letter/i/9de0a6/32.png) [@iwakura43](https://boards.straightdope.com/u/iwakura43)\
**Post date:** [December 12, 2007, 6:08pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/13 "2007-12-12T18:08:43Z")

</div>

Try saving as “Formatted Text (space delimited) (\*.prn)”, which will give you a text file you can open in notepad.

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 13, 2007, 12:46am UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/14 "2007-12-13T00:46:07Z")

</div>

I think that worked. It doesn’t have any errors I can see anyway.

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 15, 2007, 10:25pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/15 "2007-12-15T22:25:56Z")

</div>

[QUOTE=iwakura43]  
Try saving as “Formatted Text (space delimited) (\*.prn)”, which will give you a text file you can open in notepad.  
[/QUOTE]

That worked well thanks. I’ve now set up a macro to do this with the press of a button!

---

<div class="post-metadata">

**Author:** ![Richard\_Pearse](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/richard_pearse/32/13144_2.png) [@Richard\_Pearse](https://boards.straightdope.com/u/Richard_Pearse)\
**Post date:** [December 15, 2007, 10:32pm UTC](https://boards.straightdope.com/t/saving-an-excel-work-sheet-as-text/429735/16 "2007-12-15T22:32:20Z")

</div>

P.S. I’ve got it saving directly as a \*.cfg so I don’t even need to open it in note pad.
