Re: awk lines between > separate text files



thdyoung@xxxxxxxxxxxxxx wrote:

hello Pk

switched to gawk and tryed your awk again

very very nice!

gawk '/^CCCC$/{close("newfile"n);n++}{print > "newfile"n}'
login2edit.php

thanks for the help, and the pleasure of seeing this one line of code
replacing so much tedious cut n paste

Uhm, check your output files, because with the version above they contain
"CCCC". If that's not what you want, use this:

gawk '/^CCCC$/{close("newfile"n);n++;next}{print > "newfile"n}'
login2edit.php

.



Relevant Pages