Sponsored Content
Top Forums UNIX for Advanced & Expert Users Renaming all files in a folder Post 302432991 by pseudocoder on Monday 28th of June 2010 07:57:43 AM
Old 06-28-2010
Code:
$ for i in *1234*.max; do
mv -v "$i" "$(echo $i | sed 's/1234/9876/')"
done
green_1234_colour.max -> green_9876_colour.max
red_1234_pen.max -> red_9876_pen.max
yellow1234flower.max -> yellow9876flower.max
$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting error by renaming all the files in a folder

Hi All, I have a folder name as postscript folder and it contains the following postscript files. package1.ps package2.ps package3.ps when i am renaming all the ps files to xps files by using the following command mv /postscript/*.ps /postscript/*.xps Then i am getting the... (4 Replies)
Discussion started by: sunitachoudhury
4 Replies

2. Shell Programming and Scripting

renaming files in a folder

I splited a file into parts, then i wrote a script to convert the format of the file names to this: part1.dat part2.dat but I wonder why part.dat is also created knowing that the k variable starts from 1 rm -f part* $(split -b $1 file.1 part_) set k = 1 for i in $(ls part_*) do mv -f... (1 Reply)
Discussion started by: saman_glorious
1 Replies

3. Shell Programming and Scripting

Renaming multiple files in a folder

Hi , Need help to rename the files in a folder. The .xml needs to be removed from the middle and appended to the end as in the example shown . Example From: TestMessage.xml2010-10-19_20_21_08 TestMessage.xml2010-10-20_20_21_09 TestMessage.xml2010-10-21_20_21_08... (4 Replies)
Discussion started by: sree_chari
4 Replies

4. Shell Programming and Scripting

renaming files or adding a name in the beginning of all files in a folder

Hi All I have a folder that contains hundreds of file with a names 3.msa 4.msa 21.msa 6.msa 345.msa 456.msa 98.msa ... ... ... I need rename each of this file by adding "core_" in the begiining of each file such as core_3.msa core_4.msa core_21.msa (4 Replies)
Discussion started by: Lucky Ali
4 Replies

5. UNIX for Dummies Questions & Answers

Renaming multiple files in a folder

Hi All, I am trying to change the XML filename in a folder to the rootelement in the XML file. Example: TestMsg2010-10-19_20_20_54.xml <?xml version="1.0" encoding="utf-8" ?> <R1Msg TimeStamp="2010-10-19T08:49:08.000000Z> <TestRec> <ID>1000</ID> </TestRec> </R1Msg> Wanted to extract the... (8 Replies)
Discussion started by: sree_chari
8 Replies

6. Shell Programming and Scripting

Help with renaming files in folder

Hello, I want to rename more than 100 files. These files have "?" in there existing file name but I want to rename files to there first part before "?" token. I have tried using for loop but it isn't working so help following is the sample filename and for loop that am trying to use: example of... (3 Replies)
Discussion started by: ls_lrta
3 Replies

7. UNIX for Dummies Questions & Answers

Renaming files in a folder

Hi, Hope someone can help... I'm pretty much new to unix and can only do basic commands. I have an issue where by every day I need to schedule a job to look in a folder with a name format of .IP. will be different each day (when the day is over the folder extension changes), and rename any... (5 Replies)
Discussion started by: Harsharan
5 Replies

8. UNIX for Dummies Questions & Answers

Renaming files in a folder

Hi, I have 1000 *.txt files in a folder and I would like to rename them data1.txt through data1000.txt. The order does not matter or the names of the initial input files. How would I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

9. Shell Programming and Scripting

Renaming files & folder according to the similarities in filenames

hello does someone want to help me for this one ? i want to rename files & a folder according to the similarities in filenames for example : the file with the good name cglogo tougl1953 dgmel bogd 01 -- ttgductoog ggdté gollogtd.ext1the others files needed to be renamed cglogo... (5 Replies)
Discussion started by: mc2z674gj
5 Replies

10. Shell Programming and Scripting

Renaming File Names in a folder/Dir

Hi Team, I'm new to Unix shell scripting . I've the following requirement A folder contains the list of files with the following format ab.name.11.first ab.name.12.second ab.name.13.third ---------- I have to rename the above file to like below ... (6 Replies)
Discussion started by: smile689
6 Replies
mlib_VectorMaximumMag_U8C(3MLIB)			    mediaLib Library Functions				  mlib_VectorMaximumMag_U8C(3MLIB)

NAME
mlib_VectorMaximumMag_U8C, mlib_VectorMaximumMag_S8C, mlib_VectorMaximumMag_S16C, mlib_VectorMaximumMag_S32C, mlib_VectorMaximumMag_F32C, mlib_VectorMaximumMag_D64C - find the first element with the maximum magnitude in a vector SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VectorMaximumMag_U8C(mlib_u8 *max, const mlib_u8 *x, mlib_s32 n); mlib_status mlib_VectorMaximumMag_S8C(mlib_s8 *max, const mlib_s8 *x, mlib_s32 n); mlib_status mlib_VectorMaximumMag_S16C(mlib_s16 *max, const mlib_s16 *x, mlib_s32 n); mlib_status mlib_VectorMaximumMag_S32C(mlib_s32 *max, const mlib_s32 *x, mlib_s32 n); mlib_status mlib_VectorMaximumMag_F32C(mlib_f32 *max, const mlib_f32 *x, mlib_s32 n); mlib_status mlib_VectorMaximumMag_D64C(mlib_d64 *max, const mlib_d64 *x, mlib_s32 n); DESCRIPTION
Each of these functions finds the first element with the maximum magnitude in a complex vector, then puts the real and imaginary parts of it into max[0] and max[1], respectively. PARAMETERS
Each of the functions takes the following arguments: max Pointer to the first element with the maximum magnitude. x Pointer to the first element of the source vector. n Number of elements in the source vector. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VectorMinimumMag_U8C(3MLIB), mlib_MatrixMaximumMag_U8C(3MLIB), mlib_MatrixMinimumMag_U8C(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_VectorMaximumMag_U8C(3MLIB)
All times are GMT -4. The time now is 11:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy