How do I save a 689 character fixed field/record format file

M

Mike

Need to save a file in a fixed length format for import into another
application. Need to know how to do this in Excel and not wrap the records
as I am experiencing using PRN format.
 
P

Pete_UK

You can use the formula:

=TEXT(Sheet1!A1,"000000.000")

as an example to convert a numeric value from A1 in Sheet1 into a
fixed length string of 6-digit integer values (with leading zeros if
required) and 3 decimal places after the point (10 characters in all).
Just change the format string to adjust for other requirements. You
can also use this for dates.

You can use the REPT function to add leading or trailing spaces to a
text value to make it a fixed number of characters, by taking account
of the LENgth of the string and adding sufficient spaces to make it up
to your fixed length.

If you do this in a second sheet and copy the formulae down, then you
can convert your variable length records in Sheet1 to fixed length in
Sheet2. You can fix the values in the second sheet (and delete the
first sheet if necessary). Using File | Save As you can choose the
file type, eg .csv or .txt.

Hope this helps.

Pete
 

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