Results 1 to 3 of 3

Thread: Adding Spaces

  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a way to add spaces to a filed.

    I am working on an output file and the requested wants the values padded with spaces if the values do not fill the space alloted in the file specification.
    I can do a format, and just put in the spaces, but what about adding 20 or 30 spaces. This get combersome very fast. Also, there is a filler at the end of the row that is 90 spaces. Do not wish to type that in a format command.

    One other thing that is causing issues. Access seems to be adding a CRLF to the end of the Trailer record. Is this normal? Is there a way to stop this?


    Thanks for any help.
    Richard

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you export to a text file and specify fixed width in the wizard, field values will automatically be padded with spaces to the maximum width of the field.

    What do you mean by the trailer record? The last one? If so, as far as I know you can't prevent Access appending a CrLf after the last record. You could open the text file after it has been exported and remove the last CrLf, manually or using code.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excellent. The padding issue is resolved.

    To bad about the CRLF. I will just continue to open the file and remove.


    Thanks for your help
    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •