+ Post New Thread
Results 1 to 2 of 2
AV and Multimedia Related Thread, Create multiple asx wrapper files for media files in Technical; I am looking for a way to create multiple .asx wrapper files from a csv file or similar. I have ...
  1. #1

    Join Date
    Apr 2007
    Thank Post
    Thanked 9 Times in 5 Posts
    Rep Power

    Create multiple asx wrapper files for media files

    I am looking for a way to create multiple .asx wrapper files from a csv file or similar.

    I have taken a science dvd that consists of many clips and converted it into separate short clips that are then placed onto a Windows Streaming Server and accessed from anywhere on site via the Learning Platform. This works fine when performing individual convertions, but for multiple files it is a time consuming activity creating the individual asx wrapper files.

    The wrapper file is the small file that is placed on the learning environment that effectively makes the content searchable and referencable on the Sharepoint Learning Platform. Example below.

    <asx version = "3.0">
    <ref href ="mms://MEDIA01/videos/0081.wmv"
    <Title>the nativity story</Title>
    I would like to be able to create multiple files based upon a csv file that contains the mms address of the media and also the Title for the media. The title also becomes the filemane for each newly created asx file. Example below. Has anyone heard of such a thing of are there any coders that would like to spend a couple of hours knocking together a command line c# application, powershell or similar application to fill the neiche?

    "mms://MEDIA01/videos/0081.wmv","the nativity story"
    Many thanks,

    Martin Byford-Rew
    IT Manager
    Thomas Deacon Academy

  2. #2

    Join Date
    Feb 2009
    Thank Post
    Thanked 33 Times in 32 Posts
    Rep Power
    I suppose if I were being lazy (ie not using xml, csv, template libraries etc and fully input/output my code) i would do something like this in ruby (available for windows and installed on most *NIX systems: Download Ruby)

    csv_file = ''
    # get command line args
    ARGV.each do|a|
      a = File.expand_path(a)
      if File.exists?(a)
        if File.directory?(a)
          output_directory = a 
          csv_file = a
    output_directory ||= Dir.getwd
    puts "reading '#{csv_file}' file."
    puts "writing to '#{output_directory}' directory."
      file = File.new(csv_file, "r")
      while (line = file.gets)
        puts "processing: #{line}"        
        uri, title = line.split /,/
        uri.gsub!(/"/, '')
        title.gsub!(/"/, '')
        filename = File.join(output_directory, File.basename(uri).split('.').first + '.asx')  
        puts "writing ASX to #{filename}."
        File.open(filename, 'w') do |out|   
          out.puts '<asx version = "3.0">'
          out.puts '  <entry>'
          out.puts "    <ref href =\"#{uri}\">"
          out.puts "    <Title>#{title}</Title>"
          out.puts '    <Author></Author>'
          out.puts '    <Copyright></Copyright>'
          out.puts '    <Banner></Banner>'
          out.puts '  </entry>'
          out.puts '</asx>'
    rescue => err
      puts "Exception: #{err}"
    That will also produce an entry for the first (header) line of the csv, but hey it's a 10 minute script, asx files are named for their media, ie 00080.wmv will generate 00080.asx.

    Takes two command line arguments, one directory and one file in any order, the directory is the directory to write the asx files into (defaults to the current working directory) and the file is the csv file to read
    Last edited by Chillibear; 12th January 2010 at 01:03 PM. Reason: added note about output filenames

+ Post New Thread

Similar Threads

  1. [SIMS] SIMS.net and multiple connect.ini files
    By NortyUK in forum MIS Systems
    Replies: 23
    Last Post: 9th September 2011, 12:05 PM
  2. Replies: 2
    Last Post: 17th October 2009, 03:55 PM
  3. Search replace across multiple XML files
    By ajbritton in forum Windows
    Replies: 6
    Last Post: 6th April 2008, 11:07 PM
  4. Create Flash Files for Free
    By FN-GM in forum General Chat
    Replies: 8
    Last Post: 19th October 2007, 08:50 AM
  5. Seperate server for Media Studies files
    By tosca925 in forum General Chat
    Replies: 1
    Last Post: 17th July 2007, 06:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts