Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

split(1) [v7 man page]

SPLIT(1)						      General Commands Manual							  SPLIT(1)

split - split a file into pieces SYNOPSIS
split [ -n ] [ file [ name ] ] DESCRIPTION
Split reads file and writes it in n-line pieces (default 1000), as many as necessary, onto a set of output files. The name of the first output file is name with aa appended, and so on lexicographically. If no output name is given, x is default. If no input file is given, or if - is given in its stead, then the standard input file is used. SPLIT(1)

Check Out this Related Man Page

SPLIT(1)						      General Commands Manual							  SPLIT(1)

split - split a file into pieces SYNOPSIS
split [ option ... ] [ file ] DESCRIPTION
Split reads file (standard input by default) and writes it in pieces of 1000 lines per output file. The names of the output files are xaa, xab, and so on to xzz. The options are -n n Split into n-line pieces. -l n Synonym for -n n, a nod to Unix's syntax. -e expression File divisions occur at each line that matches a regular expression; see regexp(7). Multiple -e options may appear. If a subex- pression of expression is contained in parentheses (...), the output file name is the portion of the line which matches the subex- pression. -f stem Use stem instead of x in output file names. -s suffix Append suffix to names identified under -e. -x Exclude the matched input line from the output file. -i Ignore case in option -e; force output file names (excluding the suffix) to lower case. SOURCE
/src/cmd/split.c SEE ALSO
sed(1), awk(1), grep(1), regexp(7) SPLIT(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split file - Include first and last row in each file.

Hi All, We have file structure as following. (Coma ';' delimiter file) Header 1;... 1;... 1;... 2;... 2;... 2;... Trailer We need to split this file as following. (for each change in first field, after header, we need to create new file with Header and Trailer line) Header... (21 Replies)
Discussion started by: meetmedude
21 Replies

2. Shell Programming and Scripting

Split a file into multiple files

Hi, i have a file like this: 1|2|3|4|5| 1|2|8|4|6| Trailer1||||| 1|2|3| Trailer2||| 3|4|5|6| 3|4|5|7| 3|4|5|8| Trailer2||| I want to generate 3 files out of this based on the trailer record. Trailer record string can be different for each file or it may be same for one or two. No... (24 Replies)
Discussion started by: pparthji
24 Replies

3. Solaris

Serial Split Brain detected in solaris10

Hello, I have connected storedge d2 to V440 running solaris 10. I had a raid 5 volume created using VXVM software. This morning when I rebooted the system, I get below error, Apr 2 14:21:10 servername vxvm:vxconfigd: V-5-1-9576 Split Brain. da id is 0.1, while dm id is 0.0 for dm myapp-dg01... (52 Replies)
Discussion started by: upengan78
52 Replies

4. Shell Programming and Scripting

Split a files into many files when condition

Hi Everyone, file.txt +++ a b c +++ d +++ asdf fefe fff Would like to have the output: file1.txt (22 Replies)
Discussion started by: jimmy_y
22 Replies

5. Shell Programming and Scripting

Splitting Concatenated Words in Input File with Words from a Master File

Hello, I have a complex problem. I have a file in which words have been joined together: Theboy ranslowly I want to be able to correctly split the words using a lookup file in which all the words occur: the boy ran slowly slow put child ly The lookup file which is meant for look up... (21 Replies)
Discussion started by: gimley
21 Replies

6. Shell Programming and Scripting

Help me pls : splitting single file in unix into different files based on data

I have a file in unix with sample data as follows : -------------------------------------------------------------- -------------------------------------------------------------- {30001002|XXparameter|Layout|$ I want this file to be splitted into different files and corresponding to the sample... (54 Replies)
Discussion started by: Ravindra Swan
54 Replies

7. Shell Programming and Scripting

Script to match strings that sometimes are splitted in 2 lines

Hello to all, I have an hexdump -C format as below: 31 54 47 55 48 4c 52 31 5f 52 31 32 31 31 32 ff 44 00 00 0E 01 32 14 56 42 17 47 48 0f ff ff ff 44 00 00 01 32 14 56 00 23 83 95 2f 42 17 47 48 00 0f ff ff 00 15 00 0a 48 00 01 5a 00 02 17 00 00 2f 00 00 30 00 00 31 00 00 ff 34 ff 44 00... (23 Replies)
Discussion started by: Ophiuchus
23 Replies

8. Shell Programming and Scripting

How to read and Split a file?

Hi, I have a .csv file which I want to split into smaller files as .csv format only Thanks in advance. (26 Replies)
Discussion started by: azherkn3
26 Replies

9. Shell Programming and Scripting

Split a line into next line

Hi All, I have user input file like below:- emplid|empl_name|salary|hire_date 1111|gro|3000|01/01/2014 1111|ghgo|4000|01/03/2014 1111|dkguo|5000|02/01/2014 1111|ehrt|6000|01/04/2014 1111|kfgtr|8000|03/01/2014 Sometimes input file will look like below.... (21 Replies)
Discussion started by: krupasindhu18
21 Replies

10. Shell Programming and Scripting

Split and add header and trailer from input file

I need to split the file based on pattern from position 34-37 while retaining the header and trailer records in each individual split file Also is it possible to output the TOM and PAT records in the same output file ? I need the output file names same as xyz_pattern_Datetimestamp.txt ... (23 Replies)
Discussion started by: techedipro
23 Replies

11. Shell Programming and Scripting

Split files with formatted numbers

How to split the file and have suffix with formatted numbers Tried the following code awk '{filename="split."int((NR-1)/2)".txt"; print >> filename}' split.txt Current Result Expected Result (21 Replies)
Discussion started by: bobbygsk
21 Replies

12. Shell Programming and Scripting

How can i split this.. :)?

hello, :) How can i split this.. :) two octet a=2 b=5 Thank you... (23 Replies)
Discussion started by: networksherlock
23 Replies

13. UNIX for Beginners Questions & Answers

Use portion of file name as new file name

Hello, This is my first posting and attempt to create a loop using Unix and awk commands. So far this is what I have: awk -F, 'BEGIN {months ="AP01"; months ="AP02"; months ="AP03"; months ="AP04"; months ="AP05"; months ="AP06"; months ="AP07"; months ="AP08"; months ="AP09"; months... (25 Replies)
Discussion started by: Raul_Rodriguez
25 Replies

14. Shell Programming and Scripting

Continuous nc data acquisition fails ocassionally

Hi, I'm receiving text data on a server trough UDP packets. The data are encoded messages separated by blank lines, like this: !AIVDM,1,1,,A,13FPE?PP08OG@cPH:Gi8OwwB0<0h,0*06 !AIVDM,1,1,,A,13Ebj60000wH2E:H:mKIF2GB2<17,0*49 !AIVDM,1,1,,B,4028nAAv9Kh0awESU0HRIP102D3f,0*5D I'm using... (23 Replies)
Discussion started by: lanas1234
23 Replies

15. Shell Programming and Scripting

Split large xml into mutiple files and with header and footer in file

Split large xml into mutiple files and with header and footer in file tried below it splits unevenly and also i need help in adding header and footer command : csplit -s -k -f my_XML_split.xml extrfile.xml "/<Document>/" {1} sample xml <?xml version="1.0" encoding="UTF-8"?><Recipient>... (36 Replies)
Discussion started by: karthik
36 Replies