Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Frustrated Excel user
 
Posts: n/a
Default Converting negative/positive numbers to a CSV (Comma-delimited .TX

If I have numbers in a column in an Excel spreadsheet and I want to import
those numbers into another application (IBM Mainframe), so I have to convert
the numbers to a comma-delimited .TXT file, how do I keep all the numbers
aligned together? My problem is that when I convert it, it misaligns the
negative versus positive numbers. For example:

2.0
-005.2
-006.5
115.9
When I convert these, I would like them to line up as follows in the .TXT
file:

2.0
-005.2
-006.5
115.9

What happens is I see them as this:
002.0
-005.2
-006.5
115.9

My columns are set up as "Custom" with ###.# as their format.

Any suggestions? Is there a way to change the default to where it shows
negatives with a minus sign and positives with a plus (which might line them
up correctly)?
  #2   Report Post  
Simon Letten
 
Posts: n/a
Default

You could use the custom format +###.#;-###.# In Excel the formats are
composed of 3 parts separated by semi-colons: positive;zero;negative. Would
you be better off padding all the numbers with leading spaces so that they
are all the same length?

Something like = REPT(" ",6-LEN(A1))&A1

where A1 contains your number and 6 is the max length of text you want.
--


Simon


"Frustrated Excel user" wrote:

If I have numbers in a column in an Excel spreadsheet and I want to import
those numbers into another application (IBM Mainframe), so I have to convert
the numbers to a comma-delimited .TXT file, how do I keep all the numbers
aligned together? My problem is that when I convert it, it misaligns the
negative versus positive numbers. For example:

2.0
-005.2
-006.5
115.9
When I convert these, I would like them to line up as follows in the .TXT
file:

2.0
-005.2
-006.5
115.9

What happens is I see them as this:
002.0
-005.2
-006.5
115.9

My columns are set up as "Custom" with ###.# as their format.

Any suggestions? Is there a way to change the default to where it shows
negatives with a minus sign and positives with a plus (which might line them
up correctly)?

  #3   Report Post  
Gary's Student
 
Posts: n/a
Default

Another easy way is to install an additional printer (Generic/Text Only) and
associate the printer with a disk file. Printing to this printer would
actually create the file. By setting alignment and print options correctly
you should be able to get the file in any desired format.
--
Gary's Student


"Frustrated Excel user" wrote:

If I have numbers in a column in an Excel spreadsheet and I want to import
those numbers into another application (IBM Mainframe), so I have to convert
the numbers to a comma-delimited .TXT file, how do I keep all the numbers
aligned together? My problem is that when I convert it, it misaligns the
negative versus positive numbers. For example:

2.0
-005.2
-006.5
115.9
When I convert these, I would like them to line up as follows in the .TXT
file:

2.0
-005.2
-006.5
115.9

What happens is I see them as this:
002.0
-005.2
-006.5
115.9

My columns are set up as "Custom" with ###.# as their format.

Any suggestions? Is there a way to change the default to where it shows
negatives with a minus sign and positives with a plus (which might line them
up correctly)?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting numbers formatted as text to numbers Bill Excel Discussion (Misc queries) 1 July 19th 05 07:10 PM
csv converting numbers to scientific format JR Excel Discussion (Misc queries) 7 June 16th 05 12:13 AM
Converting Numbers Richard Excel Discussion (Misc queries) 5 April 15th 05 01:58 AM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
roundoff when converting text to numbers Jack Excel Worksheet Functions 3 January 30th 05 01:51 AM


All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"