Read a text file word by word

  • Thread starter Thread starter naiya
  • Start date Start date
N

naiya

i have to develop a VB application which reads the text from a .txt
file, and i have to write the contents of the file to an Excel sheet.

the format of the .txt file is
name age company
abc 23 xyz
def 18 ghy ... and so on

now when i load this data into an excel sheet, all diff information
shouls appear in different cells of the excel sheet.
Please help
 
What is the field separator ? What is the problem ?

You could read each line use the Split method to break down hte line fields
(the separator is a tab ?)

As a side note, Excel is able to read tab delimited files...
 
Patrice said:
As a side note, Excel is able to read tab delimited files...

....and if you give them an extension of .xls it will open them without
complaint. You can even use formulae in the tab-delimited file, like =A2+B2
or =second(now())

Andrew
 
dear Patrice

plz tell me the syntax of the split method. the seperator is a tab.

Naiya
 

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

Back
Top