General :: Renaming Files In Batch With Unix RENAME?

Mar 6, 2011

I have files whose names look like this:Sim1-2_40.36.chr20_sb.foo.indel.novoalign.samSim1-2_40.36.chr20_sb.foo.indel.bwa.samWhat I want to do is to replace all indel with snp in the namesyieldingSim1-2_40.36.chr20_sb.foo.snp.novoalign.samSim1-2_40.36.chr20_sb.foo.snp.bwa.samBut why this unix command doesn't work

View 4 Replies


ADVERTISEMENT

General :: Batch Renaming Of Files In A Directory Using Sed

Dec 11, 2010

I run a script which generated about 10k files in a directory. I just discovered that there is a bug in the script which causes some filenames to have a carriage return (presumably a '' character).

I want to run a sed command to remove the carriage return from the filenames.

Anyone knows which params to pass to sed to clean up the filenames in the manner described?

I am running on Linux (Ubuntu)

The character causing the filename to 'break up' accross multiple lines appear to be a CR (carriage return) instead of ' '. The filename is being diaplayed in thetitle of a text editor with %0D in the positions of where the file name breaks up. So I need to remove the CR chars from my filenames.

View 1 Replies View Related

General :: Renaming Multiple Files In Batch Process

Feb 21, 2010

I have some random files in a folder. I want to rename all of the files in a batch process. I have a text file that contains the Currentname of all the files in the folder, as well as a text file with all of the Newname of files in the folder. I want to replace Currentnames with Newnames.

For example, here are the names of the files in the folder:
1.mp4
2.mp4
3.mp4

I have a text file with the Currentname of all the files in the folder:
1.mp4
2.mp4
3.mp4

I have a text file with the proper Newname of the file:
a.mp4
b.mp4
c.mp4

I want to rename Currentname with Newname in the folder. So when I go to the folder the Newname of the files are:
a.mp4
b.mp4
c.mp4

View 14 Replies View Related

General :: Windows - How To Batch Rename Files With A Random Name

Jun 30, 2011

I have a bunch of photos with varying names. I want to give each photo a random name(*), how do I do that? (*)I'm going to put them on a digital photo-frame that can't shuffle

View 4 Replies View Related

OpenSUSE Install :: Batch Rename Files With Special Characters?

Dec 10, 2010

I have about 300 files that need renaming, because the file system does not display the French characters properly. The dodgy letter in question has been replaced by a "question mark in a black diamond" symbol.No way of renaming, other then using mv in the Konsole has worked. Is there any way, script or program out there, that will do a batch rename?

View 9 Replies View Related

Ubuntu :: Mega Batch Files To Rename - Includes Sub Folders

Oct 20, 2010

I have quite a few sound sample files totaling over 4 gigs in size with around 80 root folders and then around 34 sub folders. i have a total of 13 DVD's in the above format. how do i "change the date" on all files in one go is that possible?

View 3 Replies View Related

Ubuntu :: Rename A List Of Files In Batch In Order To Maintain The Last Part Of Them?

Dec 1, 2010

possible to rename a list of files in batch in order to maintain the last part of them, then purge a central section and then again maintain the extension?I.E.:

Code:
file01.qwertyuiop.txt
file02.asdfghjklmnbvzxcqwertyuiop.txt

[code]....

View 7 Replies View Related

General :: Batch Renaming Based On Wildcards?

Jul 20, 2010

Is there a way to do a batch renames of files that will keep each individual filename, but change it in the way I want?

The specific issue is this. I have a harddrive with something like 1300 movies on it. They're all organized alphabetically, but there are like 200 movies that begin with 'The'. I want to rename all of these movies that begin with The so that the The at the beginning is dropped and added at the end (for example, turn "The Shawshank Redemption" into "Shawshank Redemption, The"). I'd like to do this with a simple command if its possible.

View 2 Replies View Related

Ubuntu :: How To Batch Rename Directories

Dec 6, 2010

I have several folders:
Archive_001
Archive_002
Archive_003
etc.

Is there any command to batch rename these directories to:
NewArchive_001
NewArchive_002
NewArchive_003

View 2 Replies View Related

Software :: Rename Hidden Files / Rename All Files With A Leading Decimal Point Recursivley?

Jul 25, 2011

How would I rename all files with a leading decimal point recursivley? I some how got all my music files to have a decimal point.I tried the below and got a " sed argument to long".[CODE]find /media/MUSIC -type f -name "*.wma" | xargs -0 sed -i 's/.(.*)/1/'[CODE]

Another question, can i just use -type f with out -name ? I am sure that all the files got the decimal point added as the first character.

View 14 Replies View Related

OpenSUSE :: Renaming Long Filenames - Rename Command Not Working

Aug 9, 2010

I misused wildcards like a moron, in the rename command. I repeated names twice in a 3gig folder, which I cannot afford to delete. Now, the rename command is not working, and it says the file name is too long. I am a competent programmer in Java, PHP, and I know basic C.

View 7 Replies View Related

Software :: DigiKam: Pictures Disappear After Using Batch Rename?

Jan 17, 2010

I selected 10 photos and used the batch rename feature (Batch -> Rename Images). Once I had the settings set and accepted the changes, the tool successfully renamed all 10 photos. The problem is I can't see them in digiKam anymore. It's just an empty album. When I navigated to the folder using Dolphin, all the pictures were still there and they were properly renamed. Back in digiKam, it's just an empty folder. I tried moving the photos to a different directory and then adding that folder to digiKam, but it still showed up as an empty folder.

I don't know what to do. How can I get this app to see my pictures again?

View 4 Replies View Related

Programming :: Batch File To Run Unix Commands From Windows?

Nov 22, 2010

I need to write a windows batch file to run unix commands by logging onto a telnet unix server. For example , I might want the batch file to log onto the unix sever, run the ls command, collect the output in a file and ftp it back to my windows desktop

View 8 Replies View Related

Programming :: Write A Batch File For Windows That Starts Cygwin Tool And Runs Unix Scripts?

Nov 17, 2008

I need to write a batch file for windows that automatically starts the cygwin tool in windows and executes the unix scripts.Previously we had these scripts in unix server.Now we need to migrate them to Windows server.For this reason we are using cygwin tool that allows the scripts to be executed on Windows server.We had written a batch file that starts the cygwin tool,but we were not able to execute the unix scripts.How can we write a batch file such that it executes all the unix scripts in cygwin.

View 5 Replies View Related

General :: What's The Command For Renaming Files

Jun 8, 2010

What's the command for renaming files? I thought it was "mv"--I typed "info" and read

Quote:

* mv: (coreutils)mv invocation. Rename files. So, desiring to give a .JPG extension to a jpeg file that had no extension (because I dug it out of my Firefox cache), I typed

Quote:

mv '/home/josh/Desktop/Natalie pictures/DEC8FFA5d01' *.jpg

That didn't rename the file; it made the file disappear from its folder. What did I do wrong?

View 6 Replies View Related

General :: Code For Renaming Files With Prefix In Subfolders?

Feb 12, 2011

I want to rename files in multiple subfolders with a prefix (e.g., rename "file.tif" with "prefix_file.tif") and not have to be in the subfolder.

code: for f in /path/to/*; do echo mv "$f" "PRE_$f"; done

gives you this: mv /path/to/file1 PRE_/path/to/file1

instead I want this: mv /path/to/file1 /path/to/PRE_file1

View 3 Replies View Related

General :: Renaming Multiple Files Caused By Dropbox

Jul 20, 2011

Recently I installed Dropbox on a server to do file synchronization and it added " (Case Conflict 1)" to a whole bunch of my files! I realize now that it was caused by case insensitivity but I'm still left with hundreds of files that are in this renamed state. Is there a script in Linux that would allow me to recursively go through the directories and strip out this string?

i.e.
a (Case Conflict 1).jpg --> a.jpg
/myfolder/abc (Case Conflict 1).doc --> /myfolder/abc.doc
/myfolder/subfolder/mydoc (Case Conflict 1).pdf --> /myfolder/subfolder/mydoc.pdf

View 2 Replies View Related

General :: Copying And Renaming Multiple Files In Working Dir

Apr 8, 2010

How can I copy multiple files, each with a slightly different name from the SOURCE in the same directory?

Example: '/home/junk' contains A.txt, B.txt

I want to copy /home/junk/A.txt to /home/junk/A1.txt and /home/junk/B.txt to /home/junk/B1.txt using a single command.

View 11 Replies View Related

General :: Renaming A Bunch Of Files Using For-structure And The Mv Command?

Feb 3, 2010

Basically I need to rename a bunch of .doc files using the for-structure and the mv command (w/ wildcards) in bash. I guess this would be a bit easier if I'd use the rename command, but since this is a school assignment of sorts I need to use for & mv. The .doc files are named "1filename.doc", "2filename.doc" etc. And I've got to rename them to "aaa_1filename.doc", "aaa_2filename.doc", "aaa_3filename.doc" and so on. Tried to dabble quite a bit with the for and mv commands, basically just got a bunch of errors. Every damn time. For 2 hours. The most common error was "mv: missing destination file operand after ..."

View 6 Replies View Related

General :: Renaming External Files Changing Ownership Instead Of Root

Mar 28, 2011

i have inherited a mixed bag of sorts: several xp users updating an access mdb with the BE on a lamp stack shared via samba. i have a backup device which gets mounted at: /media/disk... each client record (has) a folder by the companyname on the samba share, and all relative documents are placed there. when the backup script runs, it just copies newer or missing files.

someone has been renaming folders, and not matching the folder name to the related companyname from the mdb. so...the backup script captures and duplicates the data in the renamed folders. some client records also have periods in the name (not required from a data pov), such as 'Company Ltd.' instead of 'Company Ltd'. i can produce a list of company names as the folders should be found easily enough, but get a little stuck with the linux scripting.

i can easily remove and further prevent any unwanted punctuation in the company name on the client record, and create the correct folder name on the samba share with vba, but would also like to:

-for each 'client activity' folder on the backup device
-rename the folder by removing punctuation marks
or
-delete the folder if is a dupe

i tried: ls -al | grep '&' - it properly returns only those lines with an ampersand in the folder name, but returns all folders when i try that with a '.'.

what would be the easiest method to do the renaming? i thought if there was a way to change ownership of the mounted device, then the vba code (easy to write) would be simple.

OK - i just ran chown -R on the external device, changing ownership to (me) instead of root. didn't want to because it took too long, but can now use the MoveFolder method of the filesystemobject from my app to do the renaming instead of some sort of bash script (which i was dreading).

View 1 Replies View Related

General :: Renaming Files With Sed - Mv: Missing Destination File Operand After `$i'

Mar 20, 2011

Today i am trying to learn how to use sed. I set up a testing folder with the following files:

AAb.lol
AAc.lol
AAx.lol
test.sh

My goal is to create a script (test.sh) which renames all the files to their original name without AA. I want to end up with this:

b.lol
c.lol
x.lol
test.sh

sed seemed to be the perfect tool so i went ahead and created a script which i think should clear the job.

[Code].........

mv: missing destination file operand after `$i' From that 2nd line i can tell that $NewName is just empty. I also read something about sed needing the -e option for scripting purposes but i just don't understand it.

View 7 Replies View Related

General :: How To Rename Files

Oct 20, 2010

I need help with renaming files and folders in one go.
I have a folder called /opt/utility/pictures/
Inside that folder have sub-folders and files such as code...

View 6 Replies View Related

General :: Ssh Command To Rename Files?

Dec 22, 2009

What is the ssh commands to rename a group of files?

I need to rename:
avatar_01.jpg
avatar_02.jpg

[code]....

View 5 Replies View Related

General :: Script To Rename Files Recursively?

May 8, 2011

I'm planning to writing a script to rename files recursively.

To be said that I'm using /bin/sh (not /bin/bash) as this is the only shell available on the busybox of the linux router (tomato) I'm using.

Basically I would like to rename files with extension .jpg using as a suffix the filename of another file in the very same directory with extension .avi

The reason for this is because pretty much all the DLNA devices like modern TV playing .avi files will display a thumbnail of the video when browsing the filesystem, however to do so they'll need .jpg image wit hthe same filename of the video in the very same directory.

View 3 Replies View Related

General :: Make A Script To Rename All The Files?

Feb 10, 2010

I'm currently trying to make a script to rename all the files with one provided file extension to a second provided file extension. I've achieved this by commanding "sh newext doc txt" with the following which works perfectly:

#!/bin/sh
for f in *$1;
do
mv "$f" "`basename "$f" $1`$2";
done;

However, I'd like to be able to modify what I've written so far, so that I can choose whether to convert file extensions in a subdirectory or not. For example, I could enter "sh newext -r doc txt" and the subdirectory's files would also be affected by my script, or enter "sh newext -n doc txt" which would only affect the directory I'm in.

View 4 Replies View Related

General :: Script: Rename Files By Using Cksum?

Nov 6, 2010

I have to do a very simple task but being a newbie, its becoming a challenge Here is what I have to do:1. I have a bunch of *.html files most of them are duplicates: file1.html, file6.html and file12.html could be duplicates.2. I have to eliminates the duplicates by using the cksum and rename the files by using the sum™ value (sum.html)Something like:

$ cksum file1.html
339238769 1918 file1.html
$ mv file1.html 339238769.html

[code]...

View 8 Replies View Related

General :: Script To Rename Files According To Filetype?

Jan 21, 2010

I get a bit lazy using cUrl, often letting downloads go without adding the proper extension to images and whatnot. Yes I know about the -O flag, but I'm the kind who likes to give my files unique names right off the bat (until they puzzle out a way to "stamp" files with originating URLs across platforms, Classic MacOS Web-browser style, curl -o is the way to go). So I was hoping someone could help me write a script (bash or python, doesn't matter which) that used the file command to look inside files in a single directory and then rename the ones it happened across that didn't have a 3- or 4-letter extension, appending the one that corresponded with the mime type. But this action only to be performed on files with no extension.

I know Linux and Unix don't bother much with extensions. I started home computing on a Mac IIcx -- that kind of intuition is beyond natural for me and very much appreciated. But I, and a few of my friends and family, alsose Windows where file extensions are an idiot-proof way, if nothing else good can be said about the two, to get file X to open in application Y and not Q, W or Z (or, worse for some, no application at all).I've seen a few scripts in different places, but they all seem to have the flaw of renaming files that already have an extension

View 14 Replies View Related

General :: Compare 2 Files In Unix?

Aug 9, 2011

file 1 :

DB_NAME FIRST_ACTIVE_LOG DBPARTITIONNUM
-------- -------------------- --------------
BP1 279231 0
BP1 12735 1
BP1 12734 2
BP1 12735 3
BP1 12616 4

[Code]...

View 4 Replies View Related

General :: Can't Rename/move Files From OSX That Were Copied From NTFS

Jun 29, 2010

I recently had data recovered and it was sent back to me on what I think is an NTFS drive. I copied all the files over to a file share I have on a Linux box, that's ext4. Now I have that share mounted on my OSX machine, and I can't move or rename most of the files. However, in a couple cases I was able to rename a folder after the third try. Another time I was able to rename a folder once, but not again. All the permissions are showing up the same on the command-line -- I can't see any differences between the permissions on any of the files/folders. Note that I can create new folders and add files no problem, and then rename and move those all I want.

View 5 Replies View Related

General :: Script To Mass Rename Files Recursively?

Sep 9, 2009

I need a either a script or perl script that will allow me to mass rename files, folders, and sub folders. I need to replace special chars in the current file names with underscores. I was able to make this happen in a single directory, but not recursively.

Here is what does it in a single directory.

for file in *
do
mv "$file" $(echo "$file" | sed 's/[^A-Za-z0-9_.]/_/g')
done

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved