[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

awk/grep question

Asked by kkatula in Shell Scripting, Bourne Shell (sh), Unix Systems Programming

I have a Unix script that I need to parse a data file and kick out any line where the 4th field has less than 15 characters. I have this which works fine until there are no lines that need to be kicked out.  When every line has a field 4 with at least 15 characters, the grep below yields a zero byte file.  Any ideas?

awk -F"|", 'length($4)<15' /tmp/listfinal >> /tmp/deleteme
/usr/xpg4/bin/grep -v -f /tmp/deleteme /tmp/listfinal > /tmp/listclean
[+][-]10/22/09 08:18 AM, ID: 25635220Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/09 08:52 AM, ID: 25635642Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625