本帖最后由 laolong 于 2023-2-23 12:25 编辑
文本文件 text.txt 中保存有如下格式的数据:- 2022-12-01 08:50:38
- 2022-12-01 10:52:47
- 2022-12-01 13:01:03
- 2022-12-01 13:58:14
- 2022-12-01 18:33:11
- 2022-12-01 18:56:31
- 2022-12-01 19:32:00
- 2022-12-01 19:32:01
- 2022-12-02 08:54:28
- 2022-12-02 09:26:54
- 2022-12-02 10:15:47
- 2022-12-02 13:59:48
- 2022-12-02 17:24:50
- 2022-12-02 18:03:51
- 2022-12-05 09:10:37
- 2022-12-05 11:09:49
- 2022-12-05 12:59:48
- 2022-12-05 13:41:24
- 2022-12-05 15:23:46
- 2022-12-05 16:01:26
- 2022-12-05 18:05:07
- 2022-12-06 09:10:31
- 2022-12-06 09:47:02
- 2022-12-06 11:08:03
- 2022-12-06 16:06:40
- 2022-12-06 18:18:23
复制代码 想获取每天的第一个(最早)和最后一个(最晚)的记录到一个文本文件中,两个记录之间以 tab 隔开:- 2022-12-01 08:50:38 2022-12-01 19:32:01
- 2022-12-02 08:54:28 2022-12-02 18:03:51
- 2022-12-05 09:10:37 2022-12-05 18:05:07
- 2022-12-06 09:10:31 2022-12-06 18:18:23
复制代码 先谢谢了 |