Topics Search

Remove spaces from tab delimited text file

Remove spaces from tab delimited text file
Views: 33
Is there a trim function like in Excel to eliminate extra spaces from a text file on import? Can't seem to find what I am looking for.
Sponsored Links:

Similar posts...

 

Import .txt tab delimited file

Import .txt tab delimited file Icon
I am struggling to write a code that allows me to import a text file that is tab delimited into a MS Access table.

Basically I don't want to use the "saved import" option and run through a macro because the location of the file is going to constantly change.

The code will be run through a form button on-click command, then it will prompt to locate the file with a similar window to that of a "open" or "save as". Once the text file has been selected, it was delete the data currently in "tblImport" and then append the data from the selected tab delimited text file. Also, the text file has field headings.
 

VBA Parse Tab Delimited Text File

VBA Parse Tab Delimited Text File Icon
Data supplied in tab delimited text file. Unfortunately there are more than 255 columns in the text file and can't directly import into an MS Access table (max 255 columns). Now trying to parse the text file (using VBA) to remove unwanted columns - idea being that once below 255 columns I can load into table.

I'm okay with parsing on tab character, chr(9), but I've hit problem if data record contains comma character. VBA INPUT verb appears to consider comma to be a variable delimiter.
 

Access .tab Importing issues

Access .tab Importing issues Icon
I have microsoft access 2003, and recently it will not import .tab files into either a new or existing data table. I get no error message when I select .tab files and then attempt to import, however, nothing happens.

The tab file is a delimited text file. It has never given me a problem,
 

Can I define the record delimiter when importing a text file into Access 2003?

Can I define the record delimiter when importing a text file into Access 2003? Icon
I'm receiving a text file from another system, and because some of the text fields within the data include CRs, records are delimited within the file by a carat (^) instead of a CR/LF. Ican control the field delimiters, and text qualifiers to ensure quotes within my text field are not misinterpreted, but can I control the record delimited?
 

Remove spaces in one field.

Remove spaces in one field. Icon
I am trying to remove front, trailing and mid spaces in a text field (Persons Name).
 

Remove blank spaces after strings in fields

Remove blank spaces after strings in fields Icon
I finally got my fields or columns setup the way I need them so I can successfully import an Excel Range.

Well I was going to show you an example, but apparently this forum automatically removes extra spaces, how coincidental, just what I'm looking for

So I tried to use the function Trim in Excel, but it was annoyingly troublesome with so many rows and columns, plus it didn't correct the actual columns, but instead displayed them in a new columns.

So I thought maybe it would be wiser to have Access remove the spaces. Of course with my limited knowledge of Access, I went to Google.

I found this script that looks like what I need exactly, I just don't know how to execute or apply it to my database, specifically to those four fields.

I have it as a file, trmStringExample.mdb and also in text format as I have shown below.
 

Importing a spaced delimited unfixed width text file via vba

Importing a spaced delimited unfixed width text file via vba Icon
I am having trouble importing a spaced delimited unfixed width text file via vba.

I have tried to use the import wizard and saving it spec then calling it using vba command however this seems to use the field width of the 1st few record/lines of the text which do notrepresent the full width of records.
 

Import file with spaces in file name

Import file with spaces in file name Icon
I'm trying to import files into my db. All works well if the file name has no spaces, but if there are spaces it bombs out. Is this a common feature or is there a way to allow my uses to import files with spaces in the file name.
 

Property not found, error occurred while trying to import file

Property not found, error occurred while trying to import file Icon
I'm trying to import a tab delimited text file into Access and I get this error Property not found.
An error occurred trying to import file [blah]. The file was not imported.

I imported this exact file yesterday without a problem. I was importing it again to overwrite the first one because I wanted to change some of the Long Integer fields to Text.

so I tried to just import the file again from scratch, not changing anything (leaving the Long Integer fields as theyare), but I still get this error.
 

TransferText

TransferText Icon
I need to move comma-delimited text files into Access.

I want to loop through a directory using VBA and create new tables in Access for each text file.

Right now, my VBA shell looks like this,
......

When I use Access's import wizard and step through (Delimited >> Delimiter = Comma, Qualifier = " >> Finish), my file imports without errors.

I save an import specification with those settings (Delimited, Delimiter = Comma, Qualifier = ") and re-import the file to verify the specification. Using the wizard, (Advanced, Specification = "Import" >> OK >> Finish). My file imports without errors.

But when I run the shell above, my file imports with 279 Type Conversion errors.

This occurs whether the syntax that follows TransferText is acImport or acImportDelim.