The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Script on pattern matching and print lines and export to excel
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Script on pattern matching and print lines and export to excel
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
06-24-2009
vgersh99
Moderator
Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
there're a number of similar threads - please use the Search function first next time you're about to open a new thread.
Code:
nawk 'c&&c-- {if (c==5 ||c==2||c==1) printf $0 ((c==1)?ORS:OFS);next} /^equip.*RTF$/ {c=7}' myFile
vgersh99
View Public Profile
Find all posts by vgersh99
Find vgersh99's past nominations received
Find vgersh99's present nominations given