Hi all, I'm trying to figure out if I can use Automator for this task.
I need to 1) extract text from a text file (FILE1), including a filename for a photoshop tiff file, 2) open the tiff file as text and extract a string, 3) combine the text from step 1 and 2 in a new text file (FILE2), and 4) repeat for all lines in the first text file that meet certain criteria.
My first text file (FILE1) looks like this:
For each line with "AX" in positions 6-7, extract columns 54-64 (START_TC), 66-76 (END_TC), and columns 19-end of the next line (TIFF_NAME). In this example, the first line of interest is line 3, starting with 002 AX:
Create a new text file (FILE2) like this (and append successive lines):
Is it possible to do this in Automator? Any thoughts on the best approach?
Many thanks in advance!
Joe
I need to 1) extract text from a text file (FILE1), including a filename for a photoshop tiff file, 2) open the tiff file as text and extract a string, 3) combine the text from step 1 and 2 in a new text file (FILE2), and 4) repeat for all lines in the first text file that meet certain criteria.
My first text file (FILE1) looks like this:
TITLE: 20170513 Ricky Ma SUBBED EDL TEST
FCM: NON-DROP FRAME
001 BL V C 00:00:00:00 01:30:09:10 00:00:00:00 01:30:09:10
002 AX V C 00:00:00:00 00:00:01:13 01:30:09:10 01:30:10:21
* FROM CLIP NAME: 20170513 Ricky Ma 0003.tif
003 BL V C 00:00:00:00 00:00:00:11 01:30:10:21 01:30:11:08
004 AX V C 00:00:00:00 00:00:01:01 01:30:11:08 01:30:12:09
* FROM CLIP NAME: 20170513 Ricky Ma 0004.tif
005 BL V C 00:00:00:00 00:00:00:20 01:30:12:09 01:30:13:05
006 AX V C 00:00:00:00 00:00:00:10 01:30:13:05 01:30:13:13
* FROM CLIP NAME: 20170513 Ricky Ma 0005.tif
007 BL V C 00:00:00:00 00:00:05:11 01:30:13:13 01:30:19:00
008 AX V C 00:00:00:00 00:00:01:16 01:30:19:00 01:30:20:13
* FROM CLIP NAME: 20170513 Ricky Ma 0006.tif
009 BL V C 00:00:00:00 00:00:02:18 01:30:20:13 01:30:23:07
010 AX V C 00:00:00:00 00:00:02:16 01:30:23:07 01:30:25:20
* FROM CLIP NAME: 20170513 Ricky Ma 0007.tif
FCM: NON-DROP FRAME
001 BL V C 00:00:00:00 01:30:09:10 00:00:00:00 01:30:09:10
002 AX V C 00:00:00:00 00:00:01:13 01:30:09:10 01:30:10:21
* FROM CLIP NAME: 20170513 Ricky Ma 0003.tif
003 BL V C 00:00:00:00 00:00:00:11 01:30:10:21 01:30:11:08
004 AX V C 00:00:00:00 00:00:01:01 01:30:11:08 01:30:12:09
* FROM CLIP NAME: 20170513 Ricky Ma 0004.tif
005 BL V C 00:00:00:00 00:00:00:20 01:30:12:09 01:30:13:05
006 AX V C 00:00:00:00 00:00:00:10 01:30:13:05 01:30:13:13
* FROM CLIP NAME: 20170513 Ricky Ma 0005.tif
007 BL V C 00:00:00:00 00:00:05:11 01:30:13:13 01:30:19:00
008 AX V C 00:00:00:00 00:00:01:16 01:30:19:00 01:30:20:13
* FROM CLIP NAME: 20170513 Ricky Ma 0006.tif
009 BL V C 00:00:00:00 00:00:02:18 01:30:20:13 01:30:23:07
010 AX V C 00:00:00:00 00:00:02:16 01:30:23:07 01:30:25:20
* FROM CLIP NAME: 20170513 Ricky Ma 0007.tif
For each line with "AX" in positions 6-7, extract columns 54-64 (START_TC), 66-76 (END_TC), and columns 19-end of the next line (TIFF_NAME). In this example, the first line of interest is line 3, starting with 002 AX:
START_TC = 01:30:09:10
END_TC = 01:30:10:21
TIFF_NAME = 20170513 Ricky Ma 0003.tif
For each TIFF_NAME, search for the <photoshop:LayerText> tag and extract its contents (TITLE_TEXT).END_TC = 01:30:10:21
TIFF_NAME = 20170513 Ricky Ma 0003.tif
Create a new text file (FILE2) like this (and append successive lines):
START_TC , END_TC , TITLE_TEXT
START_TC , END_TC , TITLE_TEXT
And so on for every instance in FILE1.START_TC , END_TC , TITLE_TEXT
Is it possible to do this in Automator? Any thoughts on the best approach?
Many thanks in advance!
Joe