The split tag has no usage guidance.
0
votes
2answers
27 views
Split File into 10 files with unique item in each file and maximum line number limit in each file
I have a huge file (more than 2M records in it). Here is my requirement:
Initially, break the one big file up in to 10 smaller files.
The files should be formatted as follows: ...
1
vote
1answer
20 views
How to set csplit output filenames by pattern?
Is there a way to set output names of csplit through the pattern?
I want to split the ssh-config by hosts to corresponding files.
If there is a solution without csplit I'm happy as well.
4
votes
1answer
44 views
Split file and know how many files were generated
I'm using the following lines to split a file into smaller parts:
split --line-bytes=100M -d $input $output/FILENAME
echo "$input was split into ??? 100MB files." >> demo.log
After that, I ...
0
votes
1answer
28 views
splitting a tar
I was tossed into Linux at work and have no experience with it what so ever. The guy that's training me gives me little tasks to figure out as I go, and I'm stuck. Today he told me to tar a file and ...
0
votes
1answer
20 views
Split a large file into unique files [duplicate]
I have huge file 100M, that has the text (few lines below,) stack of lines are unique scaffold1_, scaffold2_ and on.
I would like to have a new file that is specific to each scaffold.1...txt
tried ...
0
votes
2answers
37 views
Bash: split multi line input into array
I've got a file with strings and base64 encoded data over multiple lines, that are sepearated by a comma.
Example:
1,meV9ivU4PqEKNpo5Q2u2U0h9owUn4Y8CF83TTjUNWTRQs7dEgVxnsMgf4lvg9kvxcIaM3yB4Ssim
...
0
votes
1answer
50 views
Split string into array and print each element on a new line with commandline
I'm having a String which is seperated by commas like a,b,c,d,e,f that I want to split into an array with the comma as seperator. Then I want to print each element on a new line. The problem I'm ...
1
vote
4answers
126 views
Split comma separated list ignoring commas within matching {}
I want to split a csv, but ignore any commas within matching curly brace groups, and loop through each of the list members. The code below works great but does not consider commas within curly brace ...
1
vote
1answer
61 views
split file into multiple pieces
Problem:
given a file samplein, it can be split up into multiple pieces as follows:
$ cat samplein
START
Unix
Linux
START
Solaris
Aix
SCO
$ awk '/START/{x="F"++i;}{print > x}' samplein
$ ls F*
...
5
votes
2answers
210 views
split a string into path and application
If I have a string such as
/home/user/a/directory/myapp.app
or just
/home/user/myapp.app
how can I split this so that I just have two variables (the path and the application)
e.g.
...
2
votes
1answer
44 views
Sanity check (MD5 sums) fails after joining a file
I'm having a problem passing a sanity check, when combining a split file back to its original state even if it tarred with atime-preserve. Example below.
filename=FILENAME
newfilename=FILENAME2
...
14
votes
11answers
968 views
Bash script: split word on each letter
How can I split a word's letters, with each letter in a separate line?
For example, given "StackOver"
I would like to see
S
t
a
c
k
O
v
e
r
I'm new to bash so I have no clue where to start.
3
votes
4answers
97 views
Split columns based on patterns in fields
Example: I'd like to split $2 in input file, putting a tab after pattern surname
Input:
name surname1
name surname30000
name surname456
Desired output:
name surname 1
name ...
3
votes
1answer
44 views
How to split images using ImageMagick?
I have an image which contains multiple images in it. I want to split the image into multiple image files, one file per image. How do I do this using ImageMagick?
I have attached a sample image file.
...
0
votes
1answer
45 views
Search for a pattern in a file and move it to the new files one by one
I am trying to search for a particular pattern in a file and move it to a new files one by one. I am a noob and I tried sed -n 's/CREATE PROCEDURE/,/END ;/p' File It is again printing the same file. ...
1
vote
5answers
46 views
split the content of a specific column
I need to split the content of the second column of my file into 2 columns, for example:
Id allele id2
30 TC 12
211 GG 12
327 AA 13
688 TC 15
760 TT 18
868 CC ...
3
votes
2answers
112 views
How to split a file by counting digit numbers within a row?
I have a file with 45000 character within each line and I I want to split the original file based on specific numbers of character within a line. as an small example my input file looks like:
...
4
votes
2answers
252 views
split a large file to new file with unique file names
I need to split a file into unique file names.
I can do it with sed command eg, sed -n '/scaffold135_/w 135-scaf.txt' input file.txt but it's time consuming so I need a smart way to do it faster. ...
0
votes
0answers
64 views
unix file split resultant files suffix should start with 1 instead of zero
I want split a file based on record count but the resultant split file name suffix should start with "1" instead of "0". Is there a simple way I can achieve this?
1
vote
0answers
22 views
How to save/reload split windows in vim?
How do I get the same split-settings back if I exited vim with :qa?
1
vote
2answers
42 views
Split file in two on line before pattern
This is an almost identical question to split file into two parts, at a pattern but instead of having the lines up to XYZ in file1 in the example file.txt:
ABC
EFG
XYZ
HIJ
KNL
I want to have the ...
8
votes
8answers
754 views
Split text file into lines with fixed number of words
Related, but no satisfactory answers: How can I split a large text file into chunks of 500 words or so?
I'm trying to take a text file (http://mattmahoney.net/dc/text8.zip) with > 10^7 words all in ...
1
vote
1answer
99 views
split not working as required?
I want to split a file into 'n' chunks, the suffixes should be of 'a' length and should using numeric suffixes starting from number 'd'.
e.g. n = 10, a=4, d=5, As all options look correct and I tried ...
8
votes
4answers
810 views
Splitting file for every 10000 numbers ( not lines )
I have a file that looks like the following:
chr19 61336212 + 0 0 CG CGT
chr19 61336213 - 0 0 CG CGG
chr19 61336218 + ...
1
vote
2answers
35 views
Why doesn't GNU Screen split show up for remote user?
I have a screen session running on my local machine:
~/[email protected]$screen -S pair
Then, turn on multiuser:
ctrl-a:multiuser on
Finally, allow the user pair to connect to the session:
...
2
votes
4answers
203 views
Need to print the matching lines in different file
For example, I have data like this
1111111
test1
test2
test3
1111111
block 1
block 2
block 3
1111111
page1
page2
page3
I would like to print the content as different files as shown below.
Test1 - ...
2
votes
3answers
287 views
Split binary data of fixed byte offset by byte position?
I have binary data which I review by xxd -ps in hex format.
I notice that the byte distance is 48300 (=805*60) bytes between two headers where the separator is fafafafa.
There is the beginning of ...
0
votes
1answer
92 views
Which version of split supports flag -p?
This command does not work in GNU Coreutils split, split of Cern Linux 5 (Redhat) and BSD (Apple Yosemite 10.10.3):
split -p'\0' input.txt
where input.txt is masi\0hello\0world.
Some comments ...
8
votes
7answers
959 views
How to efficiently split up a large text file wihout splitting multiline records?
I have a big text file (~50Gb when gz'ed). The file contains 4*N lines or N records; that is every record consists of 4 lines. I would like to split this file into 4 smaller files each sized roughly ...
0
votes
1answer
91 views
Splitting a file using perl
I have a csv file and like to split the file into smaller files based on column matching in the file using perl. I am new to perl. I am working on Linux Rhel6.
example:
fruit1, ...
0
votes
2answers
54 views
CentOS 6 Partitioning Root Drive
I have recently installed CentOS (into a machine with only one hard drive) and I would like to know how to Partition the main hard drive into two.
As it is a fresh install there is no data to lose ...
6
votes
6answers
2k views
split file into two parts, at a pattern
How to split a large file into two parts, at a pattern?
Given an example file.txt:
ABC
EFG
XYZ
HIJ
KNL
I want to split this file at XYZ such that file1 contains lines up-to XYZ and rest of the ...
1
vote
1answer
142 views
splitting an image into multiple pieces
I have an image as below. It is 2579*2388 pixels. Lets assume that it's bottom left corner is at 0,0. From that image I want to create multiple images as follows and save them in the working folder. ...
4
votes
4answers
3k views
Split single string into character array using ONLY bash
I want to split 'hello' into h e l l o in an array using only bash, I could do it in sed with sed 's/./& /g' but I want to know how to split a string into an array in Bash when I do not know what ...
2
votes
1answer
184 views
How to split file and save parts to multiple locations?
How do I split a large file into multiple smaller chunks and write each part of it into separate locations?
split command seems to only output all the files into one location.
The context I need to ...
0
votes
1answer
84 views
VIM switching between split buffers
i tried to split a vim in 2 buffers with 2 different files
vim file1.txt
:sp file2.txt
but ctrl + w is not working to switch between them.
giving below error
E486: Pattern not found: ...
0
votes
1answer
179 views
How should I split a string with no spaces in vim script?
How should I split a string with no spaces in vim script?
All the options which I see are to split a string with spaces.
I even tried split(string_name) without a delimiter , but it doesn't work.
0
votes
2answers
77 views
Cut a string up to a certain character [closed]
I've searched the site and I've seen similar questions but I couldn't get them to work. I tried to follow: Splitting a string up to a specific location but it didn't work. I working with Korn.
I ...
1
vote
1answer
58 views
file (vdi) increase (at double) size after split and then cat operation
I'd splitted a vdi file with 7 gigabytes and then joined with cat command. The file works normally on VBox, but get 14 gigabytes after be re-joined. The exact operation was:
$ split -- bytes=2000M ...
3
votes
0answers
302 views
Splitting ddrescue output image into 2 files
My ext4 disk crashed and I'm using ddrescue to try to rescue it. However the crashed disk is 3tb, and I only have another 3tb drive for the image file. I assumed that this image file will be too big ...
1
vote
1answer
238 views
split line based on space and delete the second part
I have a big file
>fid|29290408|locus|VBIEntCas2262_0001| Phosphoglycolate phosphatase (EC 3.1.3.18) [Enterococcus casseliflavus EC20]
...
0
votes
1answer
109 views
Tar Create and Split files into subdir
I have this command:
tar -cf - input/* | split --bytes=1m
Which splits my huge gz files into small ones. This works fine.
However I want the output (the small files) to be created in the input/ ...
4
votes
0answers
140 views
screen & xterm: how to select text with the mouse in one only pane when window is divided vertically
Interestingly enough, this has also been a tmux issue for some:
http://daemonforums.org/showthread.php?t=7311
But currently I am sticking to screen, and I'd like to know how I can make screen ...
6
votes
4answers
930 views
How to split text between separator into multiple files?
I have a text file contaning the following:
"random
textA"
"random
random
textB"
The separator is "
How can I split the containt into multiple file as follow using a bash command?
File 1 :
...
4
votes
2answers
2k views
How to split an image vertically using the comand line?
So, say I have a large 800x5000 image, how would I split that into 5 separate images with dimensions 800x1000 using the command line?
3
votes
1answer
377 views
Split input file into X parts of size total lines / X
Currently, my bash script splits by number of lines. However, I'd like to split a file into X pieces, each of those having total lines equal to the file length divided by X. The script is run as ...
4
votes
1answer
274 views
What does `{\} {}` mean in `find` command?
Please explain this command in detail.
I am using this command to find large files above 6 MB and split them into 5 MB chunks in the same folder. Then it removes the original files (larger than 6MB) ...
1
vote
1answer
1k views
Split very big xml file into little pieces with specific line number count
This is how I did to extract the first 100000 lines from my big xml file (2gb):
head source.xml -n 100000 > part.xml
How can I keep splitting them to 100000 line (or specific file size chunks) ...
6
votes
1answer
573 views
Zip Archive With Limited Number of Files
What command can I use to create zips with a file number limit? I have a folder (no subfolders) of, say, 5000 files, so I would want a command that could divide that number and create 10 individual ...
3
votes
3answers
4k views
Split the lines of a text file into separate files
I have a text file that looks something like this:
foo
bar
zip
rar
tar
I need to use a bash script on OSX to make a new text file after every new line like this:
cat text1.txt
foo
cat text2.txt
...