Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
25422572,2018-04-01,00:00:27,e7961e25-5f46-4c81-b85d-36ce404bf72e,891672 25422631,2018-04-01,00:01:21,41afad62-c037-4bed-9568-f76f3a86eb10,891672,
我有一个如上所示的数据,截至 2018-04-30 。我想将它分成 3 个文件,每个文件 10 天。如何通过 Linux 命令执行此操作?
你可以使用 grep:
grep -E "2018-04-(0[1-9]|10)" input.txt > out1.txt grep -E "2018-04-(1[1-9]|20)" input.txt > out2.txt grep -E "2018-04-(2[1-9]|30)" input.txt > out3.txt