Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment
  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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.