Programming :: Script That Change The Names Of Files And Folders Into Small Letter?
Oct 2, 2009
i want to make a script that change the names of files and folders into small letter because they are all in capital and more than 1000 fileit is impossible to do that with my hand
I'm about to move a lot of folders from an older computer (sarge/etch) over to a newer with Lenny. But I get problems when I reach folders or files with names that contains nordic letters like øå. I'm using an external drive to move the folders. What is the easiest and best way to do this.
I have a bunch of files on a Ubuntu box, which have various characters in their filenames that Windows doesn't accept (mostly ":" and "*", but possibly others).What's the simplest way to get these all renamed and moved to a Windows machine? It's OK to replace these characters with something like "[colon]" and "[asterisk]".
I have a file like below. For all the lines (except for the ones listed as 'Unknown Owner' and N/A') I would like to change to lower case and concatenate the first and last names.Before:
Code: aaa.bbb.ccc.ddd,Unknown Owner ddd.eee.fff.ggg,N/A hhh.iii.jjj.kkk,John Doe aaa.bbb.ccc.ddd,Mary Jane
I am trying to write a loop to open four main-data-files. At each open of the main-data-file, I want the loop to open another four sub-files and split the data from the mail-data-file according to the creteria and dump into the four files. When the loop goes to the second main-data-file, it shall generate another 4 sub-files with different file name. And the process goes on. That means I will have total of 16 sub files for the four main-data-files. Each four files from the 16 files shall have specific name on it. Based on the code which I given below, I would say when the file at UNIT=100 is opened, 4 new files needed to be opened as well. They are:
My issue is I can't handle the files with spaces in their name, I've donde the below script to print each file found inside folder and subbfolders with "find".
I would like to "ls" to each file found with its complete path and with its basename too.
Code: files=$(find . -type f) for each in "$files" do ls -l "$each" # 1rst option I've tried to list with full path ls -l "$(/bin/echo "$each")" # 2nd option I've tried to list with full path ls -l "$(/bin/echo $(basename "$each"))" # 1nd option I've tried to list with it basename
[Code].....
How can I list "ls -l" in both cases (with full path and with basename) when there are files with spaces in their name?
The problem I have is that I need to replace a more complex string, like this: Old string: /mnt/stor6-wc2-dfw1/627896/982574/ New string: /mnt/stor8-wc2-dfw1/369587/302589/ There I don't know how to do it... since the / is what separates the old from the new strings, and the strings that I want to replace have / in it. Also, I would like to know how to specify under what folder replace the files, for example, I want that it search/replaces all files under /var/www/mysite/htdocs folder.
I've been using Ubuntu for over 5 years. This time I decided to upgrade UNR to the latest 10.10. I am now running it from USB to try it before installing. Excuse my ignorance, but whatever happened to the Terminal? I cannot find it anywhere! I think this release is not going in the right direction if one of the most important tools in Ubuntu is hidden from an average user.
Also, how do I change to the root directory in the files and folders? or at least to the higher directory structure.I won't be installing UNR 10.10 unless I figure out these BASIC things.
I've just read that I can't change the file permissions of files and folders if they are sitting in what was my old Windows D: drive. Is this correct? If so what is the work-around?
I don't want to have to cut and paste that entire D: drive's contents over to a recognised Ubuntu folder. I had in my mind that this D drive would continue to be my data dumping ground, to which I need read/write access to.
lets say I have a project that have generated lots of xml files. Though all these xml files point to a location with the text name TEXT15. I want to change all the files that containts TEXT15 and change it to TEXT16. This actually works for files in a folder but not recursively in all the entire files....perl -pi -c 's/TEXT15/TEXT16/g' ./* but I have many subfolders and within this more subsub folders....i just want to do this recursively.
I know their are several threads pre-taining to keyboard remapping, I own a Toshiba X205 S7483 laptop running Ubuntu 10.10 32 bit with the latest updates installed. I like this os overall but here is my question.
My laptop keyboard letter, "b" has broke and Im copying and pasting when I need to use it. Is there a way how I can change either the assigned b letter key to like one of the alt keys or windows menu keys or fn key?
I have encountered a problem:I have "while" loop; at each run a set of outputs is produced but then I need to shift them into a corresponding folder ; otherwise next run the new outputs will be over-written. Furthermore, I need to pipe what I have on the screen inside a file. I have put my code in the following:
Way to test permissions on all files/folders into a folder recursive, then if those are not user:user then do :
Code: chown user:user thatconcernedfile
The problem with that
Code: chown user:user -R /folder
is that it is doing changes on file permissions whihch are already ok. If you wanna maintain a specific permission on a folder this is really not good this :
Code: while [ 1 ] ; do chown user:user -R /folder # /folder contains 6.0 Tb sleep 2s done
Using C++, I want to process sub-folders on my home folder sequentially each with a special naming format and containing some binary files in it:
Code: 1/ 2/ 3/ 4/ 5/ 6/ ...
Give above folders, I will process files in 1/ at first, 2/ at second, 3/ at third, and so on.
For some n/ folder, if I realize that n/ actually does not exist in local file system, I do not want to wait for it. Hence I will keep processing (n+1)/ folder, and so on.
However, when processing some (n+m)/ folder, previously not processed n/ folder may have been created on local file system. In this case, I do not want to miss processing it, but somehow detect its creation and process it. After processing n/ folder, I want to continue from (n+m+1)/.
When I used windows as my media server I had a program called SCRU (Scene release unpacker - [URL] that could unpack and move my downloads to folders based on their names. Is there something like that for linux?
Any script to categorize folders with similar name into one directory. For example: There are 4 directories named LinuxFedora, LinuxUbuntu, WindowsXP and Windows7. The script should be able to create two folder named Linux and Windows wheree respective directories are moved.
Next example: If there are many folder as below: DevLys 010 DevLys 010
I have a string such as "helLo wOrlD". I'd like to transform this into "Hello World", ie. capitalise the first letter of every word, and transform the rest into small letters, both being compulsory.
I've been enjoying using Rhythmbox to rip a stack of CDs. Initially I had problems getting it to recognise Lame but following uninstalling and reinstalling it, it seemed to be working well. That is, until I looked in my Music folder.
It turns out files have been placed in individual folders, named "number - title.udio" (e.g.: "11 - She Can Do What She Wants.udio". The mp3 file itself is named identically throughout - it's the string for the gstreamer settings, i.e. "x-raw-int,rate=44100,channels=2 ! lame name=enc preset=1002 ! xingmux ! id3v2muxmp3".
The settings within Rhythmbox's properties for folder and file naming are all set to the sensible default. This is a pain. In the short term I'm going to try EasyTAG to sort it out, but ultimately I need to sort this or find alternative software.
ive searched around about this for a bit, but have been unable to find a working and suitable solution for me to do, what i require is to be able to change a string such as:hIs Is a TeSt to --> This Is A Test - AND place it in a variable - so far ive only succesfully been able to make the whole sentence uppercase or lowercase.
i my friend has just droped loads of music on to the computer from his ipod but all the names are just codes, when i look at the tag id the information is all there, how can i get the names to change automatically without having to do it all manually. is there a comand that can be put into the termal or a programme
I.e. i have Opera open up at the moment and it says "Ubuntu Forums - Post New Thread - Opera". How can i change my programs so that i can change the name of the program that appears in the windows?
i have dual boot installation-win7+ ubuntu 10.10 working fine. but the linux partitions are shown as 67gb, 30gb etc , filesystem. what should be done to change the names, and should be changed to what?,for correct identification.-ppm