![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting column from a flatfile with delimiter | rsprabha | Shell Programming and Scripting | 5 | 1 Week Ago 01:18 AM |
| Traverse a flatfile and check for errors | aravindc | Shell Programming and Scripting | 1 | 04-16-2008 11:56 PM |
| Adding a new field using sed or awk? | sasabune | UNIX for Dummies Questions & Answers | 3 | 06-01-2007 05:57 PM |
| encrypting Unix flatfile | rkumar28 | UNIX for Dummies Questions & Answers | 1 | 04-29-2004 06:31 AM |
| Finding a column in a flatfile | peter.herlihy | UNIX for Dummies Questions & Answers | 3 | 01-07-2002 04:08 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Adding field of flatfile by an index.
Hey guys, I was given a task that involved parcing a large file that looked somthing like this...
A1-0999999,SMITH,.25 A1-0999999,JOHN,.75 A1-0999999,HELMET,.1.25 A1-0999999,HOOP,.10.25 D1-1212121,SMITH,4.00 D1-1212121,TH,9.00 D1-1212121,MITCH,10.20 D1-1212121,RETAL,3.00 A1-9909555,,3.00 E1-099999,,7.00 What the task at hand is, is to Produce a file that looked like this... A1-0999999,,12.50 D1-1212121,,26.20 A1-9909555,,3.00 E1-099999,,7.00 I am basically condensing by the 1st value and adding up the 3rd field based on a common 1st field. I figured a way to do this using grep, but it was taking way too long. I would like to write an awk script that will add up field three until the 1st field changes, then print the 1st feild and the sum of all the 3rd feilds. Any help would be greatly appreciated! Any help would |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|