Jump to content

Txt split to ini file


Recommended Posts

Hello Autoit lovers, I am trying to write the data in the Datalar.txt and Users.txt files to the ini file according to the dates by comparing the data. The problem is that it writes only 1 data per date to Date.txt file. Thank you in advance for your friends to help you.

Datalar.txt

Quote

001,00000098,00,1.04.2023 08:12:27
001,00000022,00,1.04.2023 08:48:26
001,00000054,00,1.04.2023 19:50:14
001,00000098,00,1.04.2023 19:53:16
001,00000054,00,2.04.2023 08:50:40
001,00000020,00,2.04.2023 09:16:39
001,00000098,00,2.04.2023 19:55:42
001,00000020,00,2.04.2023 19:57:05
001,00000065,00,3.04.2023 07:17:40
001,00000102,00,3.04.2023 07:21:02
001,00000070,00,3.04.2023 07:29:19
001,00000023,00,3.04.2023 07:39:28
001,00000076,00,3.04.2023 07:49:15
001,00000047,00,3.04.2023 07:49:35
001,00000001,00,3.04.2023 07:49:41
001,00000095,00,3.04.2023 07:49:49
001,00000083,00,3.04.2023 07:50:33
001,00000082,00,3.04.2023 07:50:51
001,00000037,00,3.04.2023 07:53:36
001,00000015,00,3.04.2023 07:53:48
001,00000017,00,3.04.2023 07:54:39
001,00000114,00,3.04.2023 07:56:29
001,00000051,00,3.04.2023 07:57:26
001,00000046,00,3.04.2023 07:58:36
001,00000042,00,3.04.2023 07:59:08
001,00000055,00,3.04.2023 07:59:43
001,00000098,00,3.04.2023 07:59:48
001,00000035,00,3.04.2023 08:01:21
001,00000091,00,3.04.2023 08:01:24
001,00000108,00,3.04.2023 08:01:27
001,00000085,00,3.04.2023 08:06:59
001,00000109,00,3.04.2023 08:07:15
001,00000044,00,3.04.2023 08:08:04
001,00000096,00,3.04.2023 08:08:46
001,00000067,00,3.04.2023 08:09:21
001,00000041,00,3.04.2023 08:10:01
001,00000033,00,3.04.2023 08:10:27
001,00000038,00,3.04.2023 08:11:54
001,00000062,00,3.04.2023 08:12:00
001,00000101,00,3.04.2023 08:12:03
001,00000031,00,3.04.2023 08:12:23
001,00000028,00,3.04.2023 08:12:27
001,00000039,00,3.04.2023 08:12:31
001,00000086,00,3.04.2023 08:12:34
001,00000021,00,3.04.2023 08:14:25
001,00000053,00,3.04.2023 08:14:30
001,00000058,00,3.04.2023 08:14:33
001,00000100,00,3.04.2023 08:16:41
001,00000092,00,3.04.2023 08:17:55
001,00000045,00,3.04.2023 08:18:07
001,00000060,00,3.04.2023 08:19:44
001,00000089,00,3.04.2023 08:20:18
001,00000019,00,3.04.2023 08:20:22
001,00000090,00,3.04.2023 08:21:55
001,00000047,00,3.04.2023 08:26:55
001,00000014,00,3.04.2023 08:30:04
001,00000019,00,3.04.2023 09:43:09
001,00000037,00,3.04.2023 09:43:11
001,00000031,00,3.04.2023 09:46:04
001,00000023,00,3.04.2023 14:33:42
001,00000102,00,3.04.2023 15:15:48
001,00000060,00,3.04.2023 16:42:25
001,00000053,00,3.04.2023 16:50:01
001,00000065,00,3.04.2023 16:50:04
001,00000051,00,3.04.2023 16:50:12
001,00000041,00,3.04.2023 16:50:16
001,00000021,00,3.04.2023 16:50:20
001,00000083,00,3.04.2023 16:50:22
001,00000033,00,3.04.2023 16:50:28
001,00000096,00,3.04.2023 16:50:31
001,00000038,00,3.04.2023 16:50:33
001,00000089,00,3.04.2023 16:50:35
001,00000086,00,3.04.2023 16:50:38
001,00000015,00,3.04.2023 16:51:20
001,00000017,00,3.04.2023 16:51:23
001,00000039,00,3.04.2023 16:51:52
001,00000101,00,3.04.2023 16:52:02
001,00000108,00,3.04.2023 16:52:04
001,00000044,00,3.04.2023 16:52:25
001,00000114,00,3.04.2023 16:52:30
001,00000042,00,3.04.2023 16:52:54
001,00000028,00,3.04.2023 16:52:59
001,00000085,00,3.04.2023 16:53:01
001,00000100,00,3.04.2023 16:53:27
001,00000046,00,3.04.2023 16:53:41
001,00000109,00,3.04.2023 16:54:20
001,00000045,00,3.04.2023 16:55:11
001,00000092,00,3.04.2023 16:55:14
001,00000062,00,3.04.2023 16:55:18
001,00000111,00,3.04.2023 16:55:47
001,00000064,00,3.04.2023 16:56:02
001,00000090,00,3.04.2023 16:59:47
001,00000076,00,3.04.2023 17:02:21
001,00000058,00,3.04.2023 17:03:35
001,00000095,00,3.04.2023 17:03:43
001,00000001,00,3.04.2023 17:23:28
001,00000055,00,3.04.2023 20:07:19
001,00000020,00,3.04.2023 20:08:02
001,00000102,00,4.04.2023 06:45:06
001,00000047,00,4.04.2023 07:25:40
001,00000065,00,4.04.2023 07:35:55
001,00000001,00,4.04.2023 07:36:28
001,00000015,00,4.04.2023 07:39:39
001,00000082,00,4.04.2023 07:43:58
001,00000095,00,4.04.2023 07:44:23
001,00000101,00,4.04.2023 07:44:26
001,00000060,00,4.04.2023 07:46:35
001,00000083,00,4.04.2023 07:48:17
001,00000070,00,4.04.2023 07:48:48
001,00000023,00,4.04.2023 07:49:52
001,00000076,00,4.04.2023 07:50:51
001,00000017,00,4.04.2023 07:53:37
001,00000051,00,4.04.2023 07:55:34
001,00000037,00,4.04.2023 07:57:04
001,00000044,00,4.04.2023 07:57:26
001,00000114,00,4.04.2023 07:58:41
001,00000042,00,4.04.2023 08:00:44
001,00000010,00,4.04.2023 08:01:04
001,00000074,00,4.04.2023 08:01:06
001,00000053,00,4.04.2023 08:01:48
001,00000085,00,4.04.2023 08:03:42
001,00000067,00,4.04.2023 08:04:42
001,00000033,00,4.04.2023 08:05:03
001,00000028,00,4.04.2023 08:05:06
001,00000109,00,4.04.2023 08:07:04
001,00000021,00,4.04.2023 08:07:06
001,00000108,00,4.04.2023 08:07:10
001,00000090,00,4.04.2023 08:07:15
001,00000111,00,4.04.2023 08:07:30
001,00000005,00,4.04.2023 08:07:58
001,00000041,00,4.04.2023 08:08:09
001,00000096,00,4.04.2023 08:09:27
001,00000031,00,4.04.2023 08:10:42
001,00000086,00,4.04.2023 08:11:07
001,00000039,00,4.04.2023 08:11:11
001,00000092,00,4.04.2023 08:11:14
001,00000019,00,4.04.2023 08:12:41
001,00000089,00,4.04.2023 08:12:44
001,00000062,00,4.04.2023 08:12:48
001,00000046,00,4.04.2023 08:13:39
001,00000045,00,4.04.2023 08:13:43
001,00000038,00,4.04.2023 08:13:55
001,00000091,00,4.04.2023 08:14:01
001,00000094,00,4.04.2023 08:14:44
001,00000100,00,4.04.2023 08:14:47
001,00000061,00,4.04.2023 08:29:27
001,00000064,00,4.04.2023 08:30:49
001,00000020,00,4.04.2023 08:31:42
001,00000014,00,4.04.2023 08:32:45
001,00000070,00,4.04.2023 09:12:13
001,00000037,00,4.04.2023 12:44:28
001,00000102,00,4.04.2023 15:43:07
001,00000061,00,4.04.2023 16:57:02
001,00000094,00,4.04.2023 16:58:21
001,00000014,00,4.04.2023 16:59:11
001,00000051,00,4.04.2023 17:00:00
001,00000028,00,4.04.2023 17:00:03
001,00000065,00,4.04.2023 17:00:06
001,00000053,00,4.04.2023 17:00:09
001,00000100,00,4.04.2023 17:00:10
001,00000089,00,4.04.2023 17:00:13
001,00000108,00,4.04.2023 17:00:15
001,00000038,00,4.04.2023 17:00:16
001,00000085,00,4.04.2023 17:00:17
001,00000031,00,4.04.2023 17:00:19
001,00000086,00,4.04.2023 17:00:22
001,00000023,00,4.04.2023 17:00:27
001,00000033,00,4.04.2023 17:00:29
001,00000041,00,4.04.2023 17:00:32
001,00000010,00,4.04.2023 17:00:35
001,00000064,00,4.04.2023 17:00:39
001,00000042,00,4.04.2023 17:00:46
001,00000015,00,4.04.2023 17:00:49
001,00000091,00,4.04.2023 17:00:53
001,00000096,00,4.04.2023 17:00:56
001,00000090,00,4.04.2023 17:00:59
001,00000039,00,4.04.2023 17:01:01
001,00000037,00,4.04.2023 17:01:03
001,00000021,00,4.04.2023 17:01:06
001,00000046,00,4.04.2023 17:01:08
001,00000080,00,4.04.2023 17:01:09
001,00000019,00,4.04.2023 17:01:15
001,00000083,00,4.04.2023 17:01:18
001,00000045,00,4.04.2023 17:01:30
001,00000092,00,4.04.2023 17:01:32
001,00000017,00,4.04.2023 17:01:35
001,00000062,00,4.04.2023 17:01:42
001,00000101,00,4.04.2023 17:01:45
001,00000005,00,4.04.2023 17:01:47
001,00000109,00,4.04.2023 17:02:12
001,00000044,00,4.04.2023 17:02:15
001,00000016,00,4.04.2023 17:02:18
001,00000114,00,4.04.2023 17:02:20
001,00000030,00,4.04.2023 17:02:25
001,00000095,00,4.04.2023 17:02:39
001,00000082,00,4.04.2023 17:02:54
001,00000060,00,4.04.2023 17:04:58
001,00000060,00,4.04.2023 17:05:08
001,00000076,00,4.04.2023 17:06:36
001,00000001,00,4.04.2023 17:18:02
001,00000055,00,4.04.2023 20:01:57
001,00000102,00,5.04.2023 06:43:04
001,00000037,00,5.04.2023 07:20:59
001,00000065,00,5.04.2023 07:23:48
001,00000070,00,5.04.2023 07:30:35
001,00000047,00,5.04.2023 07:37:11
001,00000001,00,5.04.2023 07:38:17
001,00000015,00,5.04.2023 07:40:10
001,00000029,00,5.04.2023 07:41:51
001,00000076,00,5.04.2023 07:43:30
001,00000023,00,5.04.2023 07:45:38
001,00000035,00,5.04.2023 07:45:57
001,00000083,00,5.04.2023 07:46:34
001,00000086,00,5.04.2023 07:48:22
001,00000095,00,5.04.2023 07:48:34
001,00000054,00,5.04.2023 07:48:43
001,00000039,00,5.04.2023 07:49:10
001,00000082,00,5.04.2023 07:49:13
001,00000101,00,5.04.2023 07:49:31
001,00000060,00,5.04.2023 07:50:08
001,00000004,00,5.04.2023 07:50:27
001,00000091,00,5.04.2023 07:52:55
001,00000087,00,5.04.2023 07:54:27
001,00000064,00,5.04.2023 07:56:22
001,00000044,00,5.04.2023 07:56:34
001,00000017,00,5.04.2023 07:56:38
001,00000042,00,5.04.2023 07:57:26
001,00000030,00,5.04.2023 07:58:40
001,00000021,00,5.04.2023 07:59:02
001,00000019,00,5.04.2023 07:59:10
001,00000109,00,5.04.2023 07:59:25
001,00000108,00,5.04.2023 07:59:28
001,00000089,00,5.04.2023 07:59:32
001,00000051,00,5.04.2023 07:59:36
001,00000067,00,5.04.2023 08:00:07
001,00000114,00,5.04.2023 08:00:25
001,00000074,00,5.04.2023 08:00:29
001,00000085,00,5.04.2023 08:01:15
001,00000033,00,5.04.2023 08:01:17
001,00000014,00,5.04.2023 08:01:23
001,00000062,00,5.04.2023 08:01:55
001,00000045,00,5.04.2023 08:01:58
001,00000092,00,5.04.2023 08:02:02
001,00000046,00,5.04.2023 08:02:06
001,00000038,00,5.04.2023 08:02:30
001,00000041,00,5.04.2023 08:03:00
001,00000028,00,5.04.2023 08:03:19
001,00000090,00,5.04.2023 08:04:21
001,00000005,00,5.04.2023 08:04:33
001,00000031,00,5.04.2023 08:04:44
001,00000096,00,5.04.2023 08:07:30
001,00000055,00,5.04.2023 08:07:35
001,00000058,00,5.04.2023 08:09:05
001,00000053,00,5.04.2023 08:11:29
001,00000100,00,5.04.2023 08:11:31
001,00000111,00,5.04.2023 08:11:59
001,00000094,00,5.04.2023 08:16:28
001,00000080,00,5.04.2023 08:18:16
001,00000016,00,5.04.2023 08:19:30
001,00000116,00,5.04.2023 16:10:25
001,00000117,00,5.04.2023 16:10:29
001,00000118,00,5.04.2023 16:10:33
001,00000119,00,5.04.2023 16:10:36
001,00000120,00,5.04.2023 16:10:39
001,00000121,00,5.04.2023 16:10:42
001,00000122,00,5.04.2023 16:10:46
001,00000123,00,5.04.2023 16:10:49
001,00000124,00,5.04.2023 16:10:52
001,00000125,00,5.04.2023 16:10:55
001,00000126,00,5.04.2023 16:10:58
001,00000127,00,5.04.2023 16:11:01
001,00000128,00,5.04.2023 16:11:05
001,00000129,00,5.04.2023 16:11:11
001,00000130,00,5.04.2023 16:11:13
001,00000131,00,5.04.2023 16:11:18
001,00000047,00,5.04.2023 16:58:53
001,00000046,00,5.04.2023 16:59:06
001,00000005,00,5.04.2023 16:59:18
001,00000065,00,5.04.2023 17:00:01
001,00000053,00,5.04.2023 17:00:04
001,00000100,00,5.04.2023 17:00:09
001,00000086,00,5.04.2023 17:00:11
001,00000041,00,5.04.2023 17:00:13
001,00000039,00,5.04.2023 17:00:15
001,00000044,00,5.04.2023 17:00:20
001,00000033,00,5.04.2023 17:00:22
001,00000090,00,5.04.2023 17:00:24
001,00000102,00,5.04.2023 17:00:26
001,00000051,00,5.04.2023 17:00:30
001,00000014,00,5.04.2023 17:00:33
001,00000030,00,5.04.2023 17:00:36
001,00000016,00,5.04.2023 17:00:38
001,00000091,00,5.04.2023 17:00:42
001,00000062,00,5.04.2023 17:00:45
001,00000031,00,5.04.2023 17:00:47
001,00000017,00,5.04.2023 17:00:50
001,00000035,00,5.04.2023 17:00:55
001,00000037,00,5.04.2023 17:00:58
001,00000083,00,5.04.2023 17:01:01
001,00000092,00,5.04.2023 17:01:04
001,00000114,00,5.04.2023 17:01:09
001,00000038,00,5.04.2023 17:01:11
001,00000045,00,5.04.2023 17:01:13
001,00000021,00,5.04.2023 17:01:16
001,00000019,00,5.04.2023 17:01:19
001,00000108,00,5.04.2023 17:01:21
001,00000101,00,5.04.2023 17:01:24
001,00000096,00,5.04.2023 17:01:29
001,00000111,00,5.04.2023 17:01:32
001,00000089,00,5.04.2023 17:01:34
001,00000080,00,5.04.2023 17:01:36
001,00000070,00,5.04.2023 17:01:39
001,00000015,00,5.04.2023 17:01:41
001,00000023,00,5.04.2023 17:01:44
001,00000004,00,5.04.2023 17:01:50
001,00000082,00,5.04.2023 17:01:59
001,00000060,00,5.04.2023 17:02:08
001,00000029,00,5.04.2023 17:02:11
001,00000085,00,5.04.2023 17:02:14
001,00000028,00,5.04.2023 17:02:16
001,00000095,00,5.04.2023 17:03:24
001,00000109,00,5.04.2023 17:03:42
001,00000042,00,5.04.2023 17:03:47
001,00000064,00,5.04.2023 17:03:59
001,00000058,00,5.04.2023 17:08:50
001,00000001,00,5.04.2023 17:11:43
001,00000076,00,5.04.2023 17:55:12
001,00000022,00,5.04.2023 20:04:01
001,00000054,00,5.04.2023 20:04:16
001,00000102,00,6.04.2023 06:44:29
001,00000065,00,6.04.2023 07:14:59
001,00000037,00,6.04.2023 07:18:47
001,00000101,00,6.04.2023 07:19:43
001,00000070,00,6.04.2023 07:33:26
001,00000047,00,6.04.2023 07:34:01
001,00000029,00,6.04.2023 07:36:10
001,00000001,00,6.04.2023 07:37:53
001,00000015,00,6.04.2023 07:41:11
001,00000083,00,6.04.2023 07:46:50
001,00000082,00,6.04.2023 07:46:56
001,00000095,00,6.04.2023 07:47:06
001,00000023,00,6.04.2023 07:48:06
001,00000076,00,6.04.2023 07:49:01
001,00000035,00,6.04.2023 07:51:26
001,00000064,00,6.04.2023 07:53:46
001,00000061,00,6.04.2023 07:53:49
001,00000017,00,6.04.2023 07:53:54
001,00000053,00,6.04.2023 07:56:01
001,00000091,00,6.04.2023 07:56:03
001,00000087,00,6.04.2023 07:56:57
001,00000051,00,6.04.2023 07:57:02
001,00000021,00,6.04.2023 07:57:48
001,00000109,00,6.04.2023 07:57:51
001,00000044,00,6.04.2023 07:58:09
001,00000108,00,6.04.2023 07:58:12
001,00000033,00,6.04.2023 07:58:37
001,00000086,00,6.04.2023 07:59:02
001,00000039,00,6.04.2023 07:59:03
001,00000080,00,6.04.2023 07:59:06
001,00000085,00,6.04.2023 08:00:31
001,00000028,00,6.04.2023 08:00:34
001,00000042,00,6.04.2023 08:00:38
001,00000030,00,6.04.2023 08:00:44
001,00000098,00,6.04.2023 08:00:55
001,00000067,00,6.04.2023 08:01:17
001,00000111,00,6.04.2023 08:01:37
001,00000110,00,6.04.2023 08:01:54
001,00000031,00,6.04.2023 08:02:48
001,00000038,00,6.04.2023 08:02:54
001,00000016,00,6.04.2023 08:02:57
001,00000046,00,6.04.2023 08:02:58
001,00000062,00,6.04.2023 08:03:11
001,00000045,00,6.04.2023 08:03:28
001,00000114,00,6.04.2023 08:03:31
001,00000014,00,6.04.2023 08:03:33
001,00000004,00,6.04.2023 08:05:11
001,00000041,00,6.04.2023 08:05:34
001,00000090,00,6.04.2023 08:05:40
001,00000005,00,6.04.2023 08:05:43
001,00000019,00,6.04.2023 08:05:45
001,00000089,00,6.04.2023 08:05:48
001,00000096,00,6.04.2023 08:06:43
001,00000060,00,6.04.2023 08:06:48
001,00000092,00,6.04.2023 08:07:16
001,00000088,00,6.04.2023 08:07:20
001,00000058,00,6.04.2023 08:10:28
001,00000100,00,6.04.2023 08:12:39
001,00000094,00,6.04.2023 08:12:44
001,00000022,00,6.04.2023 08:17:33
001,00000023,00,6.04.2023 16:58:06
001,00000051,00,6.04.2023 17:00:02
001,00000065,00,6.04.2023 17:00:04
001,00000028,00,6.04.2023 17:00:06
001,00000041,00,6.04.2023 17:00:07
001,00000094,00,6.04.2023 17:00:09
001,00000114,00,6.04.2023 17:00:12
001,00000035,00,6.04.2023 17:00:14
001,00000045,00,6.04.2023 17:00:16
001,00000086,00,6.04.2023 17:00:19
001,00000038,00,6.04.2023 17:00:21
001,00000044,00,6.04.2023 17:00:22
001,00000042,00,6.04.2023 17:00:24
001,00000109,00,6.04.2023 17:00:27
001,00000016,00,6.04.2023 17:00:29
001,00000092,00,6.04.2023 17:00:32
001,00000014,00,6.04.2023 17:00:35
001,00000030,00,6.04.2023 17:00:38
001,00000067,00,6.04.2023 17:00:41
001,00000100,00,6.04.2023 17:00:44
001,00000096,00,6.04.2023 17:00:47
001,00000031,00,6.04.2023 17:00:48
001,00000005,00,6.04.2023 17:00:50
001,00000062,00,6.04.2023 17:00:53
001,00000053,00,6.04.2023 17:00:55
001,00000090,00,6.04.2023 17:00:57
001,00000091,00,6.04.2023 17:00:59
001,00000017,00,6.04.2023 17:01:01
001,00000046,00,6.04.2023 17:01:04
001,00000074,00,6.04.2023 17:01:06
001,00000037,00,6.04.2023 17:01:08
001,00000019,00,6.04.2023 17:01:11
001,00000108,00,6.04.2023 17:01:12
001,00000021,00,6.04.2023 17:01:13
001,00000083,00,6.04.2023 17:01:17
001,00000033,00,6.04.2023 17:01:19
001,00000089,00,6.04.2023 17:01:21
001,00000085,00,6.04.2023 17:01:25
001,00000101,00,6.04.2023 17:01:27
001,00000111,00,6.04.2023 17:01:30
001,00000087,00,6.04.2023 17:01:33
001,00000102,00,6.04.2023 17:01:36
001,00000082,00,6.04.2023 17:01:38
001,00000058,00,6.04.2023 17:01:40
001,00000080,00,6.04.2023 17:01:46
001,00000015,00,6.04.2023 17:01:49
001,00000095,00,6.04.2023 17:01:52
001,00000070,00,6.04.2023 17:01:56
001,00000039,00,6.04.2023 17:02:03
001,00000004,00,6.04.2023 17:02:09
001,00000060,00,6.04.2023 17:02:14
001,00000064,00,6.04.2023 17:02:43
001,00000110,00,6.04.2023 17:02:48
001,00000029,00,6.04.2023 17:03:25
001,00000076,00,6.04.2023 17:08:33
001,00000001,00,6.04.2023 17:13:35
001,00000061,00,6.04.2023 17:19:06
001,00000054,00,6.04.2023 19:51:32
001,00000098,00,6.04.2023 19:52:40
001,00000102,00,7.04.2023 06:42:52
001,00000037,00,7.04.2023 07:20:35
001,00000065,00,7.04.2023 07:21:54
001,00000047,00,7.04.2023 07:25:41
001,00000029,00,7.04.2023 07:32:35
001,00000070,00,7.04.2023 07:34:40
001,00000095,00,7.04.2023 07:36:26
001,00000001,00,7.04.2023 07:36:37
001,00000082,00,7.04.2023 07:36:59
001,00000101,00,7.04.2023 07:43:17
001,00000083,00,7.04.2023 07:45:45
001,00000015,00,7.04.2023 07:46:21
001,00000026,00,7.04.2023 07:49:34
001,00000035,00,7.04.2023 07:49:47
001,00000023,00,7.04.2023 07:50:13
001,00000064,00,7.04.2023 07:51:17
001,00000076,00,7.04.2023 07:51:21
001,00000061,00,7.04.2023 07:53:35
001,00000017,00,7.04.2023 07:54:30
001,00000091,00,7.04.2023 07:54:41
001,00000087,00,7.04.2023 07:55:58
001,00000111,00,7.04.2023 07:56:35
001,00000044,00,7.04.2023 07:57:16
001,00000074,00,7.04.2023 07:59:15
001,00000114,00,7.04.2023 07:59:39
001,00000031,00,7.04.2023 07:59:58
001,00000046,00,7.04.2023 08:00:27
001,00000051,00,7.04.2023 08:00:30
001,00000042,00,7.04.2023 08:00:41
001,00000016,00,7.04.2023 08:01:25
001,00000109,00,7.04.2023 08:01:31
001,00000021,00,7.04.2023 08:01:39
001,00000108,00,7.04.2023 08:01:43
001,00000108,00,7.04.2023 08:01:48
001,00000030,00,7.04.2023 08:01:54
001,00000080,00,7.04.2023 08:01:57
001,00000088,00,7.04.2023 08:02:00
001,00000067,00,7.04.2023 08:02:16
001,00000085,00,7.04.2023 08:02:44
001,00000033,00,7.04.2023 08:02:46
001,00000045,00,7.04.2023 08:02:50
001,00000062,00,7.04.2023 08:02:52
001,00000019,00,7.04.2023 08:03:26
001,00000089,00,7.04.2023 08:03:29
001,00000028,00,7.04.2023 08:03:41
001,00000039,00,7.04.2023 08:04:03
001,00000038,00,7.04.2023 08:04:27
001,00000041,00,7.04.2023 08:04:58
001,00000058,00,7.04.2023 08:06:22
001,00000014,00,7.04.2023 08:06:34
001,00000020,00,7.04.2023 08:08:02
001,00000096,00,7.04.2023 08:08:32
001,00000090,00,7.04.2023 08:08:40
001,00000060,00,7.04.2023 08:08:46
001,00000005,00,7.04.2023 08:09:20
001,00000053,00,7.04.2023 08:10:38
001,00000092,00,7.04.2023 08:10:42
001,00000110,00,7.04.2023 08:11:25
001,00000054,00,7.04.2023 08:12:32
001,00000100,00,7.04.2023 08:14:53
001,00000094,00,7.04.2023 08:16:29
001,00000062,00,7.04.2023 14:28:41
001,00000023,00,7.04.2023 16:59:03
001,00000114,00,7.04.2023 17:00:01
001,00000026,00,7.04.2023 17:00:02
001,00000051,00,7.04.2023 17:00:04
001,00000065,00,7.04.2023 17:00:07
001,00000044,00,7.04.2023 17:00:09
001,00000044,00,7.04.2023 17:00:10
001,00000033,00,7.04.2023 17:00:11
001,00000038,00,7.04.2023 17:00:15
001,00000083,00,7.04.2023 17:00:16
001,00000028,00,7.04.2023 17:00:20
001,00000021,00,7.04.2023 17:00:22
001,00000014,00,7.04.2023 17:00:27
001,00000085,00,7.04.2023 17:00:31
001,00000042,00,7.04.2023 17:00:37
001,00000091,00,7.04.2023 17:00:41
001,00000101,00,7.04.2023 17:00:43
001,00000037,00,7.04.2023 17:00:45
001,00000108,00,7.04.2023 17:00:47
001,00000019,00,7.04.2023 17:00:50
001,00000089,00,7.04.2023 17:00:52
001,00000102,00,7.04.2023 17:00:55
001,00000070,00,7.04.2023 17:00:58
001,00000053,00,7.04.2023 17:01:01
001,00000067,00,7.04.2023 17:01:04
001,00000064,00,7.04.2023 17:01:06
001,00000087,00,7.04.2023 17:01:10
001,00000005,00,7.04.2023 17:01:14
001,00000017,00,7.04.2023 17:01:20
001,00000035,00,7.04.2023 17:01:31
001,00000015,00,7.04.2023 17:01:34
001,00000096,00,7.04.2023 17:01:41
001,00000100,00,7.04.2023 17:01:44
001,00000046,00,7.04.2023 17:01:57
001,00000030,00,7.04.2023 17:02:00
001,00000109,00,7.04.2023 17:02:04
001,00000045,00,7.04.2023 17:03:51
001,00000092,00,7.04.2023 17:03:53
001,00000060,00,7.04.2023 17:04:16
001,00000061,00,7.04.2023 17:04:18
001,00000111,00,7.04.2023 17:04:37
001,00000110,00,7.04.2023 17:05:04
001,00000090,00,7.04.2023 17:05:57
001,00000029,00,7.04.2023 17:06:00
001,00000058,00,7.04.2023 17:06:31
001,00000076,00,7.04.2023 17:06:51
001,00000039,00,7.04.2023 17:07:43
001,00000095,00,7.04.2023 17:10:07
001,00000001,00,7.04.2023 17:17:40
001,00000041,00,7.04.2023 17:34:26
001,00000098,00,7.04.2023 19:38:02
001,00000020,00,7.04.2023 19:38:05
001,00000055,00,8.04.2023 07:51:36
001,00000098,00,8.04.2023 07:51:52
001,00000055,00,8.04.2023 20:17:36
001,00000020,00,8.04.2023 20:24:29
001,00000022,00,9.04.2023 08:01:56
001,00000020,00,9.04.2023 08:02:11
001,00000055,00,9.04.2023 19:56:34
001,00000022,00,9.04.2023 19:58:58
001,00000102,00,10.04.2023 06:50:23
001,00000037,00,10.04.2023 07:23:08
001,00000065,00,10.04.2023 07:25:15
001,00000047,00,10.04.2023 07:25:22
001,00000095,00,10.04.2023 07:37:47
001,00000082,00,10.04.2023 07:37:49
001,00000029,00,10.04.2023 07:38:44
001,00000015,00,10.04.2023 07:39:54
001,00000001,00,10.04.2023 07:43:33
001,00000101,00,10.04.2023 07:43:49
001,00000017,00,10.04.2023 07:46:08
001,00000083,00,10.04.2023 07:47:54
001,00000060,00,10.04.2023 07:47:59
001,00000076,00,10.04.2023 07:48:38
001,00000070,00,10.04.2023 07:50:17
001,00000086,00,10.04.2023 07:50:28
001,00000054,00,10.04.2023 07:51:15
001,00000039,00,10.04.2023 07:51:21
001,00000033,00,10.04.2023 07:53:41
001,00000033,00,10.04.2023 07:53:44
001,00000061,00,10.04.2023 07:55:05
001,00000023,00,10.04.2023 07:55:26
001,00000091,00,10.04.2023 07:55:28
001,00000030,00,10.04.2023 07:55:44
001,00000044,00,10.04.2023 07:55:46
001,00000087,00,10.04.2023 07:56:08
001,00000051,00,10.04.2023 07:56:11
001,00000069,00,10.04.2023 07:56:37
001,00000042,00,10.04.2023 07:57:06
001,00000010,00,10.04.2023 07:58:14
001,00000088,00,10.04.2023 07:58:15
001,00000074,00,10.04.2023 07:58:18
001,00000004,00,10.04.2023 08:00:09
001,00000085,00,10.04.2023 08:01:01
001,00000028,00,10.04.2023 08:01:03
001,00000110,00,10.04.2023 08:02:09
001,00000046,00,10.04.2023 08:02:11
001,00000021,00,10.04.2023 08:02:25
001,00000109,00,10.04.2023 08:02:30
001,00000108,00,10.04.2023 08:02:44
001,00000062,00,10.04.2023 08:03:18
001,00000041,00,10.04.2023 08:04:10
001,00000067,00,10.04.2023 08:04:16
001,00000038,00,10.04.2023 08:05:08
001,00000080,00,10.04.2023 08:05:11
001,00000014,00,10.04.2023 08:05:31
001,00000045,00,10.04.2023 08:05:41
001,00000053,00,10.04.2023 08:06:22
001,00000114,00,10.04.2023 08:07:00
001,00000092,00,10.04.2023 08:07:35
001,00000005,00,10.04.2023 08:07:45
001,00000090,00,10.04.2023 08:08:25
001,00000096,00,10.04.2023 08:09:04
001,00000035,00,10.04.2023 08:09:41
001,00000103,00,10.04.2023 08:10:20
001,00000058,00,10.04.2023 08:10:32
001,00000016,00,10.04.2023 08:11:21
001,00000019,00,10.04.2023 08:13:57
001,00000089,00,10.04.2023 08:14:02
001,00000094,00,10.04.2023 08:16:44
001,00000043,00,10.04.2023 09:08:09
001,00000043,00,10.04.2023 14:48:50
001,00000010,00,10.04.2023 16:54:06
001,00000074,00,10.04.2023 16:54:07
001,00000046,00,10.04.2023 16:54:23
001,00000047,00,10.04.2023 16:54:37
001,00000023,00,10.04.2023 16:55:40
001,00000103,00,10.04.2023 17:00:00
001,00000085,00,10.04.2023 17:00:02
001,00000038,00,10.04.2023 17:00:05
001,00000028,00,10.04.2023 17:00:06
001,00000065,00,10.04.2023 17:00:08
001,00000037,00,10.04.2023 17:00:11
001,00000062,00,10.04.2023 17:00:15
001,00000035,00,10.04.2023 17:00:19
001,00000058,00,10.04.2023 17:00:23
001,00000042,00,10.04.2023 17:00:26
001,00000005,00,10.04.2023 17:00:28
001,00000041,00,10.04.2023 17:00:30
001,00000086,00,10.04.2023 17:00:32
001,00000033,00,10.04.2023 17:00:34
001,00000044,00,10.04.2023 17:00:38
001,00000108,00,10.04.2023 17:00:41
001,00000091,00,10.04.2023 17:00:45
001,00000094,00,10.04.2023 17:00:51
001,00000045,00,10.04.2023 17:00:53
001,00000096,00,10.04.2023 17:00:56
001,00000089,00,10.04.2023 17:00:58
001,00000053,00,10.04.2023 17:01:00
001,00000102,00,10.04.2023 17:01:02
001,00000114,00,10.04.2023 17:01:06
001,00000039,00,10.04.2023 17:01:08
001,00000090,00,10.04.2023 17:01:10
001,00000095,00,10.04.2023 17:01:14
001,00000004,00,10.04.2023 17:01:16
001,00000029,00,10.04.2023 17:01:18
001,00000080,00,10.04.2023 17:01:20
001,00000019,00,10.04.2023 17:01:22
001,00000064,00,10.04.2023 17:01:26
001,00000111,00,10.04.2023 17:01:29
001,00000092,00,10.04.2023 17:01:35
001,00000015,00,10.04.2023 17:01:46
001,00000030,00,10.04.2023 17:01:53
001,00000069,00,10.04.2023 17:01:56
001,00000016,00,10.04.2023 17:01:58
001,00000087,00,10.04.2023 17:02:00
001,00000110,00,10.04.2023 17:02:02
001,00000017,00,10.04.2023 17:02:05
001,00000060,00,10.04.2023 17:02:15
001,00000083,00,10.04.2023 17:02:23
001,00000021,00,10.04.2023 17:02:27
001,00000101,00,10.04.2023 17:02:29
001,00000014,00,10.04.2023 17:03:55
001,00000076,00,10.04.2023 17:06:55
001,00000061,00,10.04.2023 17:13:31
001,00000001,00,10.04.2023 17:22:38
001,00000022,00,10.04.2023 19:52:49
001,00000054,00,10.04.2023 19:53:42
001,00000102,00,11.04.2023 06:46:00
001,00000047,00,11.04.2023 07:23:22
001,00000037,00,11.04.2023 07:25:51
001,00000065,00,11.04.2023 07:27:56
001,00000029,00,11.04.2023 07:35:42
001,00000001,00,11.04.2023 07:39:28
001,00000095,00,11.04.2023 07:40:33
001,00000082,00,11.04.2023 07:41:11
001,00000023,00,11.04.2023 07:43:05
001,00000101,00,11.04.2023 07:43:21
001,00000035,00,11.04.2023 07:47:37
001,00000083,00,11.04.2023 07:48:23
001,00000015,00,11.04.2023 07:48:35
001,00000060,00,11.04.2023 07:48:39
001,00000076,00,11.04.2023 07:48:44
001,00000086,00,11.04.2023 07:50:16
001,00000070,00,11.04.2023 07:50:32
001,00000039,00,11.04.2023 07:50:39
001,00000017,00,11.04.2023 07:50:43
001,00000033,00,11.04.2023 07:54:16
001,00000091,00,11.04.2023 07:55:49
001,00000010,00,11.04.2023 07:56:13
001,00000074,00,11.04.2023 07:56:14
001,00000088,00,11.04.2023 07:56:25
001,00000042,00,11.04.2023 07:56:37
001,00000004,00,11.04.2023 07:56:48
001,00000087,00,11.04.2023 07:57:14
001,00000051,00,11.04.2023 07:58:10
001,00000046,00,11.04.2023 07:59:55
001,00000098,00,11.04.2023 08:00:38
001,00000044,00,11.04.2023 08:00:48
001,00000108,00,11.04.2023 08:00:50
001,00000062,00,11.04.2023 08:01:17
001,00000085,00,11.04.2023 08:01:46
001,00000041,00,11.04.2023 08:03:09
001,00000038,00,11.04.2023 08:03:11
001,00000110,00,11.04.2023 08:03:25
001,00000111,00,11.04.2023 08:03:30
001,00000067,00,11.04.2023 08:03:48
001,00000109,00,11.04.2023 08:04:22
001,00000021,00,11.04.2023 08:04:29
001,00000005,00,11.04.2023 08:05:50
001,00000019,00,11.04.2023 08:06:07
001,00000089,00,11.04.2023 08:06:08
001,00000103,00,11.04.2023 08:06:21
001,00000069,00,11.04.2023 08:06:31
001,00000080,00,11.04.2023 08:06:57
001,00000014,00,11.04.2023 08:07:14
001,00000058,00,11.04.2023 08:07:21
001,00000053,00,11.04.2023 08:07:51
001,00000061,00,11.04.2023 08:07:53
001,00000114,00,11.04.2023 08:08:38
001,00000045,00,11.04.2023 08:08:42
001,00000092,00,11.04.2023 08:08:50
001,00000090,00,11.04.2023 08:09:02
001,00000016,00,11.04.2023 08:09:10
001,00000096,00,11.04.2023 08:09:26
001,00000030,00,11.04.2023 08:09:58
001,00000094,00,11.04.2023 08:15:50
001,00000043,00,11.04.2023 09:40:59
001,00000043,00,11.04.2023 14:48:56
001,00000023,00,11.04.2023 16:56:50
001,00000103,00,11.04.2023 17:00:01
001,00000065,00,11.04.2023 17:00:04
001,00000028,00,11.04.2023 17:00:06
001,00000051,00,11.04.2023 17:00:07
001,00000005,00,11.04.2023 17:00:09
001,00000085,00,11.04.2023 17:00:11
001,00000041,00,11.04.2023 17:00:13
001,00000030,00,11.04.2023 17:00:15
001,00000037,00,11.04.2023 17:00:16
001,00000042,00,11.04.2023 17:00:19
001,00000091,00,11.04.2023 17:00:21
001,00000014,00,11.04.2023 17:00:25
001,00000089,00,11.04.2023 17:00:28
001,00000038,00,11.04.2023 17:00:30
001,00000086,00,11.04.2023 17:00:32
001,00000109,00,11.04.2023 17:00:35
001,00000016,00,11.04.2023 17:00:37
001,00000035,00,11.04.2023 17:00:40
001,00000019,00,11.04.2023 17:00:45
001,00000021,00,11.04.2023 17:00:47
001,00000090,00,11.04.2023 17:00:50
001,00000102,00,11.04.2023 17:00:53
001,00000062,00,11.04.2023 17:00:55
001,00000053,00,11.04.2023 17:00:58
001,00000010,00,11.04.2023 17:01:00
001,00000074,00,11.04.2023 17:01:01
001,00000096,00,11.04.2023 17:01:05
001,00000070,00,11.04.2023 17:01:08
001,00000044,00,11.04.2023 17:01:11
001,00000047,00,11.04.2023 17:01:16
001,00000047,00,11.04.2023 17:01:17
001,00000046,00,11.04.2023 17:01:17
001,00000047,00,11.04.2023 17:01:20
001,00000095,00,11.04.2023 17:01:22
001,00000046,00,11.04.2023 17:01:24
001,00000045,00,11.04.2023 17:01:27
001,00000029,00,11.04.2023 17:01:31
001,00000088,00,11.04.2023 17:01:33
001,00000092,00,11.04.2023 17:01:37
001,00000039,00,11.04.2023 17:01:41
001,00000080,00,11.04.2023 17:01:43
001,00000004,00,11.04.2023 17:01:46
001,00000111,00,11.04.2023 17:01:48
001,00000110,00,11.04.2023 17:01:51
001,00000083,00,11.04.2023 17:01:53
001,00000101,00,11.04.2023 17:01:56
001,00000087,00,11.04.2023 17:01:58
001,00000015,00,11.04.2023 17:02:00
001,00000033,00,11.04.2023 17:02:12
001,00000114,00,11.04.2023 17:02:35
001,00000058,00,11.04.2023 17:02:59
001,00000076,00,11.04.2023 17:03:10
001,00000069,00,11.04.2023 17:03:36
001,00000060,00,11.04.2023 17:04:09
001,00000017,00,11.04.2023 17:04:26
001,00000001,00,11.04.2023 17:29:23
001,00000061,00,11.04.2023 17:36:47
001,00000054,00,11.04.2023 19:45:47
001,00000098,00,11.04.2023 19:54:55
001,00000102,00,12.04.2023 06:53:42
001,00000101,00,12.04.2023 06:58:14
001,00000065,00,12.04.2023 07:21:11
001,00000037,00,12.04.2023 07:21:17
001,00000047,00,12.04.2023 07:22:28
001,00000095,00,12.04.2023 07:34:53
001,00000001,00,12.04.2023 07:36:39
001,00000029,00,12.04.2023 07:37:39
001,00000010,00,12.04.2023 07:43:09
001,00000074,00,12.04.2023 07:43:10
001,00000015,00,12.04.2023 07:44:33
001,00000070,00,12.04.2023 07:44:57
001,00000042,00,12.04.2023 07:48:02
001,00000033,00,12.04.2023 07:48:20
001,00000076,00,12.04.2023 07:48:50
001,00000023,00,12.04.2023 07:48:53
001,00000086,00,12.04.2023 07:49:31
001,00000039,00,12.04.2023 07:49:43
001,00000051,00,12.04.2023 07:54:06
001,00000017,00,12.04.2023 07:54:10
001,00000030,00,12.04.2023 07:55:44
001,00000035,00,12.04.2023 07:56:12
001,00000046,00,12.04.2023 07:57:19
001,00000091,00,12.04.2023 07:58:13
001,00000060,00,12.04.2023 07:58:47
001,00000044,00,12.04.2023 07:58:49
001,00000004,00,12.04.2023 07:58:57
001,00000087,00,12.04.2023 07:58:59
001,00000062,00,12.04.2023 07:59:09
001,00000083,00,12.04.2023 08:00:35
001,00000085,00,12.04.2023 08:00:42
001,00000021,00,12.04.2023 08:00:44
001,00000028,00,12.04.2023 08:00:47
001,00000108,00,12.04.2023 08:00:49
001,00000109,00,12.04.2023 08:00:51
001,00000067,00,12.04.2023 08:01:12
001,00000110,00,12.04.2023 08:01:16
001,00000114,00,12.04.2023 08:02:18
001,00000045,00,12.04.2023 08:02:30
001,00000069,00,12.04.2023 08:02:32
001,00000088,00,12.04.2023 08:02:36
001,00000020,00,12.04.2023 08:03:11
001,00000038,00,12.04.2023 08:03:47
001,00000041,00,12.04.2023 08:04:02
001,00000058,00,12.04.2023 08:04:31
001,00000089,00,12.04.2023 08:04:38
001,00000054,00,12.04.2023 08:04:42
001,00000019,00,12.04.2023 08:04:47
001,00000014,00,12.04.2023 08:05:45
001,00000111,00,12.04.2023 08:06:16
001,00000092,00,12.04.2023 08:06:56
001,00000080,00,12.04.2023 08:07:18
001,00000016,00,12.04.2023 08:08:55
001,00000103,00,12.04.2023 08:09:18
001,00000005,00,12.04.2023 08:09:24
001,00000090,00,12.04.2023 08:10:05
001,00000096,00,12.04.2023 08:11:58
001,00000061,00,12.04.2023 08:12:26
001,00000053,00,12.04.2023 08:14:02
001,00000094,00,12.04.2023 08:14:38

 

