Hi,
I am trying to parse the data from a file,i has single record and i need to parse it into multiple fields,i dont have any length mentioned in the requirement,i need to parse the data based on particular word
ex: AID~BPCL LOCL~BAECN COVD~BEX *~ALST~BNLST TEST1 BCKL I20070703 1-608 W 176, MANHATTAN, NY ~ADIR~/CLS 22,SWXX,325911,,
this is the record and i need to split into fileds
AID(AID~BPCL LOCL~BAECN COVD~BEX)
ALST(*~ALST~BNLST TEST1 BCKL I20070703 1-608 W 176, MANHATTAN, NY)
i am using index function to split the data,i am getting first field right but when i am doing second field its not showing properly,,,and my index is like this
read_data.Data [1,(index(read_data.Data,"ALST",1)-1)](extracting first field)
read_data.Data [index(read_data.Data,"ALST",1),(index(read_data.Data,"ADIR",1)-1)]
thanks
naveen
parsing the data
Moderators: chulett, rschirm, roy
Second field in substring should be length
Code: Select all
read_data.Data [index(read_data.Data,"ALST",1),(index(read_data.Data,"ADIR",1)-1-index(read_data.Data,"ALST",1))]
You are the creator of your destiny - Swami Vivekananda