Remove Tab file

  • Thread starter Benjamins via AccessMonster.com
  • Start date
B

Benjamins via AccessMonster.com

Hi,

I need some advice on how to check whether the string is containing a tab.

The situation.

I have a raw data where in a text file. I was told to do a filter the data
and input it back into a new tect file so that i only show only the relavent
data.

I use access to read line by line the text file and filter out the wanted
line, but when it came to tab charater, i can't filter charater starting with
tab.

Please help...
 
A

Allen Browne

It is possible to program VBA to Open the file for input, Input # to read
line by line, and use Instr() to locate the tab, or Replace() to bypass it.

That's really only worth the effort if you are doing imports repeatedly. If
this is a one-off, you could just open the file in Word, and use a
search'n'replace to change the tab character (^t) into something else (such
as 4 spaces.)
 
B

Benjamins via AccessMonster.com

Hi,

The report is done daily and i have no control over of the raw text file that
is sent to me. If i want to use the replace method "Replace(strline,X,"")",
what should i put in X?

Allen said:
It is possible to program VBA to Open the file for input, Input # to read
line by line, and use Instr() to locate the tab, or Replace() to bypass it.

That's really only worth the effort if you are doing imports repeatedly. If
this is a one-off, you could just open the file in Word, and use a
search'n'replace to change the tab character (^t) into something else (such
as 4 spaces.)
I need some advice on how to check whether the string is containing a tab.
[quoted text clipped - 11 lines]
Please help...
 
A

Allen Browne

Benjamins via AccessMonster.com said:
The report is done daily and i have no control over of the raw text file
that
is sent to me. If i want to use the replace method
"Replace(strline,X,"")",
what should i put in X?

Chr(9) should to it.

Or vbKeyTab might be better in VBA code.
 

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