Users.txt

Quote

00000001=Adriana Francesca Lima
00000002=Alessandra Corine Ambrósio
00000003=Alyssa Miller
00000004=Ana Beatriz Barros
00000005=Bar Refaeli
00000007=Barbara Palvin
00000008=Behati Prinsloo
00000009=Bella Hadid
00000010=Candice Swanepoel
00000011=Cara Delevingne
00000013=Doutzen Kroes
00000014=Emily DiDonato
00000015=Emily Ratajkowski
00000016=Gigi Hadid
00000017=Gisele Bündchen
00000018=Irina Shayk
00000019=Izabel Goulart
00000020=Kendall Jenner

#include <Misc.au3>
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>

_Singleton(@ScriptName, 0)
Global $aFile,$bFile
_FileReadToArray("Datalar.txt", $aFile, $FRTA_NOCOUNT)
_FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=")
Global $iLines = UBound($aFile)

GUICreate("_ank_ File Splitting", 430, 500, -1, -1)
$lv = GUICtrlCreateListView("KART ID  |DATE  |TİME  |NAME AND SURNAME     ", 10, 10, 410, 480)

For $i = 0 To $iLines - 1
    $aTemp = StringSplit($aFile[$i], ", ", $STR_NOCOUNT)
    $user = GetUser($aTemp[1])
    $sLine = $aTemp[1] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user
    GUICtrlCreateListViewItem($sLine, $lv)
    If $aTemp[4] > "08:10:00" And $aTemp[4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
    If $i = 0 Then ; sadece bir kez (1. satır => 1. tarih => 1. tarih txt dosyasını aç)
        $sDate = $aTemp[3]
        $sFilePath = @ScriptDir &'\'& $sDate &'.txt'
            IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1])
            IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3])
            IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4])
    EndIf
    If $sDate <> $aTemp[3] Then ; Tarih değiştiyse => eski tarih txt dosyasını kapatın, ardından yeni tarih txt dosyasını açın
        $sDate = $aTemp[3]
        $sFilePath = @ScriptDir &'\'& $sDate &'.txt'
            IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1])
            IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3])
            IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4])
    EndIf
Next

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        GUIDelete()
        Exit
    EndSwitch
WEnd

Func GetUser($ID)
    Local $iIndex = _ArraySearch($bFile, $ID)
    If $iIndex <> -1 Then
        Return $bFile[$iIndex][1]
    Else
        Return "Undefined ID"
    EndIf
EndFunc

:frantics:

Link to comment
Share on other sites

Here is partially fixed code but it still doesn't have much sense.

Post example of desired output INI file ...

#include <Misc.au3>
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>

_Singleton(@ScriptName, 0)
Global $aFile,$bFile
_FileReadToArray("Datalar.txt", $aFile, $FRTA_NOCOUNT)
_FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=")
Global $iLines = UBound($aFile)

GUICreate("_ank_ File Splitting", 430, 500, -1, -1)
$lv = GUICtrlCreateListView("KART ID  |DATE  |TIME  |NAME AND SURNAME     ", 10, 10, 410, 480)

$sDate = ''

For $i = 0 To $iLines - 1
    $aTemp = StringSplit($aFile[$i], ", ", $STR_NOCOUNT)
    $user = GetUser($aTemp[1])
    $sLine = $aTemp[1] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user
    GUICtrlCreateListViewItem($sLine, $lv)
    If $aTemp[4] > "08:10:00" And $aTemp[4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
    If $sDate <> $aTemp[3] Then $sDate = $aTemp[3]
;~  $sFilePath = @ScriptDir &'\'& $sDate &'.txt'
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4])
Next

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        GUIDelete()
        Exit
    EndSwitch
WEnd

Func GetUser($ID)
    Local $iIndex = _ArraySearch($bFile, $ID)
    If $iIndex <> -1 Then
        Return $bFile[$iIndex][1]
    Else
        Return "Undefined ID"
    EndIf
EndFunc

 

Edited by Zedna
Link to comment
Share on other sites

17 hours ago, Zedna said:

Seems to be practically the same as your older topic / my reply ...

 

That's the kind of inexperienced thing,  :oops: I'm sorry. With your support, we will improve our skills. Thanks again for your help and support. :ILA2:

Link to comment
Share on other sites

  • 2 weeks later...

By finding the user name corresponding to the Card ID in the Datalar.txt file and creating a separate configuration file (For example 10.04.2023.ini) for each date read in the Datalar.txt file, you can save each compatible data to this file (Value21 with User ID). , Value22'e Date, Value23'e Entry Time, that is the first value found and Value24'e Output Time, that is, the second value it finds) For this code, it only writes the output time, that is, the last read value, as Value23, and deletes the first read value. I hope I was able to explain. Thanks in advance for your help on this.

Link to comment
Share on other sites

So there's one ini file per day, ok.
You should IniRead the ini file, for each new line looped in Datalar.txt
Then you'll make sure if a section (username) already exists for that user or not.

* If the section doesn't exist, IniWrite it with its keys Value01, Value02, Value03 (Entry time)
* If the section already exists, add a key with IniWrite Value04 (Output time)

Something like this :

If IniRead(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01","Non-existing key") = "Non-existing key" Then
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4])
Else ; key already exists
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value04",$aTemp[4])
EndIf

I notice your sections are usernames, which makes it impossible to update correctly the [Undefined ID] section. It would make more sense to assign a section to a user ID, rather than his/her name, because all users ID's not found in Users.txt will create a mess in the [Undefined ID] section.

Also, maybe deleting an ini file (if it exists) should be a good thing, in case the script is run twice (or more) on same data, to avoid wrong additional keys update.

One should also think about users that got an odd number entries in Datalar.txt . If only one entry is found for a user, and it's an Output Time, then the script will not add a "Value04" (Output time) but Value 01 / Value 02 / Value 03 (Entry Time)

Didn't test this a lot, as Users.txt got a lot of missing ID's (users 00000012, then all users ID's from 00000021 to 00000131 are missing and create a mess in the [Undefined ID] section)

This isn't really easy to manage, especially with .ini files, as it requires several checking to make sure everything is correct. For the record, functions like IniReadSection or IniWriteSection could be a good help too.

Good luck :bye:
Edited by pixelsearch
Link to comment
Share on other sites

Many thanks for your help @pixelsearch. I also asked this question to artificial intelligence yesterday, after two hours of mutual conversation, it turned into a ridiculous code that had nothing to do with the script I gave and started giving an error. This means that artificial intelligence can never replace real intelligence like you. Even I started to doubt myself, I wonder if I didn't explain exactly what I wanted. But our clever Autoit-loving friends got it right away. with a single message.

:frantics:

Link to comment
Share on other sites

  • 2 weeks later...
#include <Misc.au3>
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>

_Singleton(@ScriptName, 0)
Global $aFile,$bFile,$aAbsent
_FileReadToArray("Datalar.txt", $aFile, $FRTA_NOCOUNT)
_FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=")
Global $iLines = UBound($aFile)

GUICreate("_ank_ File Splitting", 430, 500, -1, -1)
$lv = GUICtrlCreateListView("CART ID  |DATE  |TIME-1  |NAME AND SURNAME     ", 10, 10, 410, 480)
$sDate = ''

For $i = 0 To $iLines - 1
    $aTemp = StringSplit($aFile[$i], ", ", $STR_NOCOUNT)
    $user = GetUser($aTemp[1])
    $sLine = $aTemp[1] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user
    GUICtrlCreateListViewItem($sLine, $lv)
    If $aTemp[4] > "08:10:00" And $aTemp[4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
    If $sDate <> $aTemp[3] Then $sDate = $aTemp[3]
 If IniRead(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01","Non-existing key") = "Non-existing key" Then
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4])
Else
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value04",$aTemp[4])
EndIf
Next

    $aAbsent = _ArrayFindAll($bFile, 0, Default, Default, Default, Default, 2)
For $i = 0 To UBound($aAbsent) - 1
    GUICtrlCreateListViewItem($bFile[$aAbsent[$i]][0] &"|"& $aTemp[3] &"|"& "Empty" &"|"& $bFile[$aAbsent[$i]][1], $lv)
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$bFile[$aAbsent[$i]][0])
    IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$sDate)
Next

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        GUIDelete()
        Exit
    EndSwitch
WEnd

Func GetUser($ID)
    $iIndex = _ArraySearch($bFile, $ID)
    If $iIndex <> -1 Then
        Return $bFile[$iIndex][1]
    Else
        Return ""
    EndIf
EndFunc

Hello guys, I need your help as I can't solve a problem again.
What I'm trying to do is to save this person and the date as "Empty" if there is no data of that user in the file that is recorded in the User.txt file but separated as a date. Listwiew also takes only the latest date, does not take other dates and does not save this information in the ini file. I hope I was able to explain my problem with my bad English. :bye:

     One more thing I would like to point out, the format of the Datalar.txt file cannot be changed. I wonder if things would be easier if we changed the Users.txt file to Users.ini format?

Example:

Users.ini

Quote

[Users]

00000001=Adriana Francesca Lima
00000002=Alessandra Corine Ambrósio
00000003=Alyssa Miller
00000004=Ana Beatriz Barros
00000005=Bar Refaeli
00000007=Barbara Palvin

 

Edited by mucitbey
Link to comment
Share on other sites

I didn't understand what exactly you want, experimenting a little, I put my imagination to work a little, and here's the result.
It can't be, you'll find something useful :)
The rest you can throw away

; https://www.autoitscript.com/forum/topic/210069-txt-split-to-ini-file/?do=findComment&comment=1517679
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#include <Misc.au3>
#include <File.au3>
#include <Date.au3>
#include <Array.au3>
#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>

_Singleton(@ScriptName, 0)

Global $nMsg, $hGui, $idCombo, $lv, $CurUser

Global $aUsers = WriteAllUserData()
Global $aData = FindAllIniFile(@ScriptDir & "\Data\")
MakeMyGuiList()

HotKeySet("{HOME}", "MyArrayDisplay")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $idCombo
            _GUICtrlComboBox_GetLBText($idCombo, _GUICtrlComboBox_GetCurSel($idCombo), $CurUser)
            UpDadeMyGuiList($CurUser)
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

;----------------------------------------------------------------------------------------
Func WriteAllUserData()  ; Make all ini files
    Local $aDatalar, $aUsers, $UserName, $aTemp, $IniFile, $aSpl, $sDate

    _FileReadToArray("Datalar.txt", $aDatalar, $FRTA_NOCOUNT)
    _FileReadToArray("Users.txt", $aUsers, $FRTA_COUNT, "=")
    Local $iLines = UBound($aDatalar)

    $sDate = ''

    For $i = 0 To $iLines - 1
        $aTemp = StringSplit($aDatalar[$i], ", ", $STR_NOCOUNT)
        $UserName = GetUserName($aUsers, $aTemp[1])

        ; if no user skip
        If $UserName <> "" Then
            If $sDate <> $aTemp[3] Then $sDate = $aTemp[3]

            ; format date 00.00.0000 for ini FileName
            $aSpl = StringSplit($sDate, ".")
            If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1]
            $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini"

            ;write ini
            If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "UserID", "Non-existing key") = "Non-existing key" Then
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "UserID", $aTemp[1])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Date", $aTemp[3])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Start", $aTemp[4])
            Else
                If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Start", "<UNKNOWN>") <> $aTemp[4] Then
                    IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "End", $aTemp[4])
                EndIf
            EndIf
        EndIf
    Next
    Return $aUsers
EndFunc   ;==>WriteAllUserData
;----------------------------------------------------------------------------------------
Func GetUserName($aUsers, $ID)  ; ID to User Name
    Local $iIndex = _ArraySearch($aUsers, $ID)
    If $iIndex <> -1 Then
        Return StringStripWS($aUsers[$iIndex][1], $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES)
    Else
        Return ""
    EndIf
EndFunc   ;==>GetUserName
;----------------------------------------------------------------------------------------
Func FindAllIniFile($sStartPath = "")  ; Find All Ini File
    If $sStartPath = "" Then $sStartPath = @ScriptDir
    Local $aArray[1][8]
    $aArray[0][0] = 0 ; "index"
    $aArray[0][1] = "UserID"
    $aArray[0][2] = "UserName"
    $aArray[0][3] = "Date"
    $aArray[0][4] = "Start"
    $aArray[0][5] = "End"
    $aArray[0][6] = "Time"
    $aArray[0][7] = "idItem"

    Local $ArraySrtfiles = _FileListToArrayRec($sStartPath, "*.ini", $FLTAR_FILES, $FLTAR_RECUR)
    If Not IsArray($ArraySrtfiles) Then
        ConsoleWrite($sStartPath & " = Invalid input path" & @CRLF)
        Return
    Else
        For $x = 1 To $ArraySrtfiles[0]
            ;ConsoleWrite($sStartPath & $ArraySrtfiles[$x]& @CRLF)
            ReadIniToArray($aArray, $sStartPath & $ArraySrtfiles[$x])
        Next
        Return $aArray
    EndIf
EndFunc   ;==>FindAllIniFile
;----------------------------------------------------------------------------------------
Func ReadIniToArray(ByRef $aArray, $TxtFile)  ; Read Ini To Array

    Local $index

    ;Read the INI section names. This will return a 1 dimensional array.
    Local $aSections = IniReadSectionNames($TxtFile)
    ;Check if an error occurred.
    If Not @error Then
        ;Enumerate through the array displaying the section names.
        For $i = 1 To $aSections[0]
            ReDim $aArray[UBound($aArray) + 1][8]
            $aArray[0][0] += 1
            $index = $aArray[0][0]

            $aArray[$index][0] = $index ;"index"
            $aArray[$index][1] = IniRead($TxtFile, $aSections[$i], "UserID", "<EMPTY>") ;"UserID"
            $aArray[$index][2] = $aSections[$i] ;"UserName"
            $aArray[$index][3] = IniRead($TxtFile, $aSections[$i], "Date", "<EMPTY>") ;"Date"
            $aArray[$index][4] = IniRead($TxtFile, $aSections[$i], "Start", "<EMPTY>") ;"Start"
            $aArray[$index][5] = IniRead($TxtFile, $aSections[$i], "End", "<EMPTY>") ;"End"
            $aArray[$index][6] = "" ;"Time"
        Next
    EndIf

    Return $aArray

EndFunc   ;==>ReadIniToArray
;----------------------------------------------------------------------------------------
Func MakeMyGuiList()  ; GUI Create
    $hGui = GUICreate("_ank_ File Splitting", 510, 560, -1, -1)

    $lv = GUICtrlCreateListView("CART ID  |DATE  |START  |END  |TIME|NAME AND SURNAME", 10, 30, 490, 520)
    Local $sLine
    For $i = 1 To $aData[0][0]
        $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|"
        $sLine &= $aData[$i][5] & "|" & TimeDiff($aData[$i][4], $aData[$i][5]) & "|" & $aData[$i][2]
        $aData[$i][7] = GUICtrlCreateListViewItem($sLine, $lv)
        If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
        If $aData[$i][4] = "<EMPTY>" Or $aData[$i][5] = "<EMPTY>" Then GUICtrlSetBkColor(-1, 0xFFE5FF)
    Next

    $idCombo = GUICtrlCreateCombo("Select User", 10, 1, 490, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    For $i = 1 To $aUsers[0][0]
        _GUICtrlComboBox_AddString($idCombo, $aUsers[$i][1])
    Next

    GUISetState(@SW_SHOW)
EndFunc   ;==>MakeMyGuiList
;----------------------------------------------------------------------------------------
Func UpDadeMyGuiList($Filter)

    ; delete items
    For $i = 1 To $aData[0][0]
        GUICtrlDelete($aData[$i][7])
        $aData[$i][7] = ""
    Next

    Local $sLine
    ; ReMake items
    For $i = 1 To $aData[0][0]
        If $Filter = "Select User" Then
            $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|"
            $sLine &= $aData[$i][5] & "|" & TimeDiff($aData[$i][4], $aData[$i][5]) & "|" & $aData[$i][2]
            $aData[$i][7] = GUICtrlCreateListViewItem($sLine, $lv)
            If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
            If $aData[$i][4] = "<EMPTY>" Or $aData[$i][5] = "<EMPTY>" Then GUICtrlSetBkColor(-1, 0xFFE5FF)
            ContinueLoop
        Else
            If $aData[$i][2] = $Filter Then
                $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|"
                $sLine &= $aData[$i][5] & "|" & TimeDiff($aData[$i][4], $aData[$i][5]) & "|" & $aData[$i][2]
                $aData[$i][7] = GUICtrlCreateListViewItem($sLine, $lv)
                If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
                If $aData[$i][4] = "<EMPTY>" Or $aData[$i][5] = "<EMPTY>" Then GUICtrlSetBkColor(-1, 0xFFE5FF)
            Else
                $aData[$i][7] = ""
            EndIf
        EndIf
    Next

EndFunc   ;==>UpDadeMyGuiList
;----------------------------------------------------------------------------------------
Func TimeDiff($sStartTime, $sEndTime)
    Local $H, $M, $sDiff, $aSpl1, $aSpl2
    $aSpl1 = StringSplit($sStartTime, ":")
    $aSpl2 = StringSplit($sEndTime, ":")
    If $aSpl1[0] + $aSpl2[0] <> 6 Then
        ;ConsoleWrite("! Error No valid time format" & @CRLF)
        Return SetError(1, 0, "")
    EndIf
    ; ** 2020/01/01 ** since all the results are from the same date
    $M = _DateDiff('n', "2020/01/01 " & $sStartTime, "2020/01/01 " & $sEndTime)
    $H = Floor($M / 60)
    $M = Mod($M, 60)
    $sDiff = StringFormat("%i:%02i", $H, $M)
    Return $sDiff
EndFunc   ;==>TimeDiff
;----------------------------------------------------------------------------------------
Func MyArrayDisplay()
    _ArrayDisplay($aData, "$aData")
EndFunc   ;==>MyArrayDisplay
;----------------------------------------------------------------------------------------

 

I know that I know nothing

Link to comment
Share on other sites

     First of all thanks #ioa747 I'm trying to explain what I want to do.

Datalar.txt dosyasındaki ilk satırı verilerini örnek olarak  açıklayayım.
Datalar.txt satırı örnek 001,00000098,00,1.04.2023 08:12:27  
001         : Bu sütündaki veriler kullanılmayacak.
00000098     : Bu veri Users.txt dosyasında ilk sütun ile karşılaştırarak Bu ıd sahininin kullanıcı adını bulur ve [User Name] Id ise (Value01) olarak kaydedilir.
00         : Bu sütündaki veriler kullanılmıyacak.
1.04.2023    : ıd kaydına göre olunan veri tarih bilgisi (Value02) olarak kaydedilir.
08:12:27    : The time information of the id record. The first data in this figure (Value 03) is saved as a separate data in the second time data (Value04) with the same date and id.

Description of the Users.txt file
00000001=Adriana Francesca Lima
00000001 : Id no
Adriana Francesca Lima : Id user name

I want to find the id name in the Datalar.txt file from the Users.txt file and separate this data into files in the form of day.month.year.ini according to date information. I am trying to write the id owner information in the Users.txt file but the date and time information in the Datalar.txt file, and the date information in the day.month.year.ini file and print the time information as "blank". By the way, I shared only a portion of the much longer contents of the Datalar.txt file and Users.txt files in the first prefix.

The name and output of the ini file created using these two file examples should be as in the following example.

05.04.2023.ini file contains
[Alessandra Corine Ambrósio]
Value01=00000002
Value02=5.04.2023
Value03=07:37:11
Value04=16:58:53
[Ana Beatriz Barros]
Value01=00000005
Value02=5.04.2023
Value03=Null
Value04=Null
[Adriana Francesca Lima]
Value01=00000001
Value02=5.04.2023
Value03=07:38:17
Value04=17:11:43
[Bar Refaeli]
Value01=00000005
Value02=5.04.2023
Value03=07:54:15
Value04=Null
[Ana Beatriz Barros]
Value01=00000004
Value02=5.04.2023
Value03=07:40:10
Value04=17:01:41
[Alyssa Miller]
Value01=00000003
Value02=5.04.2023
Value03=Null
Value04=16:40:08

I hope it was descriptive enough. Thanks in advance to all the members who are helping and guiding.

 

Link to comment
Share on other sites

I don't know how many data bases you have, and where you get the data from, but in the Datalar.txt that you passed us in the first post,

on 04.05.2023 registration with Alessandra Corine Ambrósio there is not exist. I'll assume it's an example

Here I pass you a script that is closer to what you said. I think with this and the first sample, you have enough to get you through :)

; https://www.autoitscript.com/forum/topic/210069-txt-split-to-ini-file/?do=findComment&comment=1517679

#include <Misc.au3>
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>

_Singleton(@ScriptName, 0)

Global $aUsers = WriteAllUserData()
Global $aData = MakeDataArray(@ScriptDir & "\Data\")
MakeMyGuiList()
HotKeySet("{HOME}", "MyArrayDisplay")
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

;----------------------------------------------------------------------------------------
Func WriteAllUserData()  ; Make all ini files
    Local $aDatalar, $aUsers, $aAbsent, $IniFile, $aSpl, $sDate
    _FileReadToArray("Datalar.txt", $aDatalar, $FRTA_NOCOUNT)
    _FileReadToArray("Users.txt", $aUsers, $FRTA_NOCOUNT, "=")
    Local $iLines = UBound($aDatalar)

    $sDate = ''

    For $i = 0 To $iLines - 1
        $aTemp = StringSplit($aDatalar[$i], ", ", $STR_NOCOUNT)
        $UserName = GetUserName($aUsers, $aTemp[1])

        ; if no user skip
        If $UserName <> "" Then
            If $sDate <> $aTemp[3] Then $sDate = $aTemp[3]

            ; format date 00.00.0000 for ini FileName
            $aSpl = StringSplit($sDate, ".")
            If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1]
            $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini"

            ;write ini
            If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value01", "Non-existing key") = "Non-existing key" Then
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value01", $aTemp[1])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value02", $aTemp[3])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value03", $aTemp[4])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value04", "null")
            Else
                If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value03", "<UNKNOWN>") <> $aTemp[4] Then
                    IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value04", $aTemp[4])
                EndIf
            EndIf
        EndIf
    Next
    Return $aUsers
EndFunc   ;==>WriteAllUserData
;----------------------------------------------------------------------------------------
Func GetUserName($aUsers, $ID)  ; ID to User Name
    $iIndex = _ArraySearch($aUsers, $ID)
    If $iIndex <> -1 Then
        Return $aUsers[$iIndex][1]
    Else
        Return ""
    EndIf
EndFunc   ;==>GetUserName
;----------------------------------------------------------------------------------------
Func MakeDataArray($sStartPath = "")  ; Find All Ini File
    If $sStartPath = "" Then $sStartPath = @ScriptDir
    Local $aArray[1][6]
    $aArray[0][0] = 0 ; "index"
    $aArray[0][1] = "UserID"
    $aArray[0][2] = "UserName"
    $aArray[0][3] = "Date"
    $aArray[0][4] = "Start"
    $aArray[0][5] = "End"

    Local $ArraySrtfiles = _FileListToArrayRec($sStartPath, "*.ini", $FLTAR_FILES, $FLTAR_RECUR)
    If Not IsArray($ArraySrtfiles) Then
        ConsoleWrite($sStartPath & " = Invalid input path" & @CRLF)
        Return
    Else
        For $x = 1 To $ArraySrtfiles[0]
            ;ConsoleWrite($sStartPath & $ArraySrtfiles[$x]& @CRLF)
            ReadIniToArray($aArray, $sStartPath & $ArraySrtfiles[$x])
        Next
        Return $aArray
    EndIf
EndFunc   ;==>MakeDataArray
;----------------------------------------------------------------------------------------
Func ReadIniToArray(ByRef $aArray, $TxtFile)  ; Read Ini To Array

    Local $index

    ;Read the INI section names. This will return a 1 dimensional array.
    Local $aSections = IniReadSectionNames($TxtFile)
    ;Check if an error occurred.
    If Not @error Then
        ;Enumerate through the array displaying the section names.
        For $i = 1 To $aSections[0]
            ReDim $aArray[UBound($aArray) + 1][6]
            $aArray[0][0] += 1
            $index = $aArray[0][0]

            $aArray[$index][0] = $index ;"index"
            $aArray[$index][1] = IniRead($TxtFile, $aSections[$i], "Value01", "<EMPTY>") ;"UserID"
            $aArray[$index][2] = $aSections[$i] ;"UserName"
            $aArray[$index][3] = IniRead($TxtFile, $aSections[$i], "Value02", "<EMPTY>") ;"Date"
            $aArray[$index][4] = IniRead($TxtFile, $aSections[$i], "Value03", "<EMPTY>") ;"Start"
            $aArray[$index][5] = IniRead($TxtFile, $aSections[$i], "Value04", "<EMPTY>") ;"End"
        Next
    EndIf

    Return $aArray

EndFunc   ;==>ReadIniToArray
;----------------------------------------------------------------------------------------
Func MakeMyGuiList()  ; GUI Create
    Local $hGui
    $hGui = GUICreate("_ank_ File Splitting", 430, 500, -1, -1)
    $lv = GUICtrlCreateListView("CART ID  |DATE  |TIME-1  |NAME AND SURNAME     ", 10, 10, 410, 480)
    For $i = 1 To $aData[0][0]
        $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|" & $aData[$i][2]
        GUICtrlCreateListViewItem($sLine, $lv)
        If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)

        $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][5] & "|" & $aData[$i][2]
        GUICtrlCreateListViewItem($sLine, $lv)
        If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
    Next
    GUISetState(@SW_SHOW)
    Return $hGui
EndFunc   ;==>MakeMyGuiList
;----------------------------------------------------------------------------------------
Func MyArrayDisplay()
    _ArrayDisplay($aData, "$aData")
EndFunc   ;==>MyArrayDisplay
;----------------------------------------------------------------------------------------

 

I know that I know nothing

Link to comment
Share on other sites

@mucitbey

Just for clarification, using the datalar.txt and users.txt data in the first post, would the following table correctly reflect the results you are trying to load into daily INI files?  Is having the end result in INI files a necessity? 

The result below was created by importing the datalar and user data into sqlite tables and running a relatively simple query against the joined tables.  If your data is already in a database, you wouldn't even need to do the importing steps, you could just run the query against your existing database.  Having the data in a database makes it much easier to generate any reports that you may need.  Generating reports from INI files doesn't make much sense, unless it is a hard requirement.

Was I right to assume that the date "1.04.2023" is in  d.m.y format?  In the US we use m.d.y, but the result didn't look right when I converted the dates to sqldate format using m.d.y. 

REPORT: Users with entries in datalar.txt (All dates)
+------------+---------+------------------------+-------------------+
|    Date    | User Id |          Name          |       Times       |
+------------+---------+------------------------+-------------------+
| 2023-04-02 | 20      | Kendall Jenner         | 09:16:39,19:57:05 |
| 2023-04-03 | 1       | Adriana Francesca Lima | 07:49:41,17:23:28 |
| 2023-04-03 | 14      | Emily DiDonato         | 08:30:04          |
| 2023-04-03 | 15      | Emily Ratajkowski      | 07:53:48,16:51:20 |
| 2023-04-03 | 17      | Gisele Bündchen        | 07:54:39,16:51:23 |
| 2023-04-03 | 19      | Izabel Goulart         | 08:20:22,09:43:09 |
| 2023-04-03 | 20      | Kendall Jenner         | 20:08:02          |
| 2023-04-04 | 1       | Adriana Francesca Lima | 07:36:28,17:18:02 |
| 2023-04-04 | 5       | Bar Refaeli            | 08:07:58,17:01:47 |
| 2023-04-04 | 10      | Candice Swanepoel      | 08:01:04,17:00:35 |
| 2023-04-04 | 14      | Emily DiDonato         | 08:32:45,16:59:11 |
| 2023-04-04 | 15      | Emily Ratajkowski      | 07:39:39,17:00:49 |
| 2023-04-04 | 16      | Gigi Hadid             | 17:02:18          |
| 2023-04-04 | 17      | Gisele Bündchen        | 07:53:37,17:01:35 |
| 2023-04-04 | 19      | Izabel Goulart         | 08:12:41,17:01:15 |
| 2023-04-04 | 20      | Kendall Jenner         | 08:31:42          |
| 2023-04-05 | 1       | Adriana Francesca Lima | 07:38:17,17:11:43 |
| 2023-04-05 | 4       | Ana Beatriz Barros     | 07:50:27,17:01:50 |
| 2023-04-05 | 5       | Bar Refaeli            | 08:04:33,16:59:18 |
| 2023-04-05 | 14      | Emily DiDonato         | 08:01:23,17:00:33 |
| 2023-04-05 | 15      | Emily Ratajkowski      | 07:40:10,17:01:41 |
| 2023-04-05 | 16      | Gigi Hadid             | 08:19:30,17:00:38 |
| 2023-04-05 | 17      | Gisele Bündchen        | 07:56:38,17:00:50 |
| 2023-04-05 | 19      | Izabel Goulart         | 07:59:10,17:01:19 |
| 2023-04-06 | 1       | Adriana Francesca Lima | 07:37:53,17:13:35 |
| 2023-04-06 | 4       | Ana Beatriz Barros     | 08:05:11,17:02:09 |
| 2023-04-06 | 5       | Bar Refaeli            | 08:05:43,17:00:50 |
| 2023-04-06 | 14      | Emily DiDonato         | 08:03:33,17:00:35 |
| 2023-04-06 | 15      | Emily Ratajkowski      | 07:41:11,17:01:49 |
| 2023-04-06 | 16      | Gigi Hadid             | 08:02:57,17:00:29 |
| 2023-04-06 | 17      | Gisele Bündchen        | 07:53:54,17:01:01 |
| 2023-04-06 | 19      | Izabel Goulart         | 08:05:45,17:01:11 |
| 2023-04-07 | 1       | Adriana Francesca Lima | 07:36:37,17:17:40 |
| 2023-04-07 | 5       | Bar Refaeli            | 08:09:20,17:01:14 |
| 2023-04-07 | 14      | Emily DiDonato         | 08:06:34,17:00:27 |
| 2023-04-07 | 15      | Emily Ratajkowski      | 07:46:21,17:01:34 |
| 2023-04-07 | 16      | Gigi Hadid             | 08:01:25          |
| 2023-04-07 | 17      | Gisele Bündchen        | 07:54:30,17:01:20 |
| 2023-04-07 | 19      | Izabel Goulart         | 08:03:26,17:00:50 |
| 2023-04-07 | 20      | Kendall Jenner         | 08:08:02,19:38:05 |
| 2023-04-08 | 20      | Kendall Jenner         | 20:24:29          |
| 2023-04-09 | 20      | Kendall Jenner         | 08:02:11          |
| 2023-04-10 | 1       | Adriana Francesca Lima | 07:43:33,17:22:38 |
| 2023-04-10 | 4       | Ana Beatriz Barros     | 08:00:09,17:01:16 |
| 2023-04-10 | 5       | Bar Refaeli            | 08:07:45,17:00:28 |
| 2023-04-10 | 10      | Candice Swanepoel      | 07:58:14,16:54:06 |
| 2023-04-10 | 14      | Emily DiDonato         | 08:05:31,17:03:55 |
| 2023-04-10 | 15      | Emily Ratajkowski      | 07:39:54,17:01:46 |
| 2023-04-10 | 16      | Gigi Hadid             | 08:11:21,17:01:58 |
| 2023-04-10 | 17      | Gisele Bündchen        | 07:46:08,17:02:05 |
| 2023-04-10 | 19      | Izabel Goulart         | 08:13:57,17:01:22 |
| 2023-04-11 | 1       | Adriana Francesca Lima | 07:39:28,17:29:23 |
| 2023-04-11 | 4       | Ana Beatriz Barros     | 07:56:48,17:01:46 |
| 2023-04-11 | 5       | Bar Refaeli            | 08:05:50,17:00:09 |
| 2023-04-11 | 10      | Candice Swanepoel      | 07:56:13,17:01:00 |
| 2023-04-11 | 14      | Emily DiDonato         | 08:07:14,17:00:25 |
| 2023-04-11 | 15      | Emily Ratajkowski      | 07:48:35,17:02:00 |
| 2023-04-11 | 16      | Gigi Hadid             | 08:09:10,17:00:37 |
| 2023-04-11 | 17      | Gisele Bündchen        | 07:50:43,17:04:26 |
| 2023-04-11 | 19      | Izabel Goulart         | 08:06:07,17:00:45 |
| 2023-04-12 | 1       | Adriana Francesca Lima | 07:36:39          |
| 2023-04-12 | 4       | Ana Beatriz Barros     | 07:58:57          |
| 2023-04-12 | 5       | Bar Refaeli            | 08:09:24          |
| 2023-04-12 | 10      | Candice Swanepoel      | 07:43:09          |
| 2023-04-12 | 14      | Emily DiDonato         | 08:05:45          |
| 2023-04-12 | 15      | Emily Ratajkowski      | 07:44:33          |
| 2023-04-12 | 16      | Gigi Hadid             | 08:08:55          |
| 2023-04-12 | 17      | Gisele Bündchen        | 07:54:10          |
| 2023-04-12 | 19      | Izabel Goulart         | 08:04:47          |
| 2023-04-12 | 20      | Kendall Jenner         | 08:03:11          |
+------------+---------+------------------------+-------------------+

Edit:  Added additional daily (2023-04-05) report based on additional info.

REPORT: All Users For A Specific Date (2023-04-05)
+---------+----------------------------+-------------------+
| User Id |            Name            |       Times       |
+---------+----------------------------+-------------------+
| 1       | Adriana Francesca Lima     | 07:38:17,17:11:43 |
| 2       | Alessandra Corine Ambrosio |                   |
| 3       | Alyssa Miller              |                   |
| 4       | Ana Beatriz Barros         | 07:50:27,17:01:50 |
| 5       | Bar Refaeli                | 08:04:33,16:59:18 |
| 7       | Barbara Palvin             |                   |
| 8       | Behati Prinsloo            |                   |
| 9       | Bella Hadid                |                   |
| 11      | Cara Delevingne            |                   |
| 13      | Doutzen Kroes              |                   |
| 14      | Emily DiDonato             | 08:01:23,17:00:33 |
| 15      | Emily Ratajkowski          | 07:40:10,17:01:41 |
| 16      | Gigi Hadid                 | 08:19:30,17:00:38 |
| 17      | Gisele Bündchen            | 07:56:38,17:00:50 |
| 18      | Irina Shayk                |                   |
| 19      | Izabel Goulart             | 07:59:10,17:01:19 |
+---------+----------------------------+-------------------+

 

Edited by TheXman
Link to comment
Share on other sites

I think OP would like more, e.g. indicating those who are absent in each daily ini file.
For example, let's say this person exists in Users.txt :

00000005=Ana Beatriz Barros

If she didn't work on April 5th (e.g. not found in Datalar.txt for this date) then she still should be found in the daily ini file ("5.04.2023.ini") like indicated by OP in his precedent post :

[Ana Beatriz Barros]
 Value01=00000005
 Value02=5.04.2023
 Value03=Null
 Value04=Null

Which means adding to each daily ini file all users that didn't work that day (if I understood correctly)
That's why OP tried to create an "Absent" array in his last code and display it in his ListView :

 $aAbsent = _ArrayFindAll($bFile, 0, Default, Default, Default, Default, 2)

But this can't work with these parameters and not enough informations.

Another issue (iirc) : Some id's found in Datalar.txt may not be found in Users.txt (they'll all have same name in Listview, e.g "Undefined ID") which complicates things. I don't know how these id's are created (apparently not in Users.txt first) which made me suggest that the sections in the daily ini file should be related to users id's and not to users names, something like this :

[00000005]   <= User ID found in Datalar.txt
 Value01=Ana Beatriz Barros <= corresponding name found in Users.txt
 Value02=5.04.2023
 Value03=Null <= she didn't work at all that day (Value03 and Value04 are Null)
 Value04=Null <= ditto

[00000300]   <= User ID found in Datalar.txt
 Value01= Undefined ID <= not found in Users.txt
 Value02=5.04.2023
 Value03=07:00:00
 Value04=16:00:00

[00000301]   <= User ID found in Datalar.txt
 Value01= Undefined ID <= not found in Users.txt
 Value02=5.04.2023
 Value03=07:01:01
 Value04=16:02:02

In the daily ini file, if you don't have each section corresponding to an Id, how will you manage Id's found in Datalar.txt when these Id's don't exist in Users.txt ?

Anyway, let's hope OP will have enough infos with the script you guys provided, but imho doing all this with only txt files and ini files seems a bit difficult.
Link to comment
Share on other sites

@pixelsearch  thank you for shedding some light on the case, I can see that your lens is not just decorative :)

in that case add some extra Func  AddAbsentUser()

; https://www.autoitscript.com/forum/topic/210069-txt-split-to-ini-file/?do=findComment&comment=1517679
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 ;-w 5 -w 6 -w 7
#include <Misc.au3>
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>

