Ubuntu :: Use PyRenamer To Identify And Rename Files With Reserved Characters In The File Name / Expression
Aug 2, 2011
I'd like to use pyRenamer to identify and rename files with reserved characters in the file name. The files came from windows where I'm guessing the characters didn't cause problems. For example, I want to replace the ? (question mark), ' (single quote), etc. I tried using the escape () character before the special character in the replace field on the substitutions tab, but for some reason I don't believe that method was identifying the special characters. What is the correct way to identify a special / reserved character within a file name and replace it?
View 1 Replies
ADVERTISEMENT
May 12, 2010
Can't rename, move or delete files or folders that have a foreign character.
Code:
The file or folder /data/down/done/1999 Taraf de Ha-douks does not exist.
Kubuntu Karmic. Fails in konqueror and dolphin.
View 5 Replies
View Related
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
Jan 21, 2011
I want to rename some files in one directory and found the command 'rename' most appropriate.
Changing the file extension is easy since there are lot of examples for this.
But now I want to rename my files like this:
'somePrefix_blablabla.ext' --> '0_blablabla.ext'
'somePrefix_blablablablabla.ext' --> '0_blablablablabla.ext'
I DON'T want an incrementation, just the leading prefix '0_'
correct perl expression syntax for this?
View 2 Replies
View Related
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
Jan 2, 2010
I'm working with javascript and trying to replace all instances of a Roman character in a string with nothing. How do I assign var reg to all Roman characters? In UTF8, capital letter A is U0041 and at the other end, small z is UFF5A.
So, I'd like to do something like:
var reg = u0041 - UFF5A;
str1 = str.replace(reg, '');
I think you get the idea. I have no idea if that can be done. The idea is to take this string (for example): str = make a door-to-door[house-to-house] visit / ring every doorbell." And take out all the Roman characters and define it as str1. And then take out all the Korean characters (u1100-uFFDC) and define it as str2. In fact, a WAY more useful thing to do would be to replace the instance of this: [u1100-uFFDC]+" "+[u0041-UFF5A] with [u1100-uFFDC]+","+[u0041-UFF5A] so that the output would be a .csv file.
View 5 Replies
View Related
Jul 7, 2010
I'm attempting to search through a rather large assortment of html files created in Word using 'save as html'. what I'm trying to do is find and delete these tags (they're causing browsers to display black diamonds with white question marks):
<span style='mso-spacerun:yes'> </span> Tags contain from 1 to 4 spaces between opening and closing. I get positive results from this:
grep <span style='mso-spacerun:yes'> filename.html but once I attempt to tell it to match any number of characters up until the next '>' symbol, it tells me I'm using an invalid regex: grep <span style='mso-spacerun:yes'>[^>]+> filename.html
I've been nose-deep in regex tutorials for the past day or so, and I'm still not understanding why this doesn't work. If I put the pattern (without backslashes) into a separate file and use `grep -f patternfile filename.html`, I get no error but no matches either. So far as I can figure, the above regex boils down to:
Match the string "<span style='mso-spacerun:yes'>", followed by any number of characters that are not a ">", followed by a ">". If someone could tell me where I'm going wrong with this,
View 7 Replies
View Related
Feb 20, 2010
Write a script that will take a list of filenames as arguments and output a count of how many of them are regular files, and how many of them are scripts (if the file is executable, it will be assumed to be a script file)
Counts always come back as 0
View 5 Replies
View Related
Mar 23, 2010
I just installed Fedora12 in a Core i3 machine... everything looks fine, but I have a huge problem... every time I upload a file (using ftp or sftp) some wier characters are included inside the file... for example.
[Code]......
View 6 Replies
View Related
Apr 12, 2010
I'm writing a bash shell script that among various other things will traverse through a directory with hundreds of files and rename those who match a pattern found in a config file. It's expected that only about one in ten files will actually match, and those who don't, will simply just be ignored for this purpose.
This should for instance cause the file "dBase program file December 1987.prg" to be renamed "Clipper source code December 1987.prg", and conversely "C++ source August 1996.cpp" to be renamed "C source code August 1996.cpp" etc.A sample file such as "Random Data File.dat" should not be renamed here since it's not mentioned in the config file..What is the quickest, most elegant way to do this in bash?I am thinking of using bash's built-in regex matching combined with the /bin/rename utility, but don't quite know how to get started to catch this..I guess there are plenty ways of doing this in perl and elsewhere as well, but since this has to integrate into a pre-existing bash script, that's what I'm looking for.Anyone out there with a spare moment to offer a hint in the right direction?
View 14 Replies
View Related
Jul 8, 2011
What command could I use in terminal to delete all ASCII characters? That is, delete a-z, A-Z, 0-9, and all punctuation? I have a file containing Chinese characters, and I want to remove everything else and leave just the Chinese.
I can use grep to leave only the lines that have Chinese in them, but this still leaves a lot of non-Chinese stuff on those lines. Does anyone know how I could actually remove everything that isn't Chinese?
View 4 Replies
View Related
Jun 18, 2011
I am trying to hide some folders in Ubuntu Linux which are always hidden in Windows through File/Folder Attributes (attrib -h)
It is not an option for me to rename the folder from let's say "Ancient texts directory" to ".Ancient Texts Directory" because the programs associated with these files and shortcuts will not work in Windows. I would like to make the folder hidden by not renaming the folder. Is that so hard to ask?
Is there really no other way of making a folder or a file hidden in Linux just like in Windows by Applying Attributes? I Don't want to rename it by putting a dot in front of it. Moreover renaming a file by putting a dot in front of the name changes the position the folder appears in the list view. For some people this may be ridiculous, but for me with a few hundred files and folders and subfolders, this organisation is important, aside from the aforementioned reasons.
I need to maintain compatibility between the two operating systems' basic folder structure as i must use both Operating systems.
View 9 Replies
View Related
Oct 6, 2010
I want to translate this .fdi clause
Quote:
<match key="info.product" string="PS/2 Generic Mouse">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>[code].....
into its Xorg equivalent. What does it look like?
View 1 Replies
View Related
Jan 12, 2011
I have bought an external usb hard drive on which I back up my three computers every once in a while.Space will quickly be used up.I can't find that little bit of research that I need yesterday.Here is what I would like to find:An application that eliminates doubles in identical files and renames files that have changed by appending the last saved date yyyymmdd to the file name.Does such an application already exist?
View 6 Replies
View Related
May 7, 2009
Until now i haven't had to dabble with bash scripts.
I have a program that reads in data files. These are named datafile01_R, datafile01_G, datafile01_B, they then increment, so datafile02_R etc i have about 600 of these. the program reads in 3 data sets at a time from each run, so files_01 r, g, and b.
The program then does its magic, and outputs about 40 different files, depending on the file, they gone to folders named R, G, B, psa, or tracking.
The program itself has configuration files to say where the files should gone when analyzed, there is also the config files that reads in the data sets.
At the moment i have to run one set of data, then go in and manually change the input file location, and run again. But, doing this, even though a different data set, the new set overwrites the old set in one of the output folders. So i need a way to increment the output filenames after they are written and before the program is run again with the new data set.
View 1 Replies
View Related
Mar 18, 2010
I have been battling with regular expressions and am a little lost. I want to find all my files that end with .la and have been trying this
Code:
slocate -r .la$
which finds them but also files like mozilla. The escaped full stop seems to be ignored however this works :
Code:
slocate -r \.la$
so why is the double escaping needed ?
View 3 Replies
View Related
Jun 29, 2010
I am trying to write a script to edit text files formatted like this:
Code:
(MCAL@Contig766:0.30207,CGIG@CVIR_Contig1014:0.13977,(HASI@HDIS_Contig573:0.16828,(CAPI@LCIN_5594371:0.36581,CFOR@FQH745302RIQ7Y:1.91244)0.160:0.00019)0.939:0.15648);
There are never line breaks or spaces in the actual files.
I want to delete all instances of the character "@" and everything between it and the next "," (including that comma) or the next ")" (including that close parentheses) whichever comes first. My desired output file would be like this:
Code:
(MCAL,CGIG,(HASI,(CAPI,CFOR)0.160:0.00019)0.939:0.15648);
I figured out how to do this using sed for either "," or ")" but both looking for whichever comes first.
View 6 Replies
View Related
Feb 13, 2011
I'm using Ubuntu for about a half year. Currently version 10.10. The next problem I have with Nautilus: He have it in ListView. If I want to rename a file then the entire file is selected and not only the first part. So the file extension is also selected. I think this is a bug, whoich can be found on the Internet, but I do not find a solution. Does anyone here have a solution?
View 4 Replies
View Related
May 19, 2010
I have a very, very large log file (360MB) that I'm trying to thin out. As it turns out the majority of this file has entries that aren't necessary so I'm attempting to build a command that will strip these out. The following command works to display only the data that I do not want:
Code:
cat xml_results.log | grep -B 6 -A 5 "YYY ZZZ"
This displays exactly the data I want to delete from the file by displaying the expression and six lines above it and five lines below it. However I'm at a loss as to how to remove this data from the output and display everything else. I looked into the -v option with grep redirecting the output to a new file:
Code:
cat xml_results.log | grep -B 6 -A 5 -v "YYY ZZZ" > xml_filtered_results.log
However it doesn't work, the new file is the same size as the old one. What am I doing wrong? Is there a better method of doing this? I'm a bit out of my element since the method I'd normally use can't handle files of this size.
View 7 Replies
View Related
Feb 5, 2010
I have two hard drives, sda and sdb. Windows resides on one and Linux on the other. Before I reinstall Linux from scratch, I want to make sure I know which is which so that I don't end up erasing my windows drive. How can I identify which files/directories are sitting on each drive? I.e. how do I find out the mount points of /dev/sda/ and /dev/sdb/?
View 9 Replies
View Related
Jul 8, 2011
Im trying to auto rename badly named mp3's using info from the id3 tag. I got a nice little program called id3ren, it works fine apart from it doesn't add the track number. Cant figure how to enable this function. The track numbers are in the ID3, but it just renames to Artist/Trackname. Any other users on here?
View 9 Replies
View Related
May 16, 2011
I have to create a script to identify those users who have un-sanctioned (forbidden) files in their home directory. I tried something like this (this is a try and I need some opinions):
Code: #!/bin/bash
user_belongs() {
if `groups $var1 | grep $var2`
then
return 0 else
return 1
fi
} .....
View 1 Replies
View Related
May 18, 2011
I have iomega appliance, which is based on Debian distribution. There is an NFS share that I have created which is without password.Since it is without password, there are some viruses copied. I want to find out which IP address is the source of these files. In other words, I want to know which PC is copying these infected files on the NFS share.
View 3 Replies
View Related
May 11, 2010
I used a script that renamed my file eg 'echo webutil.olb | tr [A-Z] [a-z]' i wanted to rename it back to webutil.olb. How do i do this for many other files that i have
View 3 Replies
View Related
Oct 14, 2010
I have this script:
Quote:
for f in d*; do mv "$f" "T${f#d}"; done
it outputs all files which strats with letter d to T but it doesn't work when i run it from Cron. It only affect root file / .
How i can make work like this:
/home/user/files/dfile.txt
=>
/home/user/files/Tfile.txt
View 2 Replies
View Related
Nov 8, 2010
I guess the title says it all. I'm looking for a program that will rename a massive amount of files at once. JPGs specifically, or PNGs. More specifically,I'm creating a stopmotion movie. Using the program StopMotion. And for that, all you pictures, or frames, have to be named 001.jpg 002.jpg and so on. I've got about 300 or so images, and they're all named the default thing that my camera names them, you know, like DSCIM8520 or whatever. I'm looking for maybe a command line program or GUI is fine too, that will do this for me.
View 3 Replies
View Related
Dec 31, 2010
I have many files in a directory. They all have names with a .pdf extension. How can I remane all of them so that they are named as so... 1.pdf, 2.pdf, 3.pdf? I want to do it with one command or somehow that I do not have to manually rename each one.
View 1 Replies
View Related
Jan 12, 2011
I need to find and rename all .JPG files to .jpg in a folder with subfolders. How would I go about this?
View 1 Replies
View Related
Jul 11, 2011
The music files as named like the following: 01 Music Title. I would like to get them as: Band Name - Music Title. I looked into the rename command and I was thinking of doing something like this:
Code:
rename "s/(the first two integers)/Band Name -/g" *.mp3
The problem is that I don't know how to indicate the first two integers. Does anyone know how to do this?
View 2 Replies
View Related
May 28, 2010
I'm trying to math all class references in a C++ file using grep with regular expression. I'm trying to know if a specific include is usuless or not, so I have to know if there is a refence in cpp. I wrote this RE that searches for a reference from class ABCZ, but unfortunately it isn't working as I espected:
grep -E '^[^(/*)(//)].*[^a-zA-Z]ABCZ[]*[*(<:;,{& ]'
^[^(/*)(//)] don't math comments in the begging of the line ( // or /* )
.* followed by any character
[code]....
Well, I can get patterns like this:
class Test: public ABCZ{
class Test: public ABCZ {
class Test : public ABCZ<T>
[code]....
View 4 Replies
View Related