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++; f=sprintf("%03d.lct",i);print $0 > f }' file
gives 5 files because it considers one blank line as a RS.
How to declare RS as 2 or more blank lines BUT not 1.
Thanks for your help,
Alexknt
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++; f=sprintf("%03d.lct",i);print $0 > f }' file
gives 5 files because it considers one blank line as a RS.
How to declare RS as 2 or more blank lines BUT not 1.
Thanks for your help,
Alexknt