在bash.how中基于字符串定界符分割文件? [英] Split file based on string delimiter in bash.how?
本文介绍了在bash.how中基于字符串定界符分割文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个文件.csv:
I have this file.csv :
coordinate1,coordinate2,value1
11111,a1,65
11111,a2,32
22222,b1,39
22222,b3,55
33333,c5,12
33333,c9,16
coordinate1,coordinate2,value2
54656,a1,65
21342,a2,32
23543,b1,39
123123,b3,55
568568,c5,12
568568,c9,16
123123,b3,55
568568,c5,12
568568,c9,16
coordinate1,coordinate2,value3
23543,b1,39
123123,b3,55
568568,c5,12
568568,c9,16
123123,b3,55
23543,b1,39
123123,b3,55
568568,c5,12
568568,c9,16
123123,b3,55
11111,a1,65
11111,a2,32
22222,b1,39
22222,b3,55
33333,c5,12
33333,c9,16
现在我想将此文件拆分为3个文件,每个人都只保留一组数据
Now I would like to split this file in 3 files , everyone whit only bloc of data
Es: 1° file
coordinate1,coordinate2,value1
11111,a1,65
11111,a2,32
22222,b1,39
22222,b3,55
33333,c5,12
33333,c9,16
Es: 2° file
coordinate1,coordinate2,value2
54656,a1,65
21342,a2,32
23543,b1,39
123123,b3,55
568568,c5,12
568568,c9,16
123123,b3,55
568568,c5,12
568568,c9,16
推荐答案
查看全文