Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with multiple file rename - change case of part of file name Post 76421 by rahul123_libra on Tuesday 28th of June 2005 09:06:24 AM
Old 06-28-2005
Use awk

for old_name in `ls -l path_to_dir/*jpg`
do
new_name=`awk -F"-" 'BEGIN { OFS="-"} {$3=toupper($3);print $0}' $old_name`
mv $old_name $new_name
done

Last edited by rahul123_libra; 06-28-2005 at 10:37 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rename part of multiple files

Hello, I have about 200 files named like script1234_test.sh script3434_test.sh and so on... I am trying to write a script that will rename those files from test to dev, keeping the rest of the file name intact. Could anyone help? Thanks. (4 Replies)
Discussion started by: sajjad02
4 Replies

2. Shell Programming and Scripting

Rename multiple file from file listing

I am new at Linux/UNIX programming. Here is my problem. I had one big file which I split using the command csplit -k -s -f april.split. april '/^ISA/' '{10000}' So now I have multiple files with names april.split.01 april.split.02 april.split.03 But I need the name of the file like... (5 Replies)
Discussion started by: yshahiac
5 Replies

3. Shell Programming and Scripting

Multiple rename part of scripts

i have about 30 scripts for example: test, test1,test2, test3, test4,..... inside every scripte is code like this: echo "input check OK" how to rename this line in multiple scripts in this: echo "input error!" (2 Replies)
Discussion started by: waso
2 Replies

4. Shell Programming and Scripting

rename file by removing some part of the file name

I am special requirements to rename file. I have files with names like below: 1_firstname1_lastname1.html 2_firstname2_lastname2.html 3_fistname3_lastname2.html I would like these file to be renamed as below firstname1_lastname1.html firstname2_lastname2.html... (5 Replies)
Discussion started by: McLan
5 Replies

5. UNIX for Dummies Questions & Answers

Shell script to rename or change file extension case.

I searched the forum, but there was different type of rename. Hello. I have files in folder. Like: xxxxxxxx1.html or xxxxxxxx2.txt or xxxxxxxx3.tar.gz and how to rename or change file extension case to xxxxxxxx1.htm or xxxxxxx2.TXT or (5 Replies)
Discussion started by: Sheldon
5 Replies

6. Shell Programming and Scripting

Multiple file rename (change in filename in unix with single command

Dear All, Please help ! i ham having 300 file with E.G. PMC1_4567.arc in seq. like PMC1_4568.arc,PMC1_4569.arc ...n and so on.. i want all those file to be rename like PMC_4567.arc ,PMC_4568.arc .. mean i want to remove 1 from first file name .. pls help.. (6 Replies)
Discussion started by: moon_22
6 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Rename file name / remove part of name

I have a whole file structure with jpeg files where I want to remove a part of the file name. An application added in many files a case conflict in the naming "xyz 017.jpg (Case Conflict 1)" So, can someone help me how to get rid of the " (Case Conflict 1)"? What I have is this: find . -name... (2 Replies)
Discussion started by: borobudur
2 Replies

8. Shell Programming and Scripting

Find and rename part of a file

hi, Need your help. I need to write a script for below.. i have two files in directory /home/abc as below: Watch_20140203_abc.dat Watchnow_20140203_abc.dat I have to copy this file from /home/abc to /home01/home02 after that i have to rename the date part in above two files... (1 Reply)
Discussion started by: Vivekit82
1 Replies

9. Shell Programming and Scripting

How to rename last part of file ?

Hi, I have large number of files like below - UNIX FY17 D21-1c Active user audit - NPP dir owner listing(vctmstt01)_072816 - Notepad.pdf UNIX FY17 D21-1c Active user audit - TTMS dir owner listing(pvcdmot35)_072816 - Notepad.pdf UNIX FY17 D21-1c Active user audit - PCP dir owner... (3 Replies)
Discussion started by: solaris_1977
3 Replies
Wiki::Toolkit::Plugin(3pm)				User Contributed Perl Documentation				Wiki::Toolkit::Plugin(3pm)

NAME
Wiki::Toolkit::Plugin - A base class for Wiki::Toolkit plugins. DESCRIPTION
Provides methods for accessing the backend store, search and formatter objects of the Wiki::Toolkit object that a plugin instance is registered with. SYNOPSIS
package Wiki::Toolkit::Plugin::Foo; use base qw( Wiki::Toolkit::Plugin); # And then in your script: my $wiki = Wiki::Toolkit->new( ... ); my $plugin = Wiki::Toolkit::Plugin::Foo->new; $wiki->register_plugin( plugin => $plugin ); my $node = $plugin->datastore->retrieve_node( "Home" ); POSSIBLE METHODS
pre_moderate Called before moderation is performed. Allows changes to the parameters used in moderation. my %args = @_; my ($name_ref,$version_ref) = @args{ qw( node version ) }; $$name_ref =~ s/s/_/g; return 0; post_moderate Called after moderation has been performed. Allows additional actions to occur after node moderation. my %args = @_; my ($node,$node_id,$version) = @args{ qw( node node_id version ) }; &update_pending_list($node,$version); pre_rename Called before a rename is performed. Allows changes to the parameters used by rename. my %args = @_; my ($old_name_ref,$new_name_ref,$create_new_versions_ref) = @args{ qw( old_name new_name create_new_versions ) }; $$old_name_ref =~ s/s/_/g; $$new_name_ref =~ s/s/_/g; return 0; post_rename Called after a rename has been performed. Allows additional actions to occur after node renames. my %args = @_; my ($old_name,$new_name,$node_id) = @args{ qw( old_name new_name node_id ) }; &recalculate_category_listings(); pre_retrieve Called before a retrieve is performed. Allows changes to the parameters used by retrieve. my %args = @_; my ($name_ref,$version_ref) = @args{ qw( node version ) }; return &check_retrive_allowed($$name_ref); TODO: Allow declining of the read. pre_write Called before a write is performed. Allows changes to the parameters used by the write; my %args = @_; my ($node_ref,$content_ref,$metadata_ref) = @args{ qw( node content metadata ) }; $$content_ref =~ s/pub/Pub/g; return 1; post_write Called after a write has been performed. Allows additional actions to occur after node writes. my %args = @_; my ($node,$node_id,$version,$content,$metadata) = @args{ qw( node node_id version content metadata ) }; &log_node_write($node,gmtime); post_delete Called after a delete has been performed. Allows additional actions to occur after node deletions. my %args = @_; my ($node,$node_id,$version) = @args{ qw( node node_id version ) }; &log_node_delete($node,gmtime); DECLINING ACTIONS FROM PRE_ METHODS Note: This functionality is missing for pre_retrieve It is possible for the pre_ methods (eg C<pre_write>) to decline the action. This could be due to an authentication check done by the plugin, due to the content, or whatever else the plugin fancies. There are three possible return values from a pre_ plugin: C<-1> - Deny this action C<0> or C<undef> - I have no opinion C<1> - Allow this action If you have only zeros, the action will be allowed. If you have ones and zeros, it will also be allowed. If you have minus ones and zeros, it will be denied. If you have minus ones, ones and zeros, the sum will be used to decide. For default deny, have one plugin return -1, and another only return 1 if the action is explicity allowed) METHODS
new sub new { my $class = shift; my $self = bless {}, $class; $self->_init if $self->can("_init"); return $self; } Generic contructor, just returns a blessed object. wiki Returns the Wiki::Toolkit object, or "undef" if the "register_plugin" method hasn't been called on a Wiki::Toolkit object yet. datastore Returns the backend store object, or "undef" if the "register_plugin" method hasn't been called on a Wiki::Toolkit object yet. indexer Returns the backend search object, or "undef" if the "register_plugin" method hasn't been called on a Wiki::Toolkit object yet, or if the wiki object had no search object defined. formatter Returns the backend formatter object, or "undef" if the "register_plugin" method hasn't been called on a Wiki::Toolkit object yet. SEE ALSO
Wiki::Toolkit AUTHOR
Kake Pugh (kake@earth.li). COPYRIGHT
Copyright (C) 2003-4 Kake Pugh. All Rights Reserved. Copyright (C) 2006 the Wiki::Toolkit team. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-09-25 Wiki::Toolkit::Plugin(3pm)
All times are GMT -4. The time now is 10:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy