Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing file and generating error report : Ms Access

Status
Not open for further replies.

gajanan1

Programmer
May 19, 2001
2
US
Hi
1. I have a flat file (.txt) which I need to be parsed
C01121036200529400100000 0000000278
C10121036200529400100000 5500000001 010

basically file is of size 146 and has 4 different types of records namely C01,
C10,C20,C30.
File contains one record reach of type C01 , C10 and multiple C20,C30 records.

2. Record structure of each record type is different.
3. I need to parse the .txt file,identify record type
4. Based on corresponding record structure apply validation rules
5. Generate error report where data violates validation rules.

can anybody give me sample code or provide me way to do this

Thanks
 
Hi.

It looks like C01, and C10 are seperated by line. This applies to C20 and C30 hopefully?

Also, one of each type, so only 4 records?

OK, that being said, you can link to a text file, with out any code at all, and write a query that parses the strings with out ever touching VBA, altough that may be easier.

Can you give more info on the rules?

ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
Hi
File is a flat file with record length of 146.
so for each type of record(c01,c10,c20,c30) record length is 146. So essentially records are separated by line.

Also file has 1 c01 , 1 c10 and many c20,c30 records.

If I take following c01 record
C01121036200529400100000 0000000278

then 121036 shows time
2005294 shows date (yyyyddd) (field type:char)
001 shows version number (field type:char)
000000 shows sequence number (field type:num)
0000000278 shows no of records in file. (field type:num)

char type fields should be checked as not null or spaces
while number field should be checked whether they contains number fields at all.

also need to check whether total number of records in file is equal to 278

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top