Hi,
using Ubuntu 12.04 I have the following text file that I get as my input:
Code:
Section1
col1 col2 (many columns)
100 500
101 500
102 500
(many rows)
Section2
col1 col2 (many columns)
400 400
401 400
402 400
(many rows)
Section3
col1 col2 (many columns)
700 600
801 700
902 800
(many rows)
How to brake this file into 3 files according to the "Section" line?
From Section1 to Section2 should be saved in file file1.
Code:
Section1
col1 col2 (many columns)
100 500
101 500
102 500
(many rows)
From Section2 to Section3 should be saved in file2.
Code:
Section2
col1 col2 (many columns)
400 400
401 400
402 400
(many rows)
and from Section 3 to end of file should be saved in file3.
Code:
Section3
col1 col2 (many columns)
700 600
801 700
902 800
(many rows)
How to split one file into multiple files according to above rules?
Thanks
Bookmarks