1. Description
Split [-BL] File prefix
2. Option
Parameters:
-B: the size of the file to be split. The unit can be added, for example, B, K, and M;
-L: split by the number of rows.
Prefix: indicates the meaning of the prefix. It can be used to separate the prefix Text of the case.
3. Example
1) Split-B 30B Prime. cpp me
2) Split-l 20 Prime. cpp
3) Cat XA *> Prime. cpp // in this way, use redirection to combine separated files.
4) ll-k xa *
-K like -- block-size = 1 K
5) ls-al./| split-B 200b-Hello
-It will be treated as stdin or stdout.
3. Split in awk
Awk's built-in function split can split strings into words and save them in an array.
Format: Split (string, array, field separator)
1) name = "76868 & 5676 & 435 & 43526 & 334 & 12312312 & 12321"
Awk 'in in {print split ('"\" $ name \ ""', filearray ,"&")}'
Note: awk requires that system variables must be referenced using single quotation marks and double quotation marks, that is, the format of '"$ sysvar"', but the split function also needs double quotation marks to define, but this double quotation mark cannot be explained by SH, but should be left to awk for explanation. Therefore, double quotation marks consisting of \ "and \" are used.
2) awk 'in in {print split ("76868 & 5676 & 435 & 43526 & 334 & 12312312 & 12321", filearray ,"&")}'
Reference
[1] laruence's private dish
Http://linux.vbird.org/linux_basic/0320bash.php#split
[2]Http://www.kklinux.com/html/biancheng/Shell/200901/24-2793.html
[3] split in awk
Http://blog.sina.com.cn/s/blog_4d1f40c00100r7y3.html
Http://zhu8337797.blog.163.com/blog/static/1706175492010113051014526/