Hi all,
I ran into this problem, hope you can help
I have a text file like this:
Code:
Spriden ID First Name Last Name Term Code Detail Code Amount Trans Date Description
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
000702986 Yukiko Adachi 200520 EASY 20.00 2005-03-07 12:00AM SCAD Debit Card Charge
000723223 Casey Jothen 200530 EASY 600.00 2005-03-08 12:00AM SCAD Debit Card Charge
and when i run the awk program to format the file, i got this result:
Code:
V2
U000634426 Kwok, Celine 01/01/10 SCAD Group Inc. PA01001000100100PA01011010101101AD0100100240.0000
U000722952 Moore, John 01/01/10 SCAD Group Inc. PA01001000100100PA01011010101101AD0100100300.0000
Is there a way I can get rid of the ".00" (those that I have in bold font) from the dollar amount and have the result like this instead:
Code:
V2
U000634426 Kwok, Celine 01/01/10 SCAD Group Inc. PA01001000100100PA01011010101101AD010010024000
U000722952 Moore, John 01/01/10 SCAD Group Inc. PA01001000100100PA01011010101101AD010010030000
Here is my awk program:
Code:
FNR==1{print "V2"}
$6 > 0 && (( $9 $10 $(NF-1) $(NF) ) == "SCADDebitCardCharge" ) {
_i=$3 ", " $2; _x=$6 "00"; printf("U%-19s%-39s%-130s%-178s%-41s%-6s\n", $1, _i, "01/01/10", "SCAD Group Inc.", "PA01001000100100PA01011010101101AD0100100", _x)
}
Thanks for any helps
CT