Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
  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)

share|improve this answer
    
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 Feb 21 '11 at 16:34
    
@kaushik, glad that my answer is useful :) please accept it if it is the most suitable answer~ – wilson Feb 22 '11 at 1:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .