The split tag has no usage guidance.
-2
votes
0answers
21 views
How to split 'N' number of lines into 'n' number of small lines (text files)? [closed]
ATOM 1 N MET 1 27.340 24.430 2.614 1.00 9.67
ATOM 2 CA MET 1 26.266 25.413 2.842 1.00 10.38
ATOM 3 C MET 1 26.913 26.639 3.531 1....
1
vote
2answers
47 views
Howto split stdin into multiple multiline strings and put each of them into different bash variables
I'm searching for a possibility to send via pipe several multiline strings to a bash script and grab each of them within this script. Finally, I want to store each multiline string into its own ...
0
votes
1answer
28 views
How to split my log file in multiple log files according to column values?
My connections log file is structured as follows:
hostname direction timestamp bps
Here's a fragment of my log file:
www.youtube.com DOWNLOAD 1479897661131903 23508910
www.youtube.com UPLOAD ...
1
vote
2answers
65 views
How do I split a large file into multiple smaller ones based on the value in a text column?
I have a large file that I need to split into workable pieces. (350 million records)
The key is the second column value cannot overflow into the next file.
Reading and writing take way to long, split ...
0
votes
2answers
63 views
Splitting a single file into multiple files based on matching strings in Linux
I have a file which has contents something like this:
File.txt:
661###############20160315###
###########################
###########################
661###############20160316###
###################...
1
vote
1answer
45 views
How to use awk to split a file using a text-pattern
I have a 2Gb file. That has a a header and many-many "event"-structures. This is how the beginning will look:
<run example>
<header>
5
This is header ...
5
votes
6answers
462 views
Split string by delimiter and get N-th element
I have a string:
one_two_three_four_five
I need to save in a variable A value two and in variable B value fourfrom the above string
1
vote
1answer
37 views
Scan drive for files > 10GB and (if not already done) create tar split into 10GB chunks for each
I need to overcome a limitation of Amazon Cloud drive via the Cloud Sync app on my Synology NAS. This only allows files up to 10GB max to be sync to Amazon. I have a number of bluray rips which are ...
0
votes
1answer
36 views
Reading text between two matching words, compare and write to another file
I'm newbie to Unix shell scripting, I need write output to another file.
I have a log file like Shop.log,
Place=hyd
Location=Abids
Shop=Bigbazar
Place=Mumbai
Location=Worli
Shop=ShoppersStop
Place=...
0
votes
2answers
50 views
colorized path in PS1
sorry for my poor english... :(
I'm trying to display path in colors but I have problem with this :(
I have some constant path - in variable MyPath
i want to create colorized path in PS1 but if pwd ...
4
votes
2answers
51 views
How to split a file alternating the prefix used for the output files?
I have large file. It is made of parts of 40 lines each. There are two types of parts and they alternate. The two types of parts should be numbered independently. So the first part should be X_0001, ...
1
vote
2answers
202 views
How to split a 6 or 7 GB file into several sub-2 GB files without splitting entry?
My level has 6 to 10 GB sized files as input. These files contain several lines of data. The next level's max input capacity is 2GB. So I have to split these 6-10 GB files into several sub-2 GB files ...
0
votes
2answers
308 views
Split file by pattern
Is there an easy way to split, for example, apache vhost file with multiple vhost into 1 vhost per file?
Or something else, allowing to operate only one by one vhost to get grep output .
preferred ...
0
votes
2answers
63 views
Create zip archive based on number of files
SunOS 5.8
Directory structure
/TEST/CHM
CHM
A
file1.txt
file2.txt
B
file3.txt
C
file4.txt
file5.txt
file6.txt
If the parent directory CHM has less than 8 ...
1
vote
1answer
73 views
install gnu command
I have the command split installed. However I need the '--filter'argument, which is supported by gnu's split command. SO I need to install gnu split. How do I do that on my mac?
I tried
$ brew ...
2
votes
1answer
150 views
redirect split output
I split a gz file using gunzip piped to split:
time gunzip -c file.gz | split -l 500 -d -a 4 - pref_
Which generates the following files:
pref_0000
pref_0001
I'd like to pipe those files to zip ...
4
votes
0answers
43 views
Programmatically breaking all files in directory along size boundaries?
Okay, so I have a directory that has lots of files in it. These files are highly-compressed archives of documents, and I want to store these to a set of DVDs. That is, I want to have each archive on a ...
4
votes
1answer
82 views
Tar directory into independent archive files no larger than a certain size
I have a directory containing many files. Together, these files take up several gigabytes of space. I'd like to compress this directory.
But compressing the directory into a single file will make ...
0
votes
1answer
35 views
assign string components into variables [duplicate]
Looking for a smarter way to do something I'm doing already.
I have a string: "firstbit.secondbit.thirdbit.fourthbit.fifthbit.sixthbit"
The content between the periods changes, but the delimited ...
4
votes
3answers
258 views
Split file by number of lines including header in each one
I need to split a .txt file into smaller ones containing 100 lines each, including the header. I don't know if this is relevant, but the original file is delimited like this:
COLUMN1 | COLUMN2 | ...
3
votes
2answers
70 views
pipe process output to command split by line and whitespace
On the system I'm using I often need to cancel jobs I run. I can check my jobs like this:
$ showq|grep jquick
2001744 jquick Running 120 00:08:26 Mon Apr 11 11:06:02
2002020 ...
1
vote
1answer
366 views
Split large log file into pieces based on date
I am trying to work out a Linux command to split a large log file into pieces based on date.
Using http://stackoverflow.com/questions/11713978/how-to-split-existing-apache-logfile-by-month/11714105#...
2
votes
1answer
55 views
Split text file in random halves based on category
I have a text file that looks like this:
n03250847/n03250847_0.JPEG n03250847
n03250847/n03250847_1.JPEG n03250847
...
n03250847/n03250847_499.JPEG n03250847
...
n03255030/n03255030_0.JPEG n03255030
...
2
votes
2answers
109 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: <File_name>-<...
1
vote
1answer
64 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
78 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
32 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
42 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
312 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
418 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
283 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
175 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
374 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.
path="/...
2
votes
1answer
69 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
...
15
votes
13answers
2k 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
273 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
205 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
53 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
112 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
171 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:
input....
4
votes
2answers
309 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. ...
1
vote
0answers
31 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
60 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 XYZ ...
8
votes
8answers
1k 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
233 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
882 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 + ...
2
votes
2answers
44 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:
ctrl-a:...
2
votes
4answers
208 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
474 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
144 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 about ...