Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Mar 2005
Posts: 366
|
How to open a (EDL)text file and parse it?
I been thinking about how to open a text file and how to parse it afterwards - things which would be useful for working with .edl or unsupported subtitle formats directly in avisynth script.
Some years ago avisynth strings seemed to be able to hold a limited number of characters, now it seems to be higher(anyone know how many?). Anyway this opens a possibility to work with huge scripts as strings which can be executed with the Eval command. So that part seems to be possible. However I can't find a way to load/read/import a text file into a string. And then run through the string - until the end of the string - parsing it on a line by line basis. Ex. script(not working): Code:
My_edl_string=ImportString("My_edl_file.edl")
My_edl_script=""#global variable the final avisynth script
My_edl_script=ParseString(My_Parser, My_edl_string)# Run through string and apply the named function to a line at a time until the end of the string.
function My_Parser(string CurrentLine)
{
findstr(CurrentLine, "avi")=0 ? :My_edl_script=My_edl_script&"Directshowsource("&chr(34)&CurrentLine&chr(34)&")"#example adding of parser script to My_edl_script
}
Eval(My_edl_string)# And finally convert the the generated script into a clip.
I guess if I somehow could count the number of line breaks in the string I could make a blankclip with a length of that number and use animate to call the parser function for each line, but how would I get it to count the number of line breaks and also how would I get the parser function to find and parse the line with the animated frame corresponding number?
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 24th August 2012 at 07:21. |
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|