#1 2007-02-10 06:40

Urlcool
Member
Registered: 2007-02-10
Posts: 7

Help with Twin Files

Hello

How can I make two files that have the same name but difference file extension.  For example

Track1.mp3
Track1.cdg
Track2.mp3
Track2.cdg
etc

I have imported a file that contains the track list, for example

SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON
SF250 - 02 - YOU KNOW MY NAME - CHRIS CORNELL

However I need them to be applied to both mp3 and cdg but at the moment it looks like this

Track1.mp3    >> SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON
Track1.cdg    >> SF250 - 02 - YOU KNOW MY NAME - CHRIS CORNELL

It should look like

Track1.mp3  >> SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON.mp3
Track1.cdg >> SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON.cdg
Track2.mp3 >> SF250 - 02 - YOU KNOW MY NAME - CHRIS CORNELL.mp3
Track2.cdg >> SF250 - 02 - YOU KNOW MY NAME - CHRIS CORNELL.cdg

I have no knowledge of Pascal so if anyone could help.  It has take over 6 hours just to find the program which I very happy with (THANKS)

This is the code I am using at the moment (Which I know it wrong)
var
  I: Integer;
begin
  I := I + 1;
  FileName := FileReadLine('C:\SUNFLY.CSV', I);
end.

Thanks
Rob

Offline

#2 2007-02-10 14:59

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: Help with Twin Files

If there are always 2 files with the same name (but different extension), there is an easy solution:

const
  NAMES = 'C:\SUNFLY.CSV';
var
  I: Integer;
  Ext: WideString;
begin
  I := I + 1;
  Ext := WideExtractFileExt(FileName);
  FileName := FileReadLine(NAMES, (I+1) div 2) + Ext;
end.

Here is a screenshot:

renamerbuddytracklistdq1.gif

Also, there is a more complicated solution described in several threads, which you probably don't even need, but you could have a look just for your information: Help numbering files

Offline

#3 2007-02-10 16:13

Urlcool
Member
Registered: 2007-02-10
Posts: 7

Re: Help with Twin Files

Thanks for that, I have one more problem.

Is there any way of missing the first line of the text file as my file list have the following

MF CODE,TRACK,SONG,ARTIST

The above works really well but I just need to miss the top line.

Rob

Offline

#4 2007-02-10 16:54

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: Help with Twin Files

Here you go:

const
  NAMES = 'C:\SUNFLY.CSV';
var
  I, Line: Integer;
  Ext: WideString;
begin
  I := I + 1;
  Line := ((I+1) div 2) + 1;
  Ext := WideExtractFileExt(FileName);
  FileName := FileReadLine(NAMES, Line) + Ext;
end.

Offline

#5 2007-02-10 17:45

Urlcool
Member
Registered: 2007-02-10
Posts: 7

Re: Help with Twin Files

Thanks that works really well,

Last question about formating

My csv file looks like this

MF CODE,TRACK,SONG,ARTIST
SF250,01,CHRISTMAS MY ARSE,RICKY TOMLINSON
SF250,02,YOU KNOW MY NAME,CHRIS CORNELL

At the moment I use another rule to remove and replace the , with - but it now looks like

SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON.cdg
SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON.mp3
SF250 - 02 - YOU KNOW MY NAME - CHRIS CORNELL.cdg
SF250 - 02 - YOU KNOW MY NAME - CHRIS CORNELL.mp3

Is there a way of formating them to look like

SF250 - 01 CHRISTMAS MY ARSE - RICKY TOMLINSON.cdg
SF250 - 01 CHRISTMAS MY ARSE - RICKY TOMLINSON.mp3
SF250 - 02 YOU KNOW MY NAME - CHRIS CORNELL.cdg
SF250 - 02 YOU KNOW MY NAME - CHRIS CORNELL.mp3

If it a lot of work do not worry as this will do.  This program is really good.

Rob

Offline

#6 2007-02-10 19:49

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: Help with Twin Files

It looks like you want to remove all of the second dashes, right?

Use RegEx rule, with these parameters:
  Expression: \A(.+?-.+?) -
  Replace: $1

It might look strange, but it will actually convert:
SF250 - 01 - CHRISTMAS MY ARSE - RICKY TOMLINSON.mp3
   into
SF250 - 01 CHRISTMAS MY ARSE - RICKY TOMLINSON.mp3

Offline

#7 2007-02-11 23:52

Urlcool
Member
Registered: 2007-02-10
Posts: 7

Re: Help with Twin Files

Thanks for that.  This is a really good program.

Rob

Offline

Board footer

Powered by FluxBB