Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Renaming file in Recursive folders Post 302273611 by bobbygsk on Monday 5th of January 2009 10:08:37 AM
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
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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 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

7. 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

8. 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

9. 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
The folder management API.(3)					      libmtp					     The folder management API.(3)

NAME
libmtp - The folder management API. Functions LIBMTP_folder_t * LIBMTP_new_folder_t (void) void LIBMTP_destroy_folder_t (LIBMTP_folder_t *) LIBMTP_folder_t * LIBMTP_Get_Folder_List (LIBMTP_mtpdevice_t *) LIBMTP_folder_t * LIBMTP_Get_Folder_List_For_Storage (LIBMTP_mtpdevice_t *, uint32_t const) LIBMTP_folder_t * LIBMTP_Find_Folder (LIBMTP_folder_t *, uint32_t const) uint32_t LIBMTP_Create_Folder (LIBMTP_mtpdevice_t *, char *, uint32_t, uint32_t) int LIBMTP_Set_Folder_Name (LIBMTP_mtpdevice_t *, LIBMTP_folder_t *, const char *) Detailed Description Function Documentation uint32_t LIBMTP_Create_Folder (LIBMTP_mtpdevice_t *device, char *name, uint32_tparent_id, uint32_tstorage_id) This create a folder on the current MTP device. The PTP name for a folder is 'association'. The PTP/MTP devices does not have an internal 'folder' concept really, it contains a flat list of all files and some file are 'associations' that other files and folders may refer to as its 'parent'. Parameters: device a pointer to the device to create the folder on. name the name of the new folder. Note this can be modified if the device does not support all the characters in the name. parent_id id of parent folder to add the new folder to, or 0 to put it in the root directory. storage_id id of the storage to add this new folder to. notice that you cannot mismatch storage id and parent id: they must both be on the same storage! Pass in 0 if you want to create this folder on the default storage. Returns: id to new folder or 0 if an error occured References DEVICE_FLAG_BROKEN_SEND_OBJECT_PROPLIST, LIBMTP_mtpdevice_struct::params, strip_7bit_from_utf8(), and LIBMTP_mtpdevice_struct::usbinfo. void LIBMTP_destroy_folder_t (LIBMTP_folder_t *folder) This recursively deletes the memory for a folder structure. This shall typically be called on a top-level folder list to detsroy the entire folder tree. Parameters: folder folder structure to destroy See Also: LIBMTP_new_folder_t() References LIBMTP_folder_struct::child, LIBMTP_destroy_folder_t(), LIBMTP_folder_struct::name, and LIBMTP_folder_struct::sibling. Referenced by LIBMTP_destroy_folder_t(), and LIBMTP_Get_Folder_List_For_Storage(). LIBMTP_folder_t* LIBMTP_Find_Folder (LIBMTP_folder_t *folderlist, uint32_tid) Helper function. Returns a folder structure for a specified id. Parameters: folderlist list of folders to search id of folder to look for Returns: a folder or NULL if not found References LIBMTP_folder_struct::child, LIBMTP_folder_struct::folder_id, LIBMTP_Find_Folder(), and LIBMTP_folder_struct::sibling. Referenced by LIBMTP_Find_Folder(). LIBMTP_folder_t* LIBMTP_Get_Folder_List (LIBMTP_mtpdevice_t *device) This returns a list of all folders available on the current MTP device. Parameters: device a pointer to the device to get the folder listing for. Returns: a list of folders References LIBMTP_Get_Folder_List_For_Storage(). LIBMTP_folder_t* LIBMTP_Get_Folder_List_For_Storage (LIBMTP_mtpdevice_t *device, uint32_t conststorage) This returns a list of all folders available on the current MTP device. Parameters: device a pointer to the device to get the folder listing for. storage a storage ID to get the folder list from Returns: a list of folders References LIBMTP_folder_struct::child, LIBMTP_folder_struct::folder_id, LIBMTP_destroy_folder_t(), LIBMTP_new_folder_t(), LIBMTP_folder_struct::name, LIBMTP_mtpdevice_struct::params, LIBMTP_folder_struct::parent_id, LIBMTP_folder_struct::sibling, and LIBMTP_folder_struct::storage_id. Referenced by LIBMTP_Get_Folder_List(). LIBMTP_folder_t* LIBMTP_new_folder_t (void) This creates a new folder structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding LIBMTP_folder_track_t operation later, so be careful of using strdup() when assigning strings, e.g.: Returns: a pointer to the newly allocated folder structure. See Also: LIBMTP_destroy_folder_t() References LIBMTP_folder_struct::folder_id. Referenced by LIBMTP_Get_Folder_List_For_Storage(). int LIBMTP_Set_Folder_Name (LIBMTP_mtpdevice_t *device, LIBMTP_folder_t *folder, const char *newname) This function renames a single folder. This simply means that the PTP_OPC_ObjectFileName property is updated, if this is supported by the device. Parameters: device a pointer to the device that contains the file. folder the folder metadata of the folder to rename. On success, the name member is updated. Be aware, that this name can be different than newname depending of device restrictions. newname the new name for this object. Returns: 0 on success, any other value means failure. References LIBMTP_folder_struct::folder_id, and LIBMTP_folder_struct::name. Author Generated automatically by Doxygen for libmtp from the source code. Version 1.1.3 Sun Feb 17 2013 The folder management API.(3)
All times are GMT -4. The time now is 08:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy