Hello all,
Currently I have a txt file named as a.txt with the content as:
While, for some reason I want to cut a.txt into small ones, e.g. f1.txt, f2.txt, f3.txt and f4.txt. The routine is to cut a.txt at lines starting with "f e*". Then the four small files will look like, e.g. f1.txt as:
f2.txt as:
f3.txt as:
f4.txt as:
Any help would be appreciated. Thx in advance.
L
Moderator's Comments:
Please use code tags next time for your code and data.
well, your script work for small file. if a.txt is a huge one then i got an error as:
awk makes too many open files
it succeed in extracting the first 17 files. i guess there is a output number limit. any tips? thx
---------- Post updated at 12:06 PM ---------- Previous update was at 11:59 AM ----------
---------- Post updated at 12:08 PM ---------- Previous update was at 12:06 PM ----------
thx for prompt reply. but it seems the loop does not jump out. Sorry for being a noob. I seldom program in bash
How to cut data from big file
my file around 30 gb
I tried "head -50022172 filename > newfile.txt ,and tail -5454283 newfile.txt. It's slowy.
afer that I tried sed -n '46467831,50022172p' filename > newfile.txt ,also slow
Please recommend me , faster command to cut some data from... (4 Replies)
I have a big text file. I want to cut it into 2 pieces at known point or I know the pattern of the contents from where it can separate the files. Is there any quick command/solution? (4 Replies)
Hi,
I have one file stat.
Stat file contents are as follows: for example.
H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000
H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000
Now i... (1 Reply)
1 . Thanks everyone who read the post first.
2 . I have a log file which size is 143M , I can not use vi open it .I can not use xedit open it too.
How to view it ?
If I want to view 200-300 ,how can I implement it
3 . Thanks (3 Replies)