Import text file based on content (1 Viewer)

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 13:46
Joined
Sep 12, 2006
Messages
15,653
how often are these files appearing?

eg - if you manually use qgrep, and pipe the result to a file, then you could use access to read the pipe result, and get the file name from that, as a starting point. then see if access could run the grep - but someone has to tell the grep what to look for, and thats as easy outside access, as inside, i would think - certainly while you are developing it - sorry if this is a bit convoluted/circular

personally i would try and get the import working then worry about how to find/select the file later.
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 13:46
Joined
Jun 16, 2000
Messages
1,954
yep - its a long job the first time you do it, because the only tools you have are string slicing tools (instr, mid, left and right) - but once you have done it, you dont need to do it again!

i dont think it breaks if the lines are >255 chars, as long as you store the data in text string variables, rather than table fields.

f you can rely on the file being well formed ie everything in the order it should be, its easier - otherwise you have to make sure the rows are in the correct order.

When I wrote my EDI Processing program, I started by creating a bunch of generic string handling functions that were themselves aware of the delimiters in the file format - so I could call function 'IdentifyLine' and it would interpret the line header characters, then I could call my function 'GetValue(3)' and it would return the contents of the third chunk of data from within a line.

Some EDI formats are easier than others for this, as they have specific fixed widths per line type - others (usually if it's been exported out of some EDI portal app) are just delimited with variable length fields.
 

Users who are viewing this thread

Top Bottom