12-04-2012
[SOLVED] Rename multiple files
Hi. I have a large number of files with names like:
t_ 0.20000E-02.dat
There is actually a space after the underscore. These files are numbered numerically, i.e. t_ 0.20000E-02.dat, t_ 0.21000E-02.dat, t_ 0.22000E-02.dat and so on.
What I would like to do is rename such that the file with the lowest numerical value becomes t1.dat, and the one next to it becomes t2.dat and so on.
I think what I have to do is find the number of files in the directory and sort them according to their numerical value. Then I have to do a loop over them to rename them accordingly. But this seems to be quite involved to me. Any ideas?
Thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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)
Discussion started by: luiz_fer10
7 Replies
2. Shell Programming and Scripting
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
... (3 Replies)
Discussion started by: a_dor8
3 Replies
3. UNIX for Dummies Questions & Answers
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)
Discussion started by: a_dor8
4 Replies
4. UNIX for Dummies Questions & Answers
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)
Discussion started by: makikicindy
3 Replies
5. Shell Programming and Scripting
Hi
I need to reanme the multiple file using unix script
I have multiple file
like:
sample_YYYYMMDD.xls
test new_YYYYMMDD.xls
simple_YYYYMMDD.xls
I need to rename this file
sample.xls
testnew.xls
SIMPLE.xls
thanks (8 Replies)
Discussion started by: murari83.ds
8 Replies
6. Shell Programming and Scripting
hello:
I have multiple files with names like: somestring_y2010m01d01
somestring_y2010m01d02
..........
somestring_y2010m12d31
How... (4 Replies)
Discussion started by: sylcam
4 Replies
7. UNIX for Dummies Questions & Answers
Hey guys, I am the definition of a newbie. I am in the process of trying to rip all my dvds onto a new HTPC I setup. While doing this, I am also trying to organize a bunch of other files I already have to proper naming conventions. So far I have just been naming each file separately (I am on a... (4 Replies)
Discussion started by: Ralze34
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I want perl script for the below requirement.
We have lot of files like below name in the directory
750464921-RE-file2.csv
750452173-RE-file1.csv
750385426-RE-file3.csv
750373470-RE-file4.csv
And also we have another file as "Group.csv" in the same directory as per the below format... (9 Replies)
Discussion started by: armsaran
9 Replies
9. Shell Programming and Scripting
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)
Discussion started by: karan8810
5 Replies
10. Shell Programming and Scripting
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
SDPA(1) General Commands Manual SDPA(1)
NAME
SDPA - High-performance software package for SemiDefinite Programs
SYNOPSIS
sdpa DataFile OutputFile [InitialPtFile] [-pt parameters] [-dimacs] [-numThreads numThreads]
sdpa [options] files...
sdpa --version
DESCRIPTION
sdpa - "SDPA (SemiDefinite Programming Algorithm)" is one of the most efficient and stable software packages for solving SDPs based on the
primal-dual interior-point method.
SDP (SemiDefinite Program) is used for financial engineering, machine learning, control theory, sensor network problem, quantum chemistry,
quantum information, combinatorial optimizaiton, polynomial optimization, and so on.
Futher information on SDP and SDPA can be found at
http://sdpa.sourceforge.net/
OPTIONS
---- option type 1 ----
sdpa DataFile OutputFile [InitialPtFile] [-pt parameters] [-dimacs] [-numThreads numThreads]
parameters = 0 default, 1 fast (unstable), 2 slow (stable)
example1-1: sdpa example1.dat example1.result
example1-2: sdpa example1.dat-s example1.result
example1-3: sdpa example1.dat example1.result example1.ini
example1-4: sdpa example1.dat example1.result -pt 2
example1-5: sdpa example1.dat example1.result -dimacs
example1-6: sdpa example1.dat example1.result -numThreads 4
---- option type 2 ----
sdpa [option filename]+
-dd : data dense :: -ds : data sparse
-id : init dense :: -is : init sparse
-o : output :: -p : parameter
-pt : parameters , 0 default, 1 fast (unstable)
2 slow (stable)
example2-1: sdpa -o example1.result -dd example1.dat
example2-2: sdpa -ds example1.dat-s -o example1.result -p param.sdpa
example2-3: sdpa -ds example1.dat-s -o example1.result -pt 2
example2-4: sdpa -ds example1.dat-s -o example1.result -dimacs
example2-5: sdpa -ds example1.dat-s -o example1.result -numThreads 4
---- option type 3 ----
sdpa --version
to print out version and exit.
PARAMETER_FILE
is decided by the following priority
1: The file assigned by '-p' option of 'option type 2'.
For 'option type1', this is skipped.
2: ./param.sdpa
For 'option type2', this is skipped.
3: /usr/share/sdpa/param.sdpa
4: Default parameter
-dimacs
printout dimacs information incurring additional computation cost
-numThreads
number of pthreads for internal computation
AUTHOR
SDPA was written by SDPA Project <sdpa-developers@lists.sourceforge.net>.
This manual page was written by Makoto Yamashita <Makoto.Yamashita@is.titech.ac.jp>.
July 28, 2011 SDPA(1)