Kev Jackson
12/6/2006 8:06:00 AM
> I have a tab-delimited text file that I would like to convert into an
> xml file that can be read/imported into Apple's Final Cut Pro.
>
> The text file is 2 columns.
> The first column is the time (timecode)
> The second column is text (for sub-titling)
>
> I thought this might be a good starting project to get into Ruby
>
> Any suggestions on how I might approach this?
look at XMLBuilder and FasterCSV
Setup FasterCSV to use a tab as the delimiter instead of the comma and
then use it to read the input and then use XMLBuilder to output
<timecode>data</timecode><sub-title>data</subtitle>
should be fairly simple, or you can avoid libraries and do it by
yourself to learn more about ruby without getting bogged down in 3rd
party libs
x = Builder::XmlMarkup.new(:target => $stdout, :indent => 1)
x.instruct
x.timcode data
x.sub-title data
etc
Kev