Link to home
Start Free TrialLog in
Avatar of sunhux
sunhux

asked on

Perl or Unix Shell scripting to sieve out records with a certain value of a column


I have a csv (comma separated value) text file exported out from Excel.
Original file has thousands of lines/records with columns/fields being
segregated by comma (,).

I'll need a Perl / Shell script that would sieve out lines/records that has
a certain value from column 4 & output those records/lines that do not
have this value in the 4th column.

So, take for example the attached text data file (only 3 lines/records in it):
./script "3"

would output the last 2 lines, filtering off the 1st line from being output.

Note that line 2 has a number "0.3" in its 4th column but it's not sieved
out because only those lines with the exact value of 3 in its 4th column
would be output (so 0.3, 33, 3.3 is not equal to 3, so those lines with
these values in its 4th column would not be sieved out
prmcsv.txt
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial