Exporting With Fields Padded With Spaces

G

Guest

I am creating an ASCII file by using the Print command to a text file. I
want to have fixed-length fields in my ASCII file, with all fields padded
with spaces to their maximum size. But instead I am getting fields that
apparently are trimmed. Is there some way to specifiy padding as opposed to
trimming?

Thanks,
Tom Glasser
 
G

Guest

You need to export a query and not a table. Further, you need to force in the
spaces with something like this:

WithSpaces: [txtCourseNo] & String(24-Len([txtCourseNo])," ")

This will pad out the string to up to 24 characters with spaces. You might
also consider exporting the data as fixed-width text for better control. You
could use and import/export specification to better tune things.
 
G

Guest

Or the Space() function:
[txtCourseNo] & Space(24-Len([txtCourseNo]))

Jerry Whittle said:
You need to export a query and not a table. Further, you need to force in the
spaces with something like this:

WithSpaces: [txtCourseNo] & String(24-Len([txtCourseNo])," ")

This will pad out the string to up to 24 characters with spaces. You might
also consider exporting the data as fixed-width text for better control. You
could use and import/export specification to better tune things.

--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Tom Glasser said:
I am creating an ASCII file by using the Print command to a text file. I
want to have fixed-length fields in my ASCII file, with all fields padded
with spaces to their maximum size. But instead I am getting fields that
apparently are trimmed. Is there some way to specifiy padding as opposed to
trimming?

Thanks,
Tom Glasser
 

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