Number format for text export from Excel

3

1

Basically I am exporting a block of columns from Excel to text file. that might look similar to this in Excel:

0 34.3 22.555 56.8970 34

Now I want that to look in the text file as:

0.000 34.300 22.555 56.897 34.000

so, essentially keeping the spacing the same (same number of decimals).

But, when I export I am not able to achieve that.

Tips and helps will be greatly appreciated.

kaushik

Posted 2011-02-17T21:57:01.387

Reputation: 31

Answers

0

If you've formatted the cells in Excel to look the way you want them to appear (i.e. in this case: Format, Cells, Number, Decimal places = 3) when you Save As, Text, it should save the text with the appropriate number of decimal places.

Craig H

Posted 2011-02-17T21:57:01.387

Reputation: 1 172

0

  1. Format the cell(s) to the desire format
    Highlight the cell(s) > Press Ctrl-1 (or right click, format cells) > Number > Decimal places = 3

  2. Save
    a) File > Save As > Choose appropriate file format, like CSV (1) or TSV (2) > Save
    ---OR---
    b) For TSV (2) with no quotes ", Select all > Copy > Open Notepad > Paste > Save

The decimal places formatting is preserved. (Tested in Excel 2003)

Note:
(1) CSV = Comma-separated values file format (wiki)
(2) TSV = Tab-separated values file format (wiki)

wilson

Posted 2011-02-17T21:57:01.387

Reputation: 4 113

great! that was exactly what i needed. I read Craig's reply and tried to figure that out, but you made it much simpler :) – kaushik – 2011-02-21T16:34:12.263

@kaushik, glad that my answer is useful :) please accept it if it is the most suitable answer~ – wilson – 2011-02-22T01:34:48.213