how to get rid of tabs

zhujp98
09-06-2003, 11:04 PM
VB6
I have a text file which contains

'mytxt.txt
this is txt file
for excieses

which contans tabs

i wnat to get rid of it


All the empty line contains one or several tabs "\t\t...\t"

My code is

Line input #1, strTemp
if trim$(strTemp<>"")
strArray(index)=strTemp

My intention is to store all row of txt file to an array of strings except
the empty row, but it does not work maybe because trim can not take care of tab.
how can i acheive my goal?
Thanks

rajeeshun
09-06-2003, 11:13 PM
VB6
I have a text file which contains

'mytxt.txt
this is txt file
for excieses

which contans tabs

i wnat to get rid of it


All the empty line contains one or several tabs "\t\t...\t"

My code is

Line input #1, strTemp
if trim$(strTemp<>"")
strArray(index)=strTemp

My intention is to store all row of txt file to an array of strings except
the empty row, but it does not work maybe because trim can not take care of tab.
how can i acheive my goal?
Thanks

Two things
If you want to skip the blank row then just use len function to identify the blank and move to newxt row (If len(lstrtemp) then goto )

Second,
If you want to remove the tab then identify the tab key by using chr(9)

Chris J Locke
09-07-2003, 02:38 AM
If you're using VB6, that also has a REPLACE command. You can replace tabs with 'nothing' - ie, a$=replace(myString$,vbTab,"") - replace tabs with nothing, in the string variable myString$, and shove that back out to a$...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum