Sponsored Content
Top Forums Shell Programming and Scripting rename all the files in a folder.. Post 302349178 by danmero on Monday 31st of August 2009 09:15:47 AM
Old 08-31-2009
Code:
for i in *.DAT
do
    mv "$i" "${i%.DAT}.TXT;
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

rename files in a folder

i have a folder that contains 100's of files: abc, bca, def, ghi.... i want to rename abc with 1, bca with 2, def with 3, ghi with 4 and so on. my way, i create a file.txt with contents: 1 2 3 4 i use while loop to rename my files. without using file.txt, i just want to rename abc with... (4 Replies)
Discussion started by: tjmannonline
4 Replies

2. Shell Programming and Scripting

Rename folder based on containing XML file

Hi everyone. I'm in need of a solution where i need to rename a folder to a name that's inside an XML file in that folder. OS is Ubuntu 9.10 with Gnome. I've tried using grep, sed and xpath, but can't seem to find a solution. This is the simplified folder structure: FOLDER-NAME -... (4 Replies)
Discussion started by: CoolCow
4 Replies

3. Shell Programming and Scripting

Copy files from folder and rename them

hello, I need to build a shell script that receives the folder to copy by parameter and copy all files except thumb.db to another folder and rename them like, file.jpg renamed to file_bb1.jpg. can someone help me Thanks (4 Replies)
Discussion started by: zeker
4 Replies

4. Linux

rename files in a folder with date&time stamp

Hi, I want to rename all the files (more than 100 files) in a fodler to another folder with date&time stamp. foe eg, file1.dat file2.dat file3.dat .. to be renamed as file1100629_16_30_15.txt (yy-mon-dd_hh_mi_ss) file1100629_16_30_16.txt .. so on (2 Replies)
Discussion started by: feroz
2 Replies

5. UNIX for Dummies Questions & Answers

Using Vim or Ex to rename all files in a folder

Is there a way to use Vim or Ex to rename all files in a folder? For example if i have a folder with Apples1.txt, Apples2.txt, Apples3.txt, could I rename all files so they are Oranges1.txt, Oranges2.txt, Oranges3.txt ? I know with :bufdo %s/apples/oranges/g|update you can do this for inside... (5 Replies)
Discussion started by: VimNewUser
5 Replies

6. UNIX for Dummies Questions & Answers

Bash script to rename all files within a folder...

Hi. I don't have any experience with making scripts in bash. I need a simple script to rename all files in a folder to the format file1.avi, file2.avi, file3.avi, and so on..... Please note that the original files have different filenames and different extensions. But they all need to be... (2 Replies)
Discussion started by: dranzer
2 Replies

7. Shell Programming and Scripting

sed to rename files in a folder - please help with script

Hello, I am new to shell scripting and stuck on renaming files in a folder. The files have the format chp01_00001.wav chp01_00002.wav .... chp02_00001.wav chp02_00002.wav .... but I want them to have the following names: chp_bloomy_00001.wav chp_bloomy_00002.wav chp_bloomy_00003.wav... (8 Replies)
Discussion started by: Bloomy
8 Replies

8. UNIX for Dummies Questions & Answers

looping through files, doing something, and rename in new folder

Hi, I'm really new at this but have several hundred files that i need to do something with and save with a new name. The files are 26 columns wide. I want to select some for renaming. I've figured out what to do to each file ("file-1.CSV"| grep -v "=" | cut -f 1-4,9,14,15,18,19,20,21,22,24,26... (2 Replies)
Discussion started by: bob101
2 Replies

9. Shell Programming and Scripting

Rename folder

hi guys i have a group of directory like these p1( 15 - 16 ) p2( 17 -15 ) p1 ( 14 - 20 ) p2 ( 13 -17 ) .. . . directories contain numbers represent time i want to rename all directories and change all numbers in directories' name . for example p1( 15 -16 ) will change to... (16 Replies)
Discussion started by: mhs
16 Replies

10. Shell Programming and Scripting

How to rename all files and folder containing underscore?

I want to rename all files and folder containing underscore in name and replace underscore with hyphen. Currently I am using following code, rename '_' '-' */*/* It was working but now it is showing me "Argument list too long" Please help! (2 Replies)
Discussion started by: opticalpigion
2 Replies
dat_ia_open(3DAT)				     Direct Access Transport Library Functions					 dat_ia_open(3DAT)

NAME
dat_ia_open - open an Interface Adapter (IA) SYNOPSIS
cc [ flag... ] file... -ldat [ library... ] #include <dat/udat.h> DAT_RETURN dat_ia_open ( IN const DAT_NAME_PTR ia_name_ptr, IN DAT_COUNT async_evd_min_qlen, INOUT DAT_EVD_HANDLE *async_evd_handle, OUT DAT_IA_HANDLE *ia_handle ) PARAMETERS
ia_name_ptr Symbolic name for the IA to be opened. The name should be defined by the Provider registration. async_evd_min_qlen Minimum length of the Asynchronous Event Dispatcher queue. async_evd_handle Pointer to a handle for an Event Dispatcher for asynchronous events generated by the IA. This parameter can be DAT_EVD_ASYNC_EXISTS to indicate that there is already EVD for asynchronous events for this Interface Adapter or DAT_HANDLE_NULL for a Provider to generate EVD for it. ia_handle Handle for an open instance of a DAT IA. This handle is used with other functions to specify a particular instance of the IA. DESCRIPTION
The dat_ia_open() function opens an IA by creating an IA instance. Multiple instances (opens) of an IA can exist. The value of DAT_HANDLE_NULL for async_evd_handle (*async_evd_handle == DAT_HANDLE_NULL) indicates that the default Event Dispatcher is created with the requested async_evd_min_qlen. The async_evd_handle returns the handle of the created Asynchronous Event Dispatcher. The first Consumer that opens an IA must use DAT_HANDLE_NULL because no EVD can yet exist for the requested ia_name_ptr. The Asynchronous Event Dispatcher (async_evd_handle) is created with no CNO (DAT_HANDLE_NULL). Consumers can change these values using dat_evd_modify_cno(3DAT). The Consumer can modify parameters of the Event Dispatcher using dat_evd_resize(3DAT) and dat_evd_modify_cno(). The Provider is required to provide a queue size at least equal to async_evd_min_qlen, but is free to provide a larger queue size or dynam- ically enlarge the queue when needed. The Consumer can determine the actual queue size by querying the created Event Dispatcher instance. If async_evd_handle is not DAT_HANDLE_NULL, the Provider does not create an Event Dispatcher for an asynchronous event and the Provider ignores the async_evd_min_qlen value. The async_evd_handle value passed in by the Consumer must be an asynchronous Event Dispatcher created for the same Provider (ia_name_ptr). The Provider does not have to check for the validity of the Consumer passed in async_evd_handle. It is the Consumer responsibility to guarantee that async_evd_handle is valid and for this Provider. How the async_evd_handle is passed between DAT Consumers is out of scope of the DAT specification. If the Provider determines that the Consumer-provided async_evd_handle is invalid, the operation fails and returns DAT_INVALID_HANDLE. The async_evd_handle remains unchanged, so the returned async_evd_handle is the same the Consumer passed in. All asynchronous notifications for the open instance of the IA are directed by the Provider to the Consumer passed in Asynchronous Event Dispatcher specified by async_evd_handle. Consumer can specify the value of DAT_EVD_ASYNC_EXISTS to indicate that there exists an event dispatcher somewhere else on the host, in user or kernel space, for asynchronous event notifications. It is up to the Consumer to ensure that this event dispatcher is unique and unambiguous. A special handle may be returned for the Asynchronous Event Dispatcher for this scenario, DAT_EVD_OUT_OF_SCOPE, to indicate that there is a default Event Dispatcher assigned for this Interface Adapter, but that it is not in a scope where this Consumer may directly invoke it. The Asynchronous Event Dispatcher is an Object of both the Provider and IA. Each Asynchronous Event Dispatcher bound to an IA instance is notified of all asynchronous events, such that binding multiple Asynchronous Event Dispatchers degrades performance by duplicating asyn- chronous event notifications for all Asynchronous Event Dispatchers. Also, transport and memory resources can be consumed per Event Dis- patcher bound to an IA As with all Event Dispatchers, the Consumer is responsible for synchronizing access to the event queue. Valid IA names are obtained from dat_registry_list_providers(3DAT). RETURN VALUES
DAT_SUCCESS The operation was successful. DAT_INSUFFICIENT_RESOURCES The operation failed due to resource limitations. DAT_INVALID_PARAMETER Invalid parameter. DAT_PROVIDER_NOT_FOUND The specified provider was not registered in the registry. DAT_INVALID_HANDLE Invalid DAT handle; async_evd_handle is invalid. USAGE
The dat_ia_open() function is the root method for the Provider, and, thus, all Objects. It is the root handle through which the Consumer obtains all other DAT handles. When the Consumer closes its handle, all its DAT Objects are released. The dat_ia_open() function is the workhorse method that provides an IA instance. It can also initialize the Provider library or do any other registry-specific functions. The dat_ia_open() function creates a unique handle for the IA to the Consumer. All further DAT Objects created for this Consumer reference this handle as their owner. The dat_ia_open() function can use a reference count for the Provider Library to ensure that the Provider Library cannot be removed when it is in use by a DAT Consumer. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard: uDAPL, 1.1, 1.2 | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
dat_evd_modify_cno(3DAT), dat_evd_resize(3DAT), dat_ia_close(3DAT), dat_registry_list_providers(3DAT), libdat(3LIB), attributes(5) SunOS 5.10 16 Jul 2004 dat_ia_open(3DAT)
All times are GMT -4. The time now is 01:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy