Hello,
I want to rename multiple files at a time and I don't know how to do it.
I have various ".mp3" files, like "band name - music name.mp3" and I want to remove the "band name" from all files.
Anybody knows how to do it using shell script or sed or even perl?
Thanks (7 Replies)
Hi,
can anyone have a ksh script to rename multiple files (ie to remove .Z extension of the files)
can someone correct this?
for i in *.Z
do
var1 = substr($i, 1,at(".Z",$i)-1)
mv $i $var1
done
Thanks..
Antony (13 Replies)
I have several hundred files in one directory which I need to move to another directory with the new extension, for example:
/bb/data/rptmgr* are in the source directory need to be moved to
/bb/data55/rptmgr*.new
Is there an efficient way to do it? Thanks -A (4 Replies)
Hi all, I have some files like:
pickup.0000043200.t001.t001.data
pickup.0000043200.t001.t002.data
pickup.0000043200.t002.t001.data
pickup.0000043200.t002.t002.data
pickup.0000043200.t003.t001.data
pickup.0000043200.t003.t002.data
I need to rename these files to
... (4 Replies)
Hi everyone,
I'm very green in Linux.
Please help me to solve my problem.
I have thousands of files and I want to change their names.
They have naming convection: prefix_date_date+1_suffix.nc
prefix: ext-GLORY
date_date+1: 20020101_20020102
and two types of suffix: gridV_R20020130 and... (3 Replies)
Hi,
In my directory I have many files, for e.g.
file_123
file_124
file_125
file_126
file_127
Instead of renaming these files one by one, I would like to rename them at a same time using same command... they should appear like
123
124
125
126
127
What command(awk or ls or... (3 Replies)
Hi,
I have hundreds of files with XXX in their file name and I want to rename all of them with YYY in place of XXX.
for ex:
$ ls -1
123XXX789
345XXX678
Output
$ ls -1
123YYY789
345YYY678
I know we can loop in each file and sed to replace and rename each file but ren *XXX* *YYY*... (4 Replies)
I have multiple files in folder which i want to rename. hence I am using the below command in my script by I get an error:
export XXX_LOG_DIR="${LOG_DIR}/${XXX_HOST}/xxx/${REPORT_DATE}"
mv $XXX_LOG_DIR/*.audit.gz $XXX_LOG_DIR/*.audit.log.gz
But I get the below error:
mv: target... (5 Replies)
Hey guys,
I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output)
#!/bin/bash -l
#SBATCH -p node
#SBATCH -A <projectID>
#SBATCH -n 16
#SBATCH -t 7-00:00:00
#SBATCH --mem=128GB
#SBATCH --mail-type=ALL... (1 Reply)
Discussion started by: @man
1 Replies
LEARN ABOUT DEBIAN
io::async::routine
IO::Async::Routine(3pm) User Contributed Perl Documentation IO::Async::Routine(3pm)NAME
"IO::Async::Routine" - execute code in an independent sub-process
SYNOPSIS
use IO::Async::Routine;
use IO::Async::Channel;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $nums_ch = IO::Async::Channel->new;
my $ret_ch = IO::Async::Channel->new;
my $routine = IO::Async::Routine->new(
channels_in => [ $nums_ch ],
channels_out => [ $ret_ch ],
code => sub {
my @nums = @{ $nums_ch->recv };
my $ret = 0; $ret += $_ for @nums;
# Can only send references
$ret_ch->send( $ret );
},
on_finish => sub {
say "The routine aborted early - $_[-1]";
$loop->stop;
},
);
$loop->add( $routine );
$nums_ch->send( [ 10, 20, 30 ] );
$ret_ch->recv(
on_recv => sub {
my ( $ch, $totalref ) = @_;
say "The total of 10, 20, 30 is: $$totalref";
$loop->stop;
}
);
$loop->run;
DESCRIPTION
This subclass of IO::Async::Process contains a body of code and executes it in a sub-process, allowing it to act independently of the main
program. Once set up, all communication with the code happens by values passed into or out of the Routine via IO::Async::Channel objects.
Because the code running inside the Routine runs within its own process, it is isolated from the rest of the program, in terms of memory,
CPU time, and other resources, and perhaps most importantly in terms of control flow. The code contained within the Routine is free to make
blocking calls without stalling the rest of the program. This makes it useful for using existing code which has no option not to block
within an "IO::Async"-based program.
To create asynchronous wrappers of functions that return a value based only on their arguments, and do not generally maintain state within
the process it may be more convenient to use an IO::Async::Function instead, which uses an "IO::Async::Routine" to contain the body of the
function and manages the Channels itself.
PARAMETERS
The following named parameters may be passed to "new" or "configure":
channels_in => ARRAY of IO::Async::Channel
ARRAY reference of "IO::Async::Channel" objects to set up for passing values in to the Routine.
channels_out => ARRAY of IO::Async::Channel
ARRAY reference of "IO::Async::Channel" objects to set up for passing values out of the Routine.
code => CODE
CODE reference to the body of the Routine, to execute once the channels are set up.
METHODS
This class provides no additional methods, other than those provided by IO::Async::Process.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Routine(3pm)