Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Thanked 0 Times in 0 Posts

    Importing from text file removes leading spaces (AccessXP)

    I am importing a text file into my database. Some of the text fields are preceded by a space. I need the space to be there. However, when I import the data, the spaces are removed. Is there a way to prevent this from happening?

    Attached is a sample file. The file has the following lines " spaces" <tab> " are" <tab> " commonly" <tab> " found" <tab> " before" <tab> " text." However, importing this text into an access table removes all the leading spaces.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Importing from text file removes leading spaces (AccessXP)

    Access trims the leading and trailing spaces from text values when you import a delimited file. You can do the following:
    - Open the text file in Excel (specifying Tab as delimiter).
    - Save it as an Excel workbook.
    - Import the workbook into Access. This preserves leading and trailing spaces.

Posting Permissions

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