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
ADVERTISEMENT
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
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
View Related
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
Jan 8, 2011
What I am attempting to do is rename some television shows into the format that my PVR will understand for the naming convention. I have a script that cleans them up about 95%, now I just cant figure out the last little detail..
For example: NCIS_01.mkv
I think it can be done in sed, but I just figure out how. I need it to be renamed to: NCIS_s01e01.mkv
How can I make sed (or something else) match the last "_" and any numbers after it until the period and then insert text between them reliably?
Depending on the show, it can be something like: This_show_name_243.avi so I need it to be more flexible than I can figure out how to do..
View 6 Replies
View Related
Aug 4, 2011
I have hundreds of MTS and AVI files since 2000 and would like to rename them in the following manner based on the date created: DD-MMM-YYYY HH.MM.SS_X; where X begins at 1 and increments by 1 if there are dublicate date/time stamped videos.
Ex: 19-Nov-2002 08.12.30.avi, 19-Nov-2002 08:13:30_1 and 19-Nov-2002 08:13:30_2
Someone previously wrote the following script for me, and it works great for photos. It uses EXIV2 to get the image date created info. I have tried to understand the script, but am struggling. The video files I have can use the date modified since I have not modified them since I filmed them.
#!/usr/bin/env python
import os
import stat
import pyexiv2
import time
directory = '/home/david/Desktop/test'
[Code].....
View 1 Replies
View Related
Jul 3, 2010
I searched and I found a few threads on this but none answered my question really.I'm using:
Code:
curl www.foo.com | grep '<h2>.*.</h2>'
Basically I want to extract all instances of
Code:
<h2>Blah blah blah</h2>
from the page source, but it's not giving me that, it gives me <h2>.. followed by a loads of other stuff that I don't want. I haven't used wildcards with grep before so I don't really know whether I'm doing it right or not.
View 5 Replies
View Related
Feb 21, 2010
I'm trying to make a shell script, and for part of it I need to search through a file, find the ip in the file, and save ONLY the ip to another file. ( not the entire line that its on ) I understand grep has wildcards, where I could do something like, "grep (...........) traceroute-output for an ip address.
View 3 Replies
View Related
Jun 7, 2010
I notice that on DistroWatch, the descriptions include "debian based", "arch based", etc. For the newbie, is there any practical difference between the different bases, or is it a Coke vs Pepsi type question?
Is a distro based on Debian say, easier for a newbie to learn or work with than say one that is FreeBSD based?
View 9 Replies
View Related
Apr 5, 2010
When you use an IDE and it asks you if you want frame based or dialog based, what is the difference?
View 1 Replies
View Related
Feb 2, 2011
what distro should i use, rpm based or debian based?
View 2 Replies
View Related
Aug 21, 2010
I'm try the use wildcards for file searches in Nautilus (ctrl+s) but using sets and character classes doesn't return any results. For example
[[:upper:]]*
[![:digit]]*
*[[:alpha:]]
[crm]*
Is this kind of notation supported in Ubuntu or do I have something wrong in my syntax.
View 1 Replies
View Related
May 28, 2011
I was wondering is there another way of renaming a file aside from using mv in linux?
For example changing /home/usr/blah.txt to something like -home-usr-blah.txt
View 4 Replies
View Related
Apr 18, 2011
I've got an interesting problem when it comes to wildcard entries in bind. If I put the following in:
qa.express IN A 172.16.0.10
* IN A 172.17.1.156
If I then look up "express.example.com" it doesn't return an answer - it *should* return 172.17.1.156, but it won't unless I put that hostname in specifically. qa.express.example.com resolves as expected.
View 3 Replies
View Related
Dec 18, 2010
What's the easiest way to rename (change the volume label of) a fat16 volume (e.g. on a USB drive) from linux? It seems like mlabel from the mtools package is meant to do this, but the documentation is not geared to rapid assimilation.
View 1 Replies
View Related
Apr 13, 2011
the permission of 'renaming a file' is included in which right: 'read', 'write' or 'execute'
View 1 Replies
View Related
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
Mar 14, 2011
I am trying to rename a list of variables in my script using a second list of variables. I want the variables in the second list to replace the variables in the first list such that the first variable in List 1 is renamed after the first variable in List 2, the second variable in List 1 is renamed after the second variable in List 2, the third variable in List 1 is renamed after the third variable in List 2, and so on.
For example:
I know how to rename each file individually, but would like to run Do Loop which can rename all my output files at once.
View 7 Replies
View Related
Aug 1, 2010
I'm struggling with the Vim find/replace command using wildcards.
I have several, big html files with lots of instances of: <p stuffiwanttoremove>
I've been trying the Vim command: %s/<p *>/<p>/ge
but it doesn't seem to work.
Does anybody know what I'm doing wrong?
I realise there may be alternatives to this (eg a bash script)
View 2 Replies
View Related
Feb 7, 2011
I want to make a keyboard shortcut that runs the following command:
Code:
smplayer /tmp/Flash*
This is to play things as ..... videos etc. in smplayer using vdpau instead of the laggy flashplayer
The wildcard * works in terminals, but not in the command of the shortcut or in the Alt-F2 launcher... Could anyone point me to what I could write instead?
View 1 Replies
View Related
Dec 20, 2010
I've been trying (and trying...) to write this script. I'm a complete newbie on bash scripting. This is what I've come up so far:
Code:
./reading
| Number of characters 48
| + Current: 107_david_guetta_-_missing_you_(feat._novel).mp3
| + Changed: 107_david_guetta-missing_you_(ft._novel).mp3
| + Matched: "(feat._" substitute "(ft._"
| + Morping: "107_david_guetta-missing_you_(feat._novel).mp3" to "107_david_guetta-missing_you_(ft._novel).mp3"
'-[END] ....
View 7 Replies
View Related
Oct 17, 2010
its very easy to rename a flash disk or even a memory card or any storage in windows because all you have to do is right click on the disk and an option is there rename, i have failed to find a way of doing this in linux ubuntu 8.04, but i understand its possible even in the command line, i need to rename my flash disk
View 1 Replies
View Related
Apr 11, 2011
that works to disallow non-owners from renaming the file, but what I wouldlike to do is disallow EVERYONE ( including the owner of the file ) fromediting, moving, or changing the filename once it is created. the only personwho should be able to make those changes is a special user.
View 13 Replies
View Related
Apr 4, 2011
I have a dir (pub_html) with 45 sub dirsand in each there is a file with name file123.html) what command can I use to rename all files with this name in all sub dirs to file456.html ? I'm on opensuse 11.3
View 14 Replies
View Related
Sep 5, 2010
I am trying to clean up a collection of music files, often in windows i receive errors on the collection because some of the files have a "?" question mark in the file name, in windows this is not a valid character for file names. How can i search/find files with a question mark in the name? Each time i try to search for "?" i receive a list of items that match a wildcard search where ? is a wildcard. I want to find file names that actually contain the character "?".
View 2 Replies
View Related
Feb 27, 2010
I am cleaning up some text files to put on a website and am using the find/replace feature of Gedit extensively. The only problem I am having is that I can't find a way to use wildcards. For instance, I want to use the "?" and "*" in the same or similar way you do in bash. I already know that:
Represents a carriage return, and that is great, but I want to do something like: "?." to replace "A.", "B.", "1.", "2." with just plain spaces. The document in question is written in narrative, but has a bunch of outline markers in it, and I want to remove the outline markers.
I tried "escaping" the characters in a similar way as by using "?.", but that didn't work. Google was not very fruitful, and the Gedit help seems to be Gnome help and includes all kinds of useless info (for my problem) about wildcards in other programs.
View 2 Replies
View Related
Feb 4, 2010
We are having 12 windows computers xp which are connected to a linux machine which has samba server installed on it for backup purposes of these 12 windows users. We want the like this , that a user copy a folder from their local machine and paste it to the samba server . but they cannot delete this folder once the backup is there at linux machine.
So this is working fine. But our users are able to Rename the folder they have pasted at linux machine which we dont want . and even they are able to cut and paste files from 1 folder to another folder in the samba server. We just want them to copy a file or folder from their local windows machine and paste to samba server and they can also read it (copy and paste back to their windows computer)whenever they want . but we dont want them to cut and paste within linux machine and rename that file as well.
View 1 Replies
View Related
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
Mar 20, 2011
I messed up the whole thing and the settings. Created some new thing named rhk which I can't remember as it got all messed up and Now I am getting nothing after Linux Mint 10(julia) boots up - no start menu, no panel, no taskbar nothing. I tried to work in the recovery mode and got some(downloaded) 216mb of something(in the repair broken packages). Moreover whenver I have booted in it shows messages like Could not update ICEauthority file /home/rk./.ICEauthority
there is a problem with the configuration server. (usr/lib/libconfig24/gconfsanitycheck2 exited with status 256) The panel encountered a problem while loading "OAFIID: NOME_mintMenu" The panel encountered a problem while loading "OAFIID: GNOME_IndicatorApplet" Naulitis could not create the following reqiured folders: /home/rk/Desktop, /home/rk/. Naulitis Moreover Alt+F2 gives Run application or run with file and nothing seems to be working.
View 2 Replies
View Related
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