CSV | GAWK | Record merge problem!
Hi,
I'm looking to take a CSV file which will have three fields:- Customer Number Balance Payor ID The file will have duplicate records which need merging along with the value of the second field (balance). In theory you could have the following file: Code:
customer, balance, payor Code:
customer, balance, payor Code:
005, 500.00, XXX Code:
BEGIN{ FS = ","; getline } Many thanks! |
Trying to avoid GNU Awk only features:
Code:
awk -F, 'END { With GNU Awk: Code:
awk -F, 'NR == 1 { print; next } |
Thanks radoulov that worked great.:cool:
However, is it possible where there are different payor ID's for the same customer id instead of the XXX could the routine prinf a new line for each payor ID associated with a customer? So in the example below:- Code:
customer, balance, payor Code:
customer, balance, payor Thank you.:confused: |
Try this, I don't know if the payor order matters:
[GNU Awk] Code:
awk -F', *' 'NR == 1 { print; next } |
Quote:
|
All times are GMT -5. The time now is 06:14 PM. |