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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through a delimited file

Status
Not open for further replies.

hancockin

IS-IT--Management
Sep 1, 2008
2
Hi,
I am trying to read a ~ delimited file which has one record starting with say 'A' (that's the identifier record), multiple records starting with 'B' and then multiple records (say record type 'C') within a record 'B'. I need to pull a field from record 'A', and store it in a variable say var1, read record 'B', again pull a field and store it in a variable (var2) and rewrite record 'B' by appending var1 to it (pulled from record 'A'). Now I'll be reading all the records of type 'C' (which appear within a record 'B') and rewrite them by appending var2 to them. One catch here is that position of var2 is not fixed because we may or may not receive values in few fields but the delimiter will be able to handle it.
I was trying to do this in DOS first but that didn't work out and now I am back to using vb script (because those r the only 2 options i have). Can someone help me with this ?

Thanks
 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Well, I am quite new to VBS and couldn't do much of RnD and thought of getting answers from the experts. I have tried lot of things in DOS and nothing seems to be working.
 
HAve a look at the FileSystemObject object and the Split function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top