Search Results

Search: Posts Made By: webkid
4,555
Posted By Scott
Hi. Assuming you still want one output file...
Hi.

Assuming you still want one output file per "section":


awk ' /^----/ { file = "file" $2(++c) }
c { print > file }
' input.txt
4,555
Posted By ctsgnb
awk '/^----/{f="file"(++c)".txt"}{print $0 > f}'...
awk '/^----/{f="file"(++c)".txt"}{print $0 > f}' input

$ cat in
---- XXX Info ----
Buuuu xxx bbb
Kmmmm rrr ssss uuuu
Kwwww zzzz ccc
Roooowwww eeee
Bxxxx jjjj dddd
---- YYY Info ----
Kuuuu...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 04:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy