LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   changing files extensions using inplace edit (perl) (https://www.linuxquestions.org/questions/linux-newbie-8/changing-files-extensions-using-inplace-edit-perl-4175615000/)

Alena 10-03-2017 11:47 PM

changing files extensions using inplace edit (perl)
 
Please help... I need to change a few files extensions using inplace edit (perl) and create a backup files. Thank you in advance.

sevendogsbsd 10-04-2017 09:41 AM

Is this just a bulk file rename? Are the files perl code files or are you asking how to do this in perl?

rtmistler 10-04-2017 01:39 PM

The Linux rename command uses perl expressions to perform it's actions.

Therefore Alena: Welcome to LQ. And you'll have to share a bit more about the exact details you wish to accomplish. Such as something like, "I wish to rename all JPG files to BAK files", or something specific. From there we can give you an idea what the perlexpr would be like for that rename command instance.

TB0ne 10-04-2017 01:48 PM

Quote:

Originally Posted by Alena (Post 5765992)
Please help... I need to change a few files extensions using inplace edit (perl) and create a backup files. Thank you in advance.

Ok...so since you need this in Perl, just post what you've done/tried/written on your own, and tell us where you're stuck. Lots of ways to do this. Also, provide us with some sample file names for input and what you want for output.

Otherwise, read the "Question Guidelines": we're happy to help you, but we aren't going to write a script/procedure for you.


All times are GMT -5. The time now is 08:37 AM.