According to this page 
<https://medium.com/@johnlreed/a-better-finder-rename-and-regular-expressions-7f0b9645a002>,
 
A Better Finder uses $1 etc. as references to captured parts of the Regular 
Expression match. Thus, you could put this in the Pattern field:
^(.+) - (.+)
and this in the With field:
$2 - $1
The article in the link has examples that look a lot like your situation. 
Please test with some unimportant folders first.

As to a Terminal window, you wouldn't ask the terminal itself to deal with 
regular expressions; it is always some Unix command that has to interpret 
them. On a text file, you'd use *sed*, e.g.
sed -E 's/^(.*) - (.*)$/\2 - \1/' foldernames.txt
The *mv* command for changing the names of files and folders doesn't accept 
regular expressions, so it would work differently - but your solution with 
A Better Finder is definitely easier.


On Saturday, September 2, 2017 at 5:39:15 PM UTC+2, Vlad Ghitulescu wrote:
>
> How do you type the RegEx from point 5 below in a Terminal-window?
>
>
>
> On 31 Aug 2017, at 19:47, Roland Küffner wrote:
>
> to bring this back to BBEdit, here is another „BBEdit only“ solution:
>
> 1. Create a new Unix Worksheet
> 2. type cd and drag your music folder after it, giving you something like
> cd '~/path/to folder' (add the quotation marks manually if you have 
> spaces in the file path
> 3. hint <Enter> (the <Return on the number block)
> 4. Now type „ls“ and <Enter> again.
> 5 Search-replace
> ^(.+) - (.+)
> and replacing it with
> mv '&' '\2 - \1'
> 6. Mark the lines with your folders and <Enter> again
>
> That’s it. But, please test this on example data before breaking something 
> (backups are your friend)
>
> Enjoy, Roland
>
> On Thu, Aug 31, 2017 at 4:27 PM, Vlad Ghitulescu  wrote:
>
>> Thanks, Rich - I didn't even think about this alternative.
>>
>> But: I needed a RegEx to put it in A Better Finder Rename (or an 
>> AppleScript for renaming the files). That would not be possible with the 
>> TSV-solution.
>>
>>
>> Regards,
>> Vlad
>>
>>
>>
>>
>>
>>
>> On 30 Aug 2017, at 22:24, Rich Siegel wrote:
>>
>> On Wednesday, August 30, 2017, Vlad Ghitulescu wrote:
>>>
>>> I have a couple of folder named like this (Artist - Title):
>>>>
>>>
>>> I'd begin by changing the document to TSV (search for " - " and replace 
>>> with "\t"), and then use "Columns => Rearrange Columns" (on the Edit menu 
>>> in the BBEdit 12 pre-release builds) and see how that works.
>>>
>>> R.
>>> -- 
>>> Rich Siegel                                 Bare Bones Software, Inc.
>>>
>>>
>>> Someday I'll look back on all this and laugh... until they sedate me.
>>>
>>> -- 
>>> This is the BBEdit Talk public discussion group. If you have a feature 
>>> request or would like to report a problem, please email
>>> "[email protected] <javascript:>" rather than posting to the group.
>>> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>>> --- You received this message because you are subscribed to the Google 
>>> Groups "BBEdit Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>> To post to this group, send email to [email protected] 
>>> <javascript:>.
>>> Visit this group at https://groups.google.com/group/bbedit.
>>>
>>
>> -- 
>> This is the BBEdit Talk public discussion group. If you have a feature 
>> request or would like to report a problem, please email
>> "[email protected] <javascript:>" rather than posting to the group.
>> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>> --- You received this message because you are subscribed to the Google 
>> Groups "BBEdit Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/bbedit.
>>
>
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "[email protected] <javascript:>" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] <javascript:>
> .
> Visit this group at https://groups.google.com/group/bbedit.
>
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to