_Singleton(@ScriptName, 0)
Global $nMsg, $hGui, $idCombo, $lv, $CurUser
Global $aUsers = WriteAllUserData()
Global $aData = MakeDataArray(@ScriptDir & "\Data\")

AddAbsentUser()
MakeMyGuiList()

HotKeySet("{HOME}", "MyArrayDisplay")
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

;----------------------------------------------------------------------------------------
Func WriteAllUserData()  ; Make all ini files
    Local $aDatalar, $aUsers, $UserName, $aTemp, $IniFile, $aSpl, $sDate
    _FileReadToArray("Datalar.txt", $aDatalar, $FRTA_NOCOUNT)
    _FileReadToArray("Users.txt", $aUsers, $FRTA_COUNT, "=")
    Local $iLines = UBound($aDatalar)

    $sDate = ''

    For $i = 0 To $iLines - 1
        $aTemp = StringSplit($aDatalar[$i], ", ", $STR_NOCOUNT)
        $UserName = GetUserName($aUsers, $aTemp[1])

        ; if no user skip
        If $UserName <> "" Then
            If $sDate <> $aTemp[3] Then $sDate = $aTemp[3]

;~          ; format date 00.00.0000 for ini FileName
;~          $aSpl = StringSplit($sDate, ".")
;~          If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1]
;~          $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini"
            $IniFile = $sDate & ".ini"

            ;write ini
            If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value01", "Non-existing key") = "Non-existing key" Then
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value01", $aTemp[1])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value02", $aTemp[3])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value03", $aTemp[4])
                IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value04", "null")
            Else
                If IniRead(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value03", "<UNKNOWN>") <> $aTemp[4] Then
                    IniWrite(@ScriptDir & "\Data\" & $IniFile, $UserName, "Value04", $aTemp[4])
                EndIf
            EndIf
        EndIf
    Next
    Return $aUsers
EndFunc   ;==>WriteAllUserData
;----------------------------------------------------------------------------------------
Func GetUserName($aUsers, $ID)  ; ID to User Name
    Local $iIndex = _ArraySearch($aUsers, $ID, 1)
    If $iIndex <> -1 Then
        Return $aUsers[$iIndex][1]
    Else
        Return ""
    EndIf
EndFunc   ;==>GetUserName
;----------------------------------------------------------------------------------------
Func MakeDataArray($sStartPath = "")  ; Find All Ini File
    If $sStartPath = "" Then $sStartPath = @ScriptDir
    Local $aArray[1][6]
    $aArray[0][0] = 0 ; "index"
    $aArray[0][1] = "UserID"
    $aArray[0][2] = "UserName"
    $aArray[0][3] = "Date"
    $aArray[0][4] = "Start"
    $aArray[0][5] = "End"

    Local $ArraySrtfiles = _FileListToArrayRec($sStartPath, "*.ini", $FLTAR_FILES, $FLTAR_RECUR)
    If Not IsArray($ArraySrtfiles) Then
        ConsoleWrite($sStartPath & " = Invalid input path" & @CRLF)
        Return
    Else
        For $x = 1 To $ArraySrtfiles[0]
            ;ConsoleWrite($sStartPath & $ArraySrtfiles[$x]& @CRLF)
            ReadIniToArray($aArray, $sStartPath & $ArraySrtfiles[$x])
        Next
        Return $aArray
    EndIf
EndFunc   ;==>MakeDataArray
;----------------------------------------------------------------------------------------
Func ReadIniToArray(ByRef $aArray, $TxtFile)  ; Read Ini To Array

    Local $index

    ;Read the INI section names. This will return a 1 dimensional array.
    Local $aSections = IniReadSectionNames($TxtFile)
    ;Check if an error occurred.
    If Not @error Then
        ;Enumerate through the array displaying the section names.
        For $i = 1 To $aSections[0]
            ReDim $aArray[UBound($aArray) + 1][6]
            $aArray[0][0] += 1
            $index = $aArray[0][0]

            $aArray[$index][0] = $index ;"index"
            $aArray[$index][1] = IniRead($TxtFile, $aSections[$i], "Value01", "<EMPTY>") ;"UserID"
            $aArray[$index][2] = $aSections[$i] ;"UserName"
            $aArray[$index][3] = IniRead($TxtFile, $aSections[$i], "Value02", "<EMPTY>") ;"Date"
            $aArray[$index][4] = IniRead($TxtFile, $aSections[$i], "Value03", "<EMPTY>") ;"Start"
            $aArray[$index][5] = IniRead($TxtFile, $aSections[$i], "Value04", "<EMPTY>") ;"End"
        Next
    EndIf

EndFunc   ;==>ReadIniToArray
;----------------------------------------------------------------------------------------
Func MakeMyGuiList()  ; GUI Create
    $hGui = GUICreate("_ank_ File Splitting", 400, 500, -1, -1)
    $lv = GUICtrlCreateListView("CART ID  |DATE  |TIME-1  |NAME AND SURNAME     ", 10, 10, 380, 480)
    Local $sLine

    For $i = 1 To $aData[0][0]
        $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][4] & "|" & $aData[$i][2]
        GUICtrlCreateListViewItem($sLine, $lv)
        If $aData[$i][4] > "08:10:00" And $aData[$i][4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
        $sLine = $aData[$i][1] & "|" & $aData[$i][3] & "|" & $aData[$i][5] & "|" & $aData[$i][2]
        GUICtrlCreateListViewItem($sLine, $lv)
        If $aData[$i][5] > "08:10:00" And $aData[$i][5] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF)
    Next
    GUISetState(@SW_SHOW)
    Return $hGui
EndFunc   ;==>MakeMyGuiList
;----------------------------------------------------------------------------------------
Func AddAbsentUser()

    Local $sLine, $IniFile, $aSpl, $aArray = $aData

    ;*[Add Absent User to $aData Array
    Local $aDateUnique = _ArrayUnique($aArray, 3, 1)
    For $d = 1 To $aDateUnique[0]
        For $i = 1 To $aUsers[0][0]
            If _GetThis($aUsers[$i][0] & "-" & $aDateUnique[$d]) = -1 Then
                $aData[0][0] += 1
                $sLine = $aData[0][0] & "|" & $aUsers[$i][0] & "|" & $aUsers[$i][1] & "|" & $aDateUnique[$d] & "|Null|Null"
                _ArrayAdd($aData, $sLine)
            EndIf
        Next
    Next
    ;Add Absent User to $aData Array]*

    ;*[proper Array Sort order
    For $i = 1 To $aData[0][0]
        ; format date YYYY.MM.DD.HH.MM.SS
        $aSpl = StringSplit($aData[$i][3], ".")
        If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1]
        $sLine = $aSpl[3] & "." & $aSpl[2] & "." & $aSpl[1] & "." & $aData[$i][4]
        $aData[$i][0] = $sLine
    Next
    _ArraySort($aData, 0, 1)
    For $i = 1 To $aData[0][0]
        $aData[$i][0] = $i
    Next
    ;proper Array Sort order]*

    ;*[Write $aData Array to ini
    For $i = 1 To $aData[0][0]
;~      ; format date 00.00.0000 for ini FileName
;~      $aSpl = StringSplit($aData[$i][3], ".")
;~      If StringLen($aSpl[1]) = 1 Then $aSpl[1] = "0" & $aSpl[1]
;~      $IniFile = $aSpl[1] & "." & $aSpl[2] & "." & $aSpl[3] & ".ini"
        $IniFile = $aData[$i][3] & ".ini"

        ;write ini
        IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value01", $aData[$i][1])
        IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value02", $aData[$i][3])
        IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value03", $aData[$i][4])
        IniWrite(@ScriptDir & "\Data\" & $IniFile, $aData[$i][2], "Value04", $aData[$i][5])
    Next
    ;Write $aData Array to ini]*

EndFunc   ;==>AddAbsentUser
;----------------------------------------------------------------------------------------
Func _GetThis($Txt)
    Local $sIndex
    For $i = 1 To $aData[0][0]
        $sIndex = -1
        If $aData[$i][1] & "-" & $aData[$i][3] = $Txt Then
            $sIndex = $i
            ExitLoop
        EndIf
    Next
    Return $sIndex
EndFunc   ;==>_GetThis
;----------------------------------------------------------------------------------------
Func MyArrayDisplay()
    _ArrayDisplay($aData, "$aData")
EndFunc   ;==>MyArrayDisplay
;----------------------------------------------------------------------------------------

Edit:
I believe that Datalar.txt is some kind of report from the machine-clocks that the employees punched in the cards upon their arrival and departure.
The one that has only the  001,00000098,00,1.04.2023 08:12:27  format


Agree if we want (or must) include users who do not have a name, then the ini file must be changed from:

[Adriana Francesca Lima]
Value01=00000001
Value02=12.04.2023
Value03=07:36:39
Value04=null

[Candice Swanepoel]
Value01=00000010
Value02=12.04.2023
Value03=07:43:09
Value04=null

to:

[00000001]
Value01=Adriana Francesca Lima
Value02=12.04.2023
Value03=07:36:39
Value04=null

[00000010]
Value01=Candice Swanepoel
Value02=12.04.2023
Value03=07:43:09
Value04=null

to be able to keep a record for each user without a name

Edited by ioa747
corection for proper coloring

I know that I know nothing

Link to comment
Share on other sites

     Thanks again for your attention #pixelserach and #ioa747. As always, you understood very well what I wanted to say. There was a misunderstanding caused by me only in the last part. I forgot to delete some erroneous data in the sample files I shared during the transfer. I solved this problem. So even though it is in my sample share, there is no id in the Datalar.txt file but not defined in the Users.txt file. Accordingly, the #pixelserach I tried to do solved the process.
     By the way, I use the Datalar.txt file in the format of the data read directly from the device, not from any database, and because the database cannot be run in the systems we use, storing the data in ini files does not cause problems in subsequent transfers and transformations.

This is the correct format:

Quote

[Adriana Francesca Lima]
Value01=00000001
Value02=12.04.2023
Value03=07:36:39
Value04=null

[Candice Swanepoel]
Value01=00000010
Value02=12.04.2023
Value03=07:43:09
Value04=null

[Gisele Bündchen]
Value01=00000017
Value02=12.04.2023
Value03=null
Value04=null

 

Link to comment
Share on other sites

@mucitbey You're saying that "there is no id in the Datalar.txt file but not defined in the Users.txt file."

Ok, but during the process of creating the daily ini files, you should still consider it could happen one day, after someone deleted or modified inadvertly a user id in Users.txt, we'll solve that case at the very end of this post.

Now that you confirm that the sections in daily ini files will always be related to a user name, let's create a real full example, based on 2 days, with 4 employees working in this company

Users.txt
00000001=Adriana Francesca Lima
00000010=Candice Swanepoel
00000017=Gisele Bündchen
00000020=Kendall Jenner


Datalar.txt (12.04.2023) (user 17 is absent)
001,00000001,00,12.04.2023 07:01:00
001,00000010,00,12.04.2023 07:10:00
001,00000001,00,12.04.2023 16:01:00
001,00000010,00,12.04.2023 16:10:00
001,00000020,00,12.04.2023 19:20:00

Datalar.txt (13.04.2023) (user 10 is absent)
001,00000020,00,13.04.2023 06:20:00
001,00000001,00,13.04.2023 07:01:00
001,00000017,00,13.04.2023 07:17:00
001,00000001,00,13.04.2023 16:01:00
001,00000017,00,13.04.2023 16:17:00

Before processing Datalar.txt, let's create a template containing ALL users of Users.txt, reusable for each daily ini file. This is the "blank" template content :

[Adriana Francesca Lima]
 Value01=00000001
 Value02=
 Value03=null
 Value04=null

[Candice Swanepoel]
 Value01=00000010
 Value02=
 Value03=null
 Value04=null

[Gisele Bündchen]
 Value01=00000017
 Value02=
 Value03=null
 Value04=null

[Kendall Jenner]
 Value01=00000020
 Value02=
 Value03=null
 Value04=null

Now we process Datalar.txt (12.04.2023) (user 17 is absent), this is the resulting "12.04.2023.ini"

[Adriana Francesca Lima]
 Value01=00000001
 Value02=12.04.2023
 Value03=07:01:00
 Value04=16:01:00

[Candice Swanepoel]
 Value01=00000010
 Value02=12.04.2023
 Value03=07:10:00
 Value04=16:10:00

[Gisele Bündchen]   <= ABSENT
 Value01=00000017
 Value02=12.04.2023
 Value03=null
 Value04=null

[Kendall Jenner]
 Value01=00000020
 Value02=12.04.2023
 Value03=19:20:00
 Value04=null

Now date changes in Datalar.txt and 13.04.2023 needs to be processed (user 10 is absent)
Reuse the "blank" template and fill it again, this is the resulting "13.04.2023.ini"

[Adriana Francesca Lima]
 Value01=00000001
 Value02=13.04.2023
 Value03=07:01:00
 Value04=16:01:00

[Candice Swanepoel]   <= ABSENT
 Value01=00000010
 Value02=13.04.2023
 Value03=null
 Value04=null

[Gisele Bündchen]
 Value01=00000017
 Value02=13.04.2023
 Value03=07:17:00
 Value04=07:17:00

[Kendall Jenner]
 Value01=00000020
 Value02=13.04.2023
 Value03=06:20:00
 Value04=null

In what format should be created the blank template ?

* It could be a txt file ("Users template.txt"), and when needed, just copy it, for example, to "12.04.2023.ini" before processing Datalar.txt (12.04.2023), then copy the template again to "13.04.2023.ini" before processing Datalar.txt (13.04.2023) etc...

* It could be an ini file ("Users template.ini") that you filled with IniWriteSection rather than IniWrite (creation should be faster), then copy it twice as indicated before (for 12.04.2023, then 13.04.2023)

If it ever happens that an ID is found in Datalar.txt and not retrieved in Users.txt (I know, it shouldn't happen but who knows ?)
While processing Datalar.txt, just add a section for this unknown person in the daily ini file, for example :

Datalar.txt (14.04.2023) (ID 59 will not exist in Users.txt, sabotage !)

...
001,00000059,00,14.04.2023 07:59:00
...

"14.04.2023.ini"

[Adriana Francesca Lima]
 etc...

[Candice Swanepoel]
 etc...

[Gisele Bündchen]
 etc...

[Kendall Jenner]
 etc...

[00000059]
 Value01=Undefined ID in Users.txt
 Value02=14.04.2023
 Value03=07:59:00
 Value04=null

Good luck :)
Link to comment
Share on other sites

18 minutes ago, pixelsearch said:

@mucitbey You're saying that "there is no id in the Datalar.txt file but not defined in the Users.txt file."

Ok, but during the process of creating the daily ini files, you should still consider it could happen one day, after someone deleted or modified inadvertly a user id in Users.txt, we'll solve that case at the very end of this post.

Now that you confirm that the sections in daily ini files will always be related to a user name, let's create a real full example, based on 2 days, with 4 employees working in this company

 

 

 

Users.txt
00000001=Adriana Francesca Lima
00000010=Candice Swanepoel
00000017=Gisele Bündchen
00000020=Kendall Jenner

 

 

 

Datalar.txt (12.04.2023) (user 17 is absent)
001,00000001,00,12.04.2023 07:01:00
001,00000010,00,12.04.2023 07:10:00
001,00000001,00,12.04.2023 16:01:00
001,00000010,00,12.04.2023 16:10:00
001,00000020,00,12.04.2023 19:20:00

Datalar.txt (13.04.2023) (user 10 is absent)
001,00000020,00,13.04.2023 06:20:00
001,00000001,00,13.04.2023 07:01:00
001,00000017,00,13.04.2023 07:17:00
001,00000001,00,13.04.2023 16:01:00
001,00000017,00,13.04.2023 16:17:00

 


Before processing Datalar.txt, let's create a template containing ALL users of Users.txt, reusable for each daily ini file. This is the "blank" template content :

 

 

 

 

[Adriana Francesca Lima]
 Value01=00000001
 Value02=
 Value03=null
 Value04=null

[Candice Swanepoel]
 Value01=00000010
 Value02=
 Value03=null
 Value04=null

[Gisele Bündchen]
 Value01=00000017
 Value02=
 Value03=null
 Value04=null

[Kendall Jenner]
 Value01=00000020
 Value02=
 Value03=null
 Value04=null

 


Now we process Datalar.txt (12.04.2023) (user 17 is absent), this is the resulting "12.04.2023.ini"

 

 

 

 

[Adriana Francesca Lima]
 Value01=00000001
 Value02=12.04.2023
 Value03=07:01:00
 Value04=16:01:00

[Candice Swanepoel]
 Value01=00000010
 Value02=12.04.2023
 Value03=07:10:00
 Value04=16:10:00

[Gisele Bündchen]   <= ABSENT
 Value01=00000017
 Value02=12.04.2023
 Value03=null
 Value04=null

[Kendall Jenner]
 Value01=00000020
 Value02=12.04.2023
 Value03=19:20:00
 Value04=null

 


Now date changes in Datalar.txt and 13.04.2023 needs to be processed (user 10 is absent)
Reuse the "blank" template and fill it again, this is the resulting "13.04.2023.ini"

 

 

 

 

[Adriana Francesca Lima]
 Value01=00000001
 Value02=13.04.2023
 Value03=07:01:00
 Value04=16:01:00

[Candice Swanepoel]   <= ABSENT
 Value01=00000010
 Value02=13.04.2023
 Value03=null
 Value04=null

[Gisele Bündchen]
 Value01=00000017
 Value02=13.04.2023
 Value03=07:17:00
 Value04=07:17:00

[Kendall Jenner]
 Value01=00000020
 Value02=13.04.2023
 Value03=06:20:00
 Value04=null

 


In what format should be created the blank template ?

* It could be a txt file ("Users template.txt"), and when needed, just copy it, for example, to "12.04.2023.ini" before processing Datalar.txt (12.04.2023), then copy the template again to "13.04.2023.ini" before processing Datalar.txt (13.04.2023) etc...

* It could be an ini file ("Users template.ini") that you filled with IniWriteSection rather than IniWrite (creation should be faster), then copy it twice as indicated before (for 12.04.2023, then 13.04.2023)

If it ever happens that an ID is found in Datalar.txt and not retrieved in Users.txt (I know, it shouldn't happen but who knows ?)
While processing Datalar.txt, just add a section for this unknown person in the daily ini file, for example :

Datalar.txt (14.04.2023) (ID 59 will not exist in Users.txt, sabotage !)

 

 

 

 

...
001,00000059,00,14.04.2023 07:59:00
...

 


"14.04.2023.ini"

 

 

 

 

[Adriana Francesca Lima]
 etc...

[Candice Swanepoel]
 etc...

[Gisele Bündchen]
 etc...

[Kendall Jenner]
 etc...

[00000059]
 Value01=Undefined ID in Users.txt
 Value02=14.04.2023
 Value03=07:59:00
 Value04=null

 


Good luck :)

 

Thanks #pixelsearch. Let's see how much of your redirects I can code. 😁

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...