Renaming file in Recursive folders


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Renaming file in Recursive folders
# 1  
Old 01-05-2009
Renaming file in Recursive folders

I have UWin version of Unix for Destop

I have files with extension *.abc. I want to rename it to *.csv.
Some of the filenames have spaces.
I also to rename the files with extension *.abc in the corresponding subfolders
ex
==
abc def.abc
ghi jkl.abc
mnopqr.abc
uvwxyz.abc

rename as
========
abc def.csv
ghi jkl.csv
mnopqr.csv
uvwxyz.csv
# 2  
Old 01-05-2009
Well I solved it myself after few tries

ls -ltR | awk '{print $9}' | sed 's/abc/csv/g'
# 3  
Old 01-05-2009
That will change what is displayed to the screen, but doesnt actually rename any actual files.
# 4  
Old 01-05-2009
Quote:
Originally Posted by Ikon
That will change what is displayed to the screen, but doesnt actually rename any actual files.

Thanks for pointing out.
How do I actually rename it.
# 5  
Old 01-06-2009
Here is a link with some ideas on how to handle this:

Batch change extension of files on the unix command line
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recursive delete in a file using a set of values in other file

Hi, I have got a file with 6K records and I want to delete 500 records from this file which match the values present in another file. Format of the both the files is different. Example : File 1 record CCCCCC 11292562ABCDEF MBR/PSF6/108100502/BEN01XXX XXX Example : File 2 record... (1 Reply)
Discussion started by: Nikhath
1 Replies

2. HP-UX

Recursive copy of Folders with files

Dear All, I will appreciate any help received. Our system is running on hpux v1 My problem is as follows: We have many customer folders with name fd000100, fd000101 and so on e.g. (Testrun)(testsqa):/>ll /TESTrun/fd000100 total 48 drwxrwx--- 2 fq000100 test 96 Jun 27 2004... (17 Replies)
Discussion started by: mhbd
17 Replies

3. Shell Programming and Scripting

Recursive File Renaming & Natural Sorting (Bash)

NB! I have already started a thread on this subject on ComputerHope (with the thread title "Recursive File Renaming & Logical Sorting"). However, on ComputerHope they are perhaps more specialized in Windows Command Prompt, and not that much in shell scripts for Bash (I guess). I have a bulk... (1 Reply)
Discussion started by: JewzeyfGhewbelz
1 Replies

4. Shell Programming and Scripting

Recursive file processing from a path and printing output in a file

Hi All, The script below read the path and searches for the directories/subdirectories and for the files. If files are found in the sub directories then read the content of the all files and put the content in csv(comma delimted) format and the call the write to xml function to write the std... (1 Reply)
Discussion started by: Optimus81
1 Replies

5. Shell Programming and Scripting

Renaming folders all at a time

I have a set of folders like Jan1st, Jan2nd, Jan3rd... and so on. I need to rename them to Jan1st2010,Jan2nd2010 .... and so on at one shot. (4 Replies)
Discussion started by: realspirituals
4 Replies

6. Shell Programming and Scripting

recursive saving of files and folders

Hi all I have a bash script, that loops through a folders files and all subfolders for .shtml files. It looks for a string and replaces it, creating a backup of the original file. This all works great, but I'd like, when the backup is done, that the files are then also created in their... (4 Replies)
Discussion started by: terrid
4 Replies

7. Shell Programming and Scripting

Recursive Replication of Unix folders to Windows

Requirements: ftp files recursively from unix to windows. Replicate directory paths on unix (source) to windows (destination) and place files in their respective folders. There are no set number of files per directory nor fix number of dirA or dirB etc.... Source OS: Solaris... (5 Replies)
Discussion started by: mlv_99
5 Replies

8. Filesystems, Disks and Memory

Recursive file processing

I'm developing a generic script to catenate all files found in a given directory. The problem I've got is that the depth of the given directory is unknown, so I end up with some catenated directories. My unix isn't that hot and I'm at a loss. Heres an extract from the script cd $1 for i in... (4 Replies)
Discussion started by: k_mufasa
4 Replies

9. Shell Programming and Scripting

Renaming folders

Hello, I'm new to unix and I have to rename all folder fron the current folder from a name like "xx - Name of the Folder" to "Name of the Folder - xx". xx is a number ... Can somebody, please, help? Thank you! (6 Replies)
Discussion started by: mirciulicai
6 Replies
Login or Register to Ask a Question