Newbie Question on Extra Space After Numeric Values

Y

Yellowbird

Newbie question, but can't find an answer.

I have an Excel file created via export from Crystal Reports that now
needs to be saved as a CSV file. I've got that part down, but my
numeric values in my final CSV file have an extra space before the
comma and I'm not sure how to get rid of it.

The problem is that in Excel, the columns are formatted as numeric
values in the format 0.00. So I have three columns of values that look
like:

3.45 0.00 string
1.00 0.00 string
9.50 0.00 string
10.00 0.00 string
4.25 0.00 string

When I export the spreadsheet to the flat file CSV format, I get the
values with an extra space before the comma, as in:

3.45 ,0.00 ,string,
1.00 ,0.00 ,string,
9.50 ,0.00 ,string,
and so on

What I really want is:

3.45,0.00,string,
1.00,0.00,string,
9.50,0.00,string,

The info I found on the Web indicates that Excel inserts that extra
space so that numeric values will be properly aligned on the decimal
point and so that there will be enough space between the last numeric
and the start of the next column. It doesn't do that for string
values.

Is there a way to get this to format properly without the extra space?

Thanks in advance,
Yellowbird
 
L

LEB

I'm not seeing that behavior in Excel 2002. When I export
to CSV, there is no extra space in front of the comma. I
have used the "general" and "Number with 2 decimals"
and "text" formats in the cells, and there is never a
space before the comma. Sorry I can't help
 
C

Charley Kyd

Yellowbird,

Try changing your number format in Excel. I used the format #,##0.00 then
exported the data as a CSV file. When I opened the file with Notepad, I got
this result:

3.45,0.00,string
1.00,0.00,string
9.50,0.00,string
10.00,0.00,string
4.25,0.00,string

I think this is what you want.

Charley Kyd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top