I have a big file and need to split into two files. Suppose in the first file the 1000 lines should be selected and put into another file and delete those lines in the first file.
I tried using split but it is creating multiple chunks.
Is it possible to remove the delimiter with csplit? Example:
$ cat in
abc
---
def
---
ghi
$ csplit -q in /-/ '{*}'
$ ls x*
xx00 xx01 xx02
$ head xx*
==> xx00 <==
abc
==> xx01 <==
---
def
==> xx02 <==
---
ghi
Instead of what it did, i.e. split…
I'm working on this big file (DATA.DAT, ~900MB) which contains several other files. It's from a PS2 game.
Sound samples (which are in .AIFF format), precisely what I'm after, make up most of its size.
After searching the web for PS2 .DAT extractors…
I have a file on Linux, containing the coordinates of thousands of molecules. Each molecule starts with a line containing always the same pattern:
@MOLECULE
And then continues with other lines.
I would like to split the file into multiple…
I have a file containing lists on Solaris:
List A
hi
hello
hw r u
List B
Hi
Yes
List C
Hello
I need to transpose the lists as shown below:
List A List B List C
hi Hi Hello
hello Yes
hw r u
How can I do this on Solaris?
i want to split file by regular expression, i have file format as below
0|t| lorem ...
some text
138|t| title
some text
if i execute egrep "[0-9]+\|t\|" file | wc -l it counts occurrence correctly but if i execute csplit filename /[0-9]+\|t\|/…
How do I get modern coreutils on mac?
I ran into this problem using csplit:
foo.txt:
foo
1
foo
2
foo
3
$: csplit foo '^foo$' '{*}'
# error
Double checking the manpage, man csplit, csplit on Mac is the FreeBSD version and does not offer the '{*}'…
folks-
I'm a bit stumped, on this one. I'm trying to write a bash script that will use csplit to take multiple input files and split them according to the same pattern. (For context: I have multiple TeX files with questions in them, separated by the…
I have some files that contain the results of the lldpneighbors command from all our servers. I would like to split these files into individual files for each server in order to make it easier to import this data into our inventory system.
Sample…
I'd like to split the contents of a .txt file into multiple files, but I'm encountering two questions about limitations of csplit:
(1) can anyone offer a way around csplit's maximum limit of '99' file splits? I have a file with up to 384 splits…
I am currently working with a large fasta file (3.7GB) that has scaffolds in it. Each scaffold has a unique identifier that starts with > on the first line and on the consecutive line it has the DNA sequence like…
I want to split a file after a delimiter, not before the delimiter, which is what csplit does. I can't find anything anywhere! (Also, why would there be a tool that specifically splits before a pattern, but not one that splits after…
I have a file tnsnames.ora and its contents are as below.
NEWDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = linuxerp.de.mph.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = linuxerp.de.mph.com)(PORT = 1550))
(CONNECT_DATA…
I have a text file that has the contents of the example below, and I would like to split the file to multiple files.
[TXT] /path/to/[TXT]
[BAT] /path/to/[BAT]
[TXT] /path/to/blah/[TXT]
[BAT] /path/to/blah/[BAT]
So I have figured out I can…