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

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 15th May 2009, 08:49   #1  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
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.
Well as you can see I'm missing idears for ways to import textfiles into a string and also parse the string one line at the time until the end of the string.

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.
tin3tin is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.