feherke,
the command awk -vRS='\n\n\n+' '{print>sprintf("%03d.lct",NR)}' /input/file works perfectly on my ubuntu server.
pb seems to come from my awk command on my AIX box.
but I don't know how to bypass this pb
Alexknt
Thanks for your help feherke
I have already tried your 1st solution without success.
awk -vRS='\n\n\n+' '{print>sprintf("%03d.lct",NR)}' /input/file
but it gives me 13 files ( 1 by line from input file ) instead of 3 files.
I don't know why it does not work.
FYI:
#od -c file
0000000 1 \n...
Hi,
here is my input file:
#cat file
1
2
3
4
5
6
7
I want to split this file into files with the record separator RS = 2 or more blank lines.
Therefore I should obtain:
#cat 001.lct
1
2
3
#cat 002.lct
4
5
#cat 00.lct
6
7
My command :
awk ' BEGIN { RS="" } { i++...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.