Link to home
Start Free TrialLog in
Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on

Store the words in a .txt file in a table...

test.txt contails some text in multiple lines. There is alos some occassional blank lines in it.

Question: How to store the words in it in a table in Access.

A blank space(s) separates the words.

Thank you
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

have you tried importing the text file?

External Data > select Text file from Import group
follow the wizard

if you want to do this using automation, you need to create an import specification.
Avatar of Mike Eghtebas

ASKER

re> have you tried importing the text file?

The lines in the text file are sentenses. These sentenses need to be disected (maybe using split function/method). The array produced needs to be cycled and its content (the words) then could be entered in the table.

Or there maybe a better way to do this. I am a bit rusty doing the above I thought I ask for some assitance.

Thanks,

Mike
If there is some way you can get the words into cells of a table, then you can work with the table as a data source for import into an Access table.  See my old Code Sample 8 on this topic:

http://www.helenfeddema.com/Files/code8.zip
re:> If there is some way you can get the words into cells of a table

This is what I am trying to accomplish in this question. This is like a circular answere, lol.

Thanks,

Mike
you can read the text file line by line and decide how you want to treat the read lines.

post the text file here and explain how you want it parsed/dissected
I am disappointed at myself for not being able to describe this easily so others could understand it. Here I am repeating my original questions with examples:

test.txt contails some text in multiple lines.
---- test.txt--------
Water  date 5/78
tomorrow  yesterday ...

Monday appointment
---- end of test.txt--------

Question: How to store the words in it in a table in Access.

-------------tWord in Access----------
ID       Word         <-- field names
-----    -------
1      Water  
2      date
3     5/78
4    tomorrow  
5    yesterday
6    ...
--------------- end of the table tWord----

Please let me know if this is not clear,

Regards,

Mike
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.