i have this text file and i am trying to parse from each occurence of ALN to the next occurence into 4 fields...i am reading through the file LINE BY LINE and i am having problems figuring this one out.
this is hwo i am opeing the file...i would like to use this same method and continue to read the file line by line
Open str_path & str_filename For Input As #filehandle
Do While EOF(filehandle) = False
Line Input #filehandle, dataline
the desired parsed output would look something like:
2123971354,1,ALN,/TN 212 397-1354/LPIC NYC /LPCX 0698/LPCA SN, 1-27-99 /PIC ATX/PICX 0288,.89
2123971354,1,NBJ,/TN 212 397-1354/PRIV Y,1.22
2123971354,1,POR2X,/TN 212 397-1354,3.23
2123971354,1,RTVX6,/TN 212 397-1354/LCC SBM,1.11
2123971405,1,ALN,/TN 212 397-1405/LPIC NYC /LPCX 0698/LPCA SN, 1-27-99 /PIC ATX/PICX 0288 /PCA SN, 1-27-99,.67
2123971405,1,NBJ,/TN 212 397-1405/PRIV Y,0
and so on...the trick part for me is where the ALN items since the detail portion of that data may run on to multiple lines with amount after the last line...below is a small portion of the source text file...any help in pointing me in the right direction will be greatly appreciated...thanks keith
-----------------------------------------------------
1 ALN /TN 212 397-1354/LPIC NYC
/LPCX 0698/LPCA SN, 1-27-99
/PIC ATX/PICX 0288
/PCA SN, 1-27-99 T .89
1 NBJ /TN 212 397-1354/PRIV Y T 1.22
1 POR2X /TN 212 397-1354 T 3.23
1 RTVX6 /TN 212 397-1354/LCC SBM T 1.11
1 ALN /TN 212 397-1405/LPIC NYC
/LPCX 0698/LPCA SN, 1-27-99
/PIC ATX/PICX 0288
/PCA SN, 1-27-99 T .67
1 NBJ /TN 212 397-1405/PRIV Y T 0
1 POR2X /TN 212 397-1405 T 0
1 RTVX6 /TN 212 397-1405/LCC SBM T 0
1 ALN /TN 212 397-1431/LPIC NYC
/LPCX 0698/LPCA SN, 1-27-99
/PIC ATX/PICX 0288
/PCA SN, 1-27-99 T 0
1 NBJ /TN 212 397-1431/PRIV Y T 0
1 POR2X /TN 212 397-1431 T 0
1 RTVX6 /TN 212 397-1431/LCC SBM T 0
1 TCG /TN 212 397-1492/HTG 1 /GST
/LPIC NYC/LPCX 0698
/LPCA SN, 1-27-99/PIC ATX
/PICX 0288/PCA SN, 1-27-99 T 0
1 NBJ /TN 212 397-1492/PRIV Y T 0
1 PORPX /TN 212 397-1492 T 0
1 RTVX6 /TN 212 397-1492/LCC SBM T 0
1 TJB /TN 212 397-1492 T 0
this is hwo i am opeing the file...i would like to use this same method and continue to read the file line by line
Open str_path & str_filename For Input As #filehandle
Do While EOF(filehandle) = False
Line Input #filehandle, dataline
the desired parsed output would look something like:
2123971354,1,ALN,/TN 212 397-1354/LPIC NYC /LPCX 0698/LPCA SN, 1-27-99 /PIC ATX/PICX 0288,.89
2123971354,1,NBJ,/TN 212 397-1354/PRIV Y,1.22
2123971354,1,POR2X,/TN 212 397-1354,3.23
2123971354,1,RTVX6,/TN 212 397-1354/LCC SBM,1.11
2123971405,1,ALN,/TN 212 397-1405/LPIC NYC /LPCX 0698/LPCA SN, 1-27-99 /PIC ATX/PICX 0288 /PCA SN, 1-27-99,.67
2123971405,1,NBJ,/TN 212 397-1405/PRIV Y,0
and so on...the trick part for me is where the ALN items since the detail portion of that data may run on to multiple lines with amount after the last line...below is a small portion of the source text file...any help in pointing me in the right direction will be greatly appreciated...thanks keith
-----------------------------------------------------
1 ALN /TN 212 397-1354/LPIC NYC
/LPCX 0698/LPCA SN, 1-27-99
/PIC ATX/PICX 0288
/PCA SN, 1-27-99 T .89
1 NBJ /TN 212 397-1354/PRIV Y T 1.22
1 POR2X /TN 212 397-1354 T 3.23
1 RTVX6 /TN 212 397-1354/LCC SBM T 1.11
1 ALN /TN 212 397-1405/LPIC NYC
/LPCX 0698/LPCA SN, 1-27-99
/PIC ATX/PICX 0288
/PCA SN, 1-27-99 T .67
1 NBJ /TN 212 397-1405/PRIV Y T 0
1 POR2X /TN 212 397-1405 T 0
1 RTVX6 /TN 212 397-1405/LCC SBM T 0
1 ALN /TN 212 397-1431/LPIC NYC
/LPCX 0698/LPCA SN, 1-27-99
/PIC ATX/PICX 0288
/PCA SN, 1-27-99 T 0
1 NBJ /TN 212 397-1431/PRIV Y T 0
1 POR2X /TN 212 397-1431 T 0
1 RTVX6 /TN 212 397-1431/LCC SBM T 0
1 TCG /TN 212 397-1492/HTG 1 /GST
/LPIC NYC/LPCX 0698
/LPCA SN, 1-27-99/PIC ATX
/PICX 0288/PCA SN, 1-27-99 T 0
1 NBJ /TN 212 397-1492/PRIV Y T 0
1 PORPX /TN 212 397-1492 T 0
1 RTVX6 /TN 212 397-1492/LCC SBM T 0
1 TJB /TN 212 397-1492 T 0