Hi all,
I have a problem i could really use some help with.
Sorry for the long message but I find it hard to explain without showing.
I have 2 files.
File nr 1 is a reference that looks like this.
1 01:00:00:00 01:21:48:16 001
2 02:00:00:00 02:20:52:23 002
3 03:00:00:00 03:11:36:08 002
4 04:00:00:00 04:20:41:07 003
......
......
36 16:00:00:00 16:16:04:18 016
37 17:00:00:00 17:13:15:19 016
38 18:00:00:00 18:20:53:01 017
39 19:00:00:00 19:17:30:14 017
40 20:00:00:00 20:21:07:23 018
41 01:00:00:00 01:21:48:03 018
42 02:00:00:00 02:12:28:18 018
43 03:00:00:00 03:21:58:13 019
44 04:00:00:00 04:13:22:14 019
45 05:00:00:00 05:16:16:17 020
......
......
78 18:00:00:00 18:15:06:19 029
79 19:00:00:00 19:20:44:15 030
80 20:00:00:00 20:23:17:05 030
81 01:00:00:00 01:15:47:08 030
82 02:00:00:00 02:01:14:10 031
83 03:00:00:00 03:16:46:12 031
84 04:00:00:00 04:11:13:22 031
85 05:00:00:00 05:13:16:00 031
86 06:00:00:00 06:17:34:05 031
87 07:00:00:00 07:21:47:19 032
88 08:00:00:00 08:19:10:09 032
89 09:00:00:00 09:21:42:06 033
90 10:00:00:00 10:11:04:07 033
91 11:00:00:00 11:20:45:22 033
Continues a long way down.....
The second file is the one that need to be changed and it looks like this
001 016 V C 16:09:07:12 16:09:10:11 04:15:36:07 04:15:39:06
002 016 V C 17:10:40:14 17:10:42:00 04:16:45:18
04:16:47:04 #example line
003 016 V C 17:11:08:02 17:11:09:20 04:16:58:08 04:17:00:01
004 030 V C 19:15:24:05 19:15:27:18 04:17:05:03 04:17:08:16
005 031 V C 06:05:21:08 06:05:22:24 04:17:58:01 04:17:59:17
006 031 V C 06:09:00:20 06:09:03:05 04:18:01:11 04:18:03:21
007 031 V C 06:09:03:05 06:09:03:05 04:18:03:21 04:18:03:21
007 BL V D 007 00:00:00:00 00:00:00:07 04:18:03:21 04:18:04:03
008 031 V C 06:14:21:20 06:14:24:20 04:18:59:06 04:19:02:06
Continues a long way down.....
I need to change the second number in the second file.
for example the line
002 016 V C 17:10:40:14 17:10:42:00 04:16:45:18 04:16:47:04
the 016 needs to be changed to 037
The lines that dont have a number (e.g BL) should just be ignored.
The reference file have the 016 in more then 1 place so the second match
would be the timecode 17:10:40:14 is inbetween the timecodes in the
refrence file.
37 17:00:00:00 17:13:15:19 016
The first 4 lines should then look like this.
001 036 V C 16:09:07:12 16:09:10:11 04:15:36:07 04:15:39:06
002 037 V C 17:10:40:14 17:10:42:00 04:16:45:18 04:16:47:04
003 037 V C 17:11:08:02 17:11:09:20 04:16:58:08 04:17:00:01
004 079 V C 19:15:24:05 19:15:27:18 04:17:05:03 04:17:08:16
I know this is alot to ask but I'm hoping someone can take the time and
help me.
I'm just starting to look at this myself but since I'm short of time I
thougt I might give it
a try here on the list.
Hope it all makes any sence.
Thanks for you time.
Nisse
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/