Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: EAC and cue sheets (Read 4562 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

EAC and cue sheets

There are still some things I haven't managed to figure out how to do in EAC.

1) How can I create cue sheets where the paths to the files are left out? In many cases I wish to store the cue sheet in the same folder as the wav files, so I need only the filename, not the path. Changing this for every file in the cue sheet is a drag...

2) Sort of the same thing as my first question, when I use "Copy selected tracks - Compressed" for ripping and encoding directly to ape files, I would like to have the file names in my cue sheet to have the extension ape instead of wav.

If there is any way I can avoid having to do this manually, I would appreciate your advice.

Von

EAC and cue sheets

Reply #1
No ideas? Anyone? 

EAC and cue sheets

Reply #2
I don't think either is possible within EAC. You can try the following script. It removes path/drive info (if present) from every FILE "..." WAVE line, leaving just filenames, and also changes the .wav extensions to .ape. If it's already pathless or has a different extension there's no problem. If you delete the sub() line (4th), it removes the path but doesn't change the extension.
Code: [Select]
match($0, /FILE/) {
   file = gensub(/FILE "(.*)" WAVE/, "\\1", "g")
   s_file = strip_path(file)
   sub(/\.wav/, ".ape", s_file)
   print "FILE \"" s_file "\" WAVE"
}

!match($0, /FILE/)

function strip_path(path) {
   n_elems = split(path, array, "\\")
   return array[n_elems]
}


Usage:
Code: [Select]
type cuesheet.cue | gawk -f this-script-file-name > output.cue
move output.cue cuesheet.cue

(This has to be in two steps, otherwise input is truncated.)

gawk is available on many places in the Internet. e.g. example

If you make the following batch file, you can add it to the right-click menu of cue sheets.
Code: [Select]
type %1 | gawk -f c:\somewhere\this-script-file-name > %TEMP%\cuesheet-tmp.cue
move /y %TEMP%\cuesheet-tmp.cue %1

EAC and cue sheets

Reply #3
What a neat little script.  Thanks sinan.

I was also wondering how to get around these issues with cue sheets and had even wondered about writing an app to do it myself, but this does the job perfectly.

EAC and cue sheets

Reply #4
Thanks!  I have absolutely no experience in writing and/or using scripts, but I suppose the time has come for me to learn something new.