#1   Report Post  
Posted to microsoft.public.excel.misc
Mr_Philip
 
Posts: n/a
Default Excel to Txt file


Hi,

I need to convert an excel sprteadsheet to a txt file to be used in and
EDI upload to another system. For the data to upload from the txt file I
need the spacing of the data columns inthe txt file to be exact.

Question: How do I specify the spacing of the text when converting an
excel document to a txt file??


--
Mr_Philip
------------------------------------------------------------------------
Mr_Philip's Profile: http://www.excelforum.com/member.php...o&userid=31415
View this thread: http://www.excelforum.com/showthread...hreadid=524748

  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK
 
Posts: n/a
Default Excel to Txt file

If you have a numeric field you can convert this to text of a certain
width by means of a formula like:

=TEXT(A1,"00000000")

This would make it 8 characters wide. If you want to make a text field
a certain width, then you can use a formula like:

=IF(LEN(B1)=20,LEFT(B1,20),B1&REPT(" ",20-LEN(B1)))

This will make it 20 characters wide - if the text is longer than this
to begin with it will be truncated, otherwise it will have sufficeient
spaces added on to the end to make it up to 20 characters.

You can adapt this approach to your other fields. I would suggest that
you do this in a second sheet, where all the formulae refer to Sheet1.
Then you can fix the values and it is Sheet2 that you will export as
the fixed-width text file.

Hope this helps.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.misc
Mr_Philip
 
Posts: n/a
Default Excel to Txt file


Thanks!!

One more problem. Some of the text is formatted to read for example:

0000000000027.31
0000000000321.52

when I write the above formula it loses the formatting and goes back
to

27.31
321.52.

Is there any way around this? it will not accept a reformat.


--
Mr_Philip
------------------------------------------------------------------------
Mr_Philip's Profile: http://www.excelforum.com/member.php...o&userid=31415
View this thread: http://www.excelforum.com/showthread...hreadid=524748

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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Insert & link a graphic file in Excel 2003 -- updatable pictures! ODI Excel Discussion (Misc queries) 7 November 14th 05 02:36 PM
Reflecting info between an excel file and a word one or two excel file. Starriol Links and Linking in Excel 0 November 3rd 05 01:49 PM
Very slow in opening Excel 97 file in Excel 2003 S M Setting up and Configuration of Excel 0 October 22nd 05 07:32 PM
Locating a file in excel with a partial file name. Audra Excel Discussion (Misc queries) 2 February 19th 05 08:52 PM


All times are GMT +1. The time now is 10:55 PM.

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"