How do I automate importing text file?

  • Thread starter Russ via AccessMonster.com
  • Start date
R

Russ via AccessMonster.com

Hello,

Question 1 is how do you automate the importing of a text file?
Here is an example of the information;

"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","92","QTY","55"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","63","QTY","99"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","15","QTY","55","06:50:50","<<F3>>"

Problem 2 is sometimes (depending on the process) there are more fields like
this;

"Emp","63","Department","87","05-24-2008","06:50:16","Process","C","7","Item",
"92","QTY","88"
"Emp","63","Department","87","05-24-2008","06:50:16","Process","C","7","Item",
"87","QTY","99"
"Emp","63","Department","87","05-24-2008","06:50:16","Process","C","7","Item",
"63","QTY","77","06:50:31","EOR","<<F3>>"

"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","92","QTY","55"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","63","QTY","99"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","15","QTY","55","06:50:50","<<F3>>"

"Emp","92","Department","15","05-25-2008","14:30:34","Process","D",â€Work
Orderâ€,"Y" ,â€Work Order IDâ€, "63","4","Equip ID","11232","N","14:31:11"
"Emp","92","Department","15","05-25-2008","14:31:20","Process","D",â€Work
Orderâ€,"N" ,"Equip ID","92","Parts Required?","Y","Item","BB716","QTY","88"
"Emp","92","Department","15","05-25-2008","14:31:20","Process","D","N","Equip
ID","92","Parts Required?","Y","Item","AC627","QTY","44"
"Emp","92","Department","15","05-25-2008","14:31:20","Process","D","N","Equip
ID","92","Parts Required?","Y","Item","AD712","QTY","99","14:31:55"

Any help would be greatly appreciated
 
P

pietlinden

Hello,

Question 1 is how do you automate the importing of a text file?
Here is an example of the information;

"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","92","QTY","55"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","63","QTY","99"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","15","QTY","55","06:50:50","<<F3>>"

Problem 2 is sometimes (depending on the process) there are more fields like
this;

"Emp","63","Department","87","05-24-2008","06:50:16","Process","C","7","Ite­m",
"92","QTY","88"
"Emp","63","Department","87","05-24-2008","06:50:16","Process","C","7","Ite­m",
"87","QTY","99"
"Emp","63","Department","87","05-24-2008","06:50:16","Process","C","7","Ite­m",
"63","QTY","77","06:50:31","EOR","<<F3>>"

"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","92","QTY","55"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","63","QTY","99"
"Emp","63","Department","87","05-24-2008","06:50:37","Process","A","87",
"Item","15","QTY","55","06:50:50","<<F3>>"

"Emp","92","Department","15","05-25-2008","14:30:34","Process","D",”Work
Order”,"Y" ,”Work Order ID”, "63","4","Equip ID","11232","N","14:31:11"
"Emp","92","Department","15","05-25-2008","14:31:20","Process","D",”Work
Order”,"N" ,"Equip ID","92","Parts Required?","Y","Item","BB716","QTY","88"
"Emp","92","Department","15","05-25-2008","14:31:20","Process","D","N","Equ­ip
ID","92","Parts Required?","Y","Item","AC627","QTY","44"
"Emp","92","Department","15","05-25-2008","14:31:20","Process","D","N","Equ­ip
ID","92","Parts Required?","Y","Item","AD712","QTY","99","14:31:55"

Any help would be greatly appreciated

create an import specification by running an import and saving it.
Click on advanced when you go through the process the first time.
then make sure you specify the right delimiters. then it should be
simple. Just use TransferText.
 
R

Russ via AccessMonster.com

Thanks, but really looking for a way to maybe read line by line and look for
error pior to importing the information.
Not really sure what the best way to tackle this.

[quoted text clipped - 38 lines]
create an import specification by running an import and saving it.
Click on advanced when you go through the process the first time.
then make sure you specify the right delimiters. then it should be
simple. Just use TransferText.
 
P

pietlinden

Thanks, but really looking for a way to maybe read line by line and look for
error pior to importing the information.
Not really sure what the best way to tackle this.

[quoted text clipped - 38 lines]
create an import specification by running an import and saving it.
Click on advanced when you go through the process the first time.
then make sure you specify the right delimiters.  then it should be
simple.  Just use TransferText.

I think Chuck Grimsby has a module on Access Web that reads text files
line by line. then you could examine the line (it's stored in a
string variable) and do something with it.
www.mvps.org/access
should be in the Modules section.
 

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