[Solved] Overwrite the date and time in the file name

Just Evan's icon

Hi, I'm saving a file from a buffer~ to disk by appending the date and time to the file name.

The problem is that if I save a file that already has a date & time, they will be duplicated (date and time).

For example:

Input: sample_name.wav

1st write: sample_name [yyyy-mm=dd hhmmss].wav

2nd: sample_name [yyyy-mm=dd hhmmss] [yyyy-mm=dd hhmmss].wav

I need help creating a regexp expression to remove the contents of the square brackets "[]" before the last dot ",wav" in the title. Like: sample_name [yyyy-mm=dd hhmmss].wav

Source Audio's icon

You don't need regexp

and don't need to append date but set it.

if you need to read and then rewrite time stamp

Based on your name and time stamp format.

I mean name is one word without spaces

Just Evan's icon

Source Audio, Thanks a lot! I appreciate your help!

Just Evan's icon

Source Audio, It seems I still need regexp, since I use samples whose names can be of different lengths, with or without a note and tempo tag, like: Sample_Name (F#) [128 bpm].

Just Evan's icon
Source Audio's icon
Just Evan's icon

Source Audio, Yes, but there is a small problem)

Source Audio's icon

Then you go with regexp.

better would be to avoid spaces in sample names

and only separate time stamp.