Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7705309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:50:10+00:00 2026-05-31T23:50:10+00:00

I’m new to programming and stackoverflow and have decided to start by learning objective

  • 0

I’m new to programming and stackoverflow and have decided to start by learning objective c.

In at the deep end, I know.

I am stuck trying to work out the best way to parse an edl file.
It is basically an ASCII text file of no more than 100KB.
Here is the structure of a typical cmx3600 edl:

TITLE:   EP1 FINAL.EDL SECTION2
FCM: NON-DROP FRAME
001  A199_C00 V     C        20:38:24:15 20:38:26:04 10:30:00:02 10:30:01:16
* SOURCE FILE: A199_C008_0915AH_001
002  A199_C00 V     C        20:34:48:17 20:34:51:23 10:30:01:16 10:30:04:22
* SOURCE FILE: A199_C007_0915VE_001

I’m trying to work out the best way to parse or scan each element into fields/arrays ie,

editNum = 001
tapeName = A199_C00
channel = V
Operation = C
sourceIn = 20:38:24:15
sourceOut = 20:38:26:04
recIn = 10:30:00:02
recOut = 10:30:01:16
sourceFile = A199_C008_0915AH_001

This is my code so far:

-(IBAction)importEdl:(id)sender {    

    //defines an Array of allowed file types with file extension ".EDL and .edl"

    NSOpenPanel *myPanel = [NSOpenPanel openPanel];
    NSArray *fileTypes = [NSArray arrayWithObjects:@"EDL", @"edl", nil];
    myPanel.allowedFileTypes = fileTypes;
    myPanel.allowsMultipleSelection = NO;

    if ([myPanel runModal] == NSOKButton)
    {            

    NSString *theFilePath = [myPanel filename];
    NSString *psEdlFile = [NSString stringWithContentsOfFile:theFilePath encoding:NSASCIIStringEncoding error:NULL];
        // Reads the file as one string. EDL's are simple ASCII text files of roughly 50KB.

    NSArray *psEdlLines = [psEdlFile componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];   
        // Separates the data into lines.

    if([psEdlLines count] == 0)
    {
        NSLog(@"Error!");                                  
    } //prints error if EDL file has no events.


    NSUInteger count;
    int i;
    for (i = 0, count = [psEdlLines count]; i < count; i = i + 1)
    {
        NSString *lineStrings = [psEdlLines objectAtIndex:i];
        NSLog(@"Line %d is %@",i+1,lineStrings);

    //NSArray *linesEnum = [psEdlLines objectAtIndex:i];
        //this creates an array of lines

    //NSLog(@"index is: %d %@",i, linesEnum);
    }

    }                

}

@end

The output is:

2012-03-20 15:22:08.956 TestProgram[412:903] Line 1 is TITLE:   EP1 FINAL.EDL SECTION2
2012-03-20 15:22:08.957 TestProgram[412:903] Line 2 is FCM: NON-DROP FRAME
2012-03-20 15:22:08.957 TestProgram[412:903] Line 3 is 001  A199_C00 V     C        20:38:24:15 20:38:26:04 10:30:00:02 10:30:01:16
2012-03-20 15:22:08.957 TestProgram[412:903] Line 4 is * SOURCE FILE: A199_C008_0915AH_001
2012-03-20 15:22:08.957 TestProgram[412:903] Line 5 is 002  A199_C00 V     C        20:34:48:17 20:34:51:23 10:30:01:16 10:30:04:22
2012-03-20 15:22:08.957 TestProgram[412:903] Line 6 is * SOURCE FILE: A199_C007_0915VE_001
2012-03-20 15:22:08.957 TestProgram[412:903] Line 7 is 003  A199_C00 V     C        20:42:32:01 20:42:35:19 10:30:04:22 10:30:08:15
2012-03-20 15:22:08.957 TestProgram[412:903] Line 8 is * SOURCE FILE: A199_C009_0915RX_001
2012-03-20 15:22:08.957 TestProgram[412:903] Line 9 is 
2012-03-20 15:22:08.958 TestProgram[412:903] Line 10 is 

I haven’t got very far as you can see.
Any ideas would be much appreciated.
Thanks in advance,
Pete.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:50:11+00:00Added an answer on May 31, 2026 at 11:50 pm

    More Progress.

    if ([lineScanner scanInt:&eventNum])
        {
            // parse the event into fields
    
            // does not work if edl contains dissolve or wipe
            // need to automatically convert dissolves into cuts
    
             NSString *editNum;
             NSString *reelName;
             NSString *channels;
             NSString *operation;
             //NSString *opDuration;
             NSString *sourceInTime;
             NSString *sourceOutTime;
             NSString *destInTime;
             NSString *destOutTime;
    
            NSScanner *elementScanner = [NSScanner scannerWithString:line];
    
            //NSString *token = [NSString string];
            NSCharacterSet *divider = [NSCharacterSet whitespaceCharacterSet];
    
            [elementScanner scanUpToCharactersFromSet:divider intoString:&editNum];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&reelName];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&channels];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&operation];
            //[elementScanner scanUpToCharactersFromSet:divider intoString:&opDuration];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&sourceInTime];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&sourceOutTime];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&destInTime];
            [elementScanner scanUpToCharactersFromSet:divider intoString:&destOutTime];
    
    
            NSLog(@"Event\tReelName\tChannels\tOperation\tSource In\tSource Out\tDest In\t\tDest Out");
            NSLog(@"%@\t%@\t%@\t\t\t%@\t\t\t%@\t%@\t%@\t%@", 
                  editNum, reelName, channels, operation, /*opDuration,*/ sourceInTime, sourceOutTime, destInTime,destOutTime);
    
        }
    

    Outputs the following.

    2012-03-29 15:54:15.489 TestProgram[2414:903] Scanner:Title = EP1 FINAL.EDL SECTION2
    2012-03-29 15:54:15.489 TestProgram[2414:903] Event ReelName    Channels    Operation   Source In   Source Out  Dest In     Dest Out
    2012-03-29 15:54:15.489 TestProgram[2414:903] 001   A180_C00    V           C           20:29:12:18 20:29:13:21 10:46:39:20 10:46:40:23
    2012-03-29 15:54:15.489 TestProgram[2414:903] Comment for event    001 * SOURCE FILE: A180_C001_09138L_001
    2012-03-29 15:54:15.489 TestProgram[2414:903] Event ReelName    Channels    Operation   Source In   Source Out  Dest In     Dest Out
    2012-03-29 15:54:15.490 TestProgram[2414:903] 002   A181_C01    V           C           22:10:03:03 22:10:05:09 10:46:40:23 10:46:43:04
    2012-03-29 15:54:15.490 TestProgram[2414:903] Comment for event    002 * SOURCE FILE: A181_C010_0913EA_001
    2012-03-29 15:54:15.490 TestProgram[2414:903] Event ReelName    Channels    Operation   Source In   Source Out  Dest In     Dest Out
    2012-03-29 15:54:15.490 TestProgram[2414:903] 003   A181_C01    V           C           22:10:05:09 22:10:05:10 10:46:43:04 10:46:43:09
    2012-03-29 15:54:15.490 TestProgram[2414:903] Effect for event     003    M2   A181_C01       000.0                22:10:05:09
    2012-03-29 15:54:15.491 TestProgram[2414:903] Comment for event    003 * * FREEZE FRAME
    2012-03-29 15:54:15.491 TestProgram[2414:903] Comment for event    003 * SOURCE FILE: A181_C010_0913EA_001
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to loop through a bunch of documents I have to put
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
Specifically, suppose I start with the string string =hello \'i am \' me And
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.