Parse Text File

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am trying to parse in a text file into my application (mdb file)
The below identifies the start of the first record<br/>
All fields need to be included, even if they are space filled. For display purposes when I import the data I want to replace a space with #.<br/>
The Data I am looking to import is between the < > on each line.
MCF REC # 1
Update : 06-28-2012 07:57:44
Field1 : <00000012340015880><br/>
Field2 : <Field 2 Data ><br/>
Field3 : <00000001><br/>
Field4 : <Field 4 Data ><br/>
Field5 : <Field 5 Data ><br/>
Field6 : <Field 6 Data ><br/>
Field7 : < ><br/>
Field8 : <USA><br/>
Field9 : <TX><br/>
Field10 : <123456789><br/>
Field11 : <000000000000000><br/>
Field12 : <000000000000000000>
From here down needs to go in a second table, Using Field1 above as the key<br/>
SE REC # 1<br/>
Table2 Record<br/>
Tbl2 FK : <00000012340015880><br/>
Tbl2 Field1 : <00001><br/>
Tbl2 Field2 : < ><br/>
Tbl2 Field3 : <123456789012345><br/>
Tbl2 Field4 : <T><br/>
Tbl2 Field5 : <5542><br/>
Tbl2 Field6 : <0000><br/>
Tbl2 Field7 : < ><br/>
Tbl2 Field8 : <01><br/>
Tbl2 Field9 : <112><br/>
Tbl2 Field10 : < ><br/>
Tbl2 Field11 : <Data><br/>
Tbl2 Field12 : < >
SE REC # 2<br/>
Table2 Record<br/>
Tbl2 FK : <00000012340015880><br/>
Tbl2 Field1 : 00002<br/>
Tbl2 Field2 : <R><br/>
Tbl2 Field3 : <9876543210000000><br/>
Tbl2 Field4 : <T><br/>
Tbl2 Field5 : <5542><br/>
Tbl2 Field6 : <0000><br/>
Tbl2 Field7 : < ><br/>
Tbl2 Field8 : <02><br/>
Tbl2 Field9 : <012><br/>
Tbl2 Field10 : < ><br/>
Tbl2 Field11 : <Data><br/>
Tbl2 Field12 : < >
New Record would start here... Same format as above
MCF REC # 2 (Second Record)
MCF REC # 3 (Third Record)
MCF REC # 4 (Forth Record)
etc
MW2011

View the full article
 
Back
Top