1|22 JAN Minimum Bal 20.00 | SAT
2|09 FEB Extract bal 168.00BR | REM
3|MIN BAL | LEX
Output should be:
( If there is Date & Month in 2nd field of Input file, It should be seperated else blank. If There is Decimal OR Decimal & Currency in last of the 2nd field of Input file, It should be seperated Else blank )
1|22 JAN | Minimum Bal | 20.00 | SAT
2|09 FEB | Extract bal | 168.00BR | REM
3||MIN BAL || LEX
My Code below. i feel index function wrong, Any help plz..
Do you really want to truncate the contents of the newly created 3rd field if input field 2 contains more than 47 characters?
Why is the 2nd awk script in your pipeline looking for the currency values in field 3 when the currency values, if present, will be in field 4 by then?
Please explain exactly what the format is for the "decimal" and "decimal & Currency" strings. Will that field always be empty if a monetary amount is not present? Do there really have to be at least two digits in a monetary amount? Should a decimal point be required in a monetary amount? If a decimal point is present in a monetary amount, should there be a required number of decimal digits after that decimal point? Are there minimum and maximum numbers of uppercase letters in a currency code?
Do you really want to truncate the contents of the newly created 3rd field if input field 2 contains more than 47 characters?
i dont want to truncate. i didn't get logic so i mentioned values explicitely.
Please explain exactly what the format is for the "decimal" and "decimal & Currency" strings. Will that field always be empty if a monetary amount is not present?
"decimal" have two decimal points. "decimal & Currency" have two decimal points and two uppercase alphabets.
Hi RudiC,
When JSKOBS said ""decimal" have two decimal points", I think the requirement was a single radix character and two decimal digits following it. There was also a requirement for zero or two uppercase letters for the string following the monetary amount.
The following also will reject more false positives on dates and monetary strings and gets rid of leading and trailing spaces in all fields.