The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
extract multiple sections of file
.
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
:
extract multiple sections of file
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
03-19-2008
faltooweb
Registered User
Join Date: Jan 2008
Posts: 11
extract multiple sections of file
#-- Use ST values as output filename.
awk -v out="/dev/null" '
/^ST/ {gsub("\\*","-",$0); out=$0".txt"}
/^SE/ { close(out) }
{ printf "%s\n",$0 >> out }
' $INFILE
Output will be
ST-810-0001.txt
so on ...
-Ramesh
faltooweb
View Public Profile
Find all posts by faltooweb
Find faltooweb's past nominations received
Find faltooweb's present nominations given