Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

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

Avatar of sunhux
sunhux asked on
Unix OSPerlShell Scripting
2 Comments1 Solution464 ViewsLast Modified:

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 GFlag of India imageEngineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers