Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SED to AWK how-to... 1

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
US
I have a .bash script like this...
Code:
#!/bin/bash
awk -F, -v OFS=, '{$3=tolower($3);print}' input.txt > new
sed  s/\ 0:00:00// new > output.txt
rm new

The awk portion coverts a particular string to lower case and the SED portion deletes the string 0:00:00 wherever it is found in the source comma delimited file...

How would I do this all in awk?

AND

How would I also skip over lines that contained certain strings like CO. or INC., etc...

TIA,

-Allen Moore
 
awk '!/INC\./{ gsub(" 0:00:00","") ;$3=tolower($3); print}' input.txt > output.txt

HTH Dickie Bird (:)-)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top