I am a newbie using regular expressions and don't really know if this is the right place to ask the question or even if regular expressions is the way to go.
I have a comma delimited text file (A BAI Banking file). These are a line of numbers with two constants. The field 03, denotes that the field following is the account number(Can be any number of digits) and the field 015 is always followed by the account balance (and can be any number of digits without decimal points.) These fields can be in any position within the string of text but the constants (03 and 015) always are true. The fields that follow each are always the account number in the case of the 03 and the balance in the case of the 015. My problem is to extract the account number and the balance from the text string to manipulate these fields. An example of this text string is as follows:
01,,,050111,0943,2988,,,2/
02,1520813349,121301028,1,050110,,USD,2/
03,0005015146,USD,010,380384,,Z/
88,015,13338154,,Z/
88,040,13301754,,Z/
88,045,854354,,Z/
88,050,459800,,Z/
88,055,459700,,Z/
88,072,12447400,,Z/
88,074,34700,,Z/
88,075,1700,,Z/
88,100,12957770,6,Z/
88,110,,,Z/
88,400,,,Z/
16,173,12518500,Z,,000009100638200,/
16,173,210600,Z,,000009100604520,/
16,173,151000,Z,,000009100604540,/
Any help that anyone can give me will be appreciated. I don't really know where to start. Thank you
I have a comma delimited text file (A BAI Banking file). These are a line of numbers with two constants. The field 03, denotes that the field following is the account number(Can be any number of digits) and the field 015 is always followed by the account balance (and can be any number of digits without decimal points.) These fields can be in any position within the string of text but the constants (03 and 015) always are true. The fields that follow each are always the account number in the case of the 03 and the balance in the case of the 015. My problem is to extract the account number and the balance from the text string to manipulate these fields. An example of this text string is as follows:
01,,,050111,0943,2988,,,2/
02,1520813349,121301028,1,050110,,USD,2/
03,0005015146,USD,010,380384,,Z/
88,015,13338154,,Z/
88,040,13301754,,Z/
88,045,854354,,Z/
88,050,459800,,Z/
88,055,459700,,Z/
88,072,12447400,,Z/
88,074,34700,,Z/
88,075,1700,,Z/
88,100,12957770,6,Z/
88,110,,,Z/
88,400,,,Z/
16,173,12518500,Z,,000009100638200,/
16,173,210600,Z,,000009100604520,/
16,173,151000,Z,,000009100604540,/
Any help that anyone can give me will be appreciated. I don't really know where to start. Thank you