[kwlug-disc] bulk renaming with regex
Sean D
thornlord at gmail.com
Thu Sep 29 13:27:46 EDT 2022
This is a good topic for me as I have a problem with regular expressions
and changing the filename/target item.
Thanks for this.
On Thu, Sep 29, 2022 at 1:26 PM CrankyOldBugger <crankyoldbugger at gmail.com>
wrote:
> Sorry, I neglected to mention dry run mode.. very handy, that. Take it
> from a guy who's completely bahookee'd entire folders...
>
>
> On Thu, Sep 29, 2022 at 1:18 PM Khalid Baheyeldin <kb at 2bits.com> wrote:
>
>> Just like Doug and Steve, I am in the camp of "create a shell script,
>> edit, then run it" camp.
>>
>> It often starts with awk:
>>
>> ls *show* | awk '{print "mv ", $1, $1}' > x
>>
>> Now x has a skeleton like:
>>
>> mv show1 show1
>> mv show2 show2
>>
>> Then I edit using vim according to what I want (tedious part), then run
>> it.
>>
>> But now that rename has been pointed out, I think I will try to use that
>> instead.
>> For one thing, it has -v (shows what is being done), and -n (a dry run
>> mode), which
>> should assist significantly with the task of renaming.
>>
>> _______________________________________________
>> kwlug-disc mailing list
>> kwlug-disc at kwlug.org
>> https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
--
110. Labour to keep alive in your breast that little celestial fire called
conscience.
--George Washington
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20220929/937cbfde/attachment.htm>
More information about the kwlug-disc
mailing list