![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lots of questions about linux. | Methal | Red Hat | 1 | 04-25-2008 11:06 AM |
| renaming xls file | systemsb | UNIX for Dummies Questions & Answers | 2 | 10-19-2007 07:50 AM |
| Help in renaming file !!! | kumarsaravana_s | UNIX for Dummies Questions & Answers | 5 | 05-02-2007 12:45 PM |
| Deleting lots of files..... | B14speedfreak | UNIX for Dummies Questions & Answers | 8 | 06-09-2006 07:47 PM |
| Renaming a file name | dbrundrett | Shell Programming and Scripting | 2 | 01-06-2004 10:36 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Lots of file copyingand renaming?
I have Approx 1000 files that all need to be copied from one directory to another. However, each file has to be renamed while it is copied. I have a Tab delimited text file containing all of the old and new file names (they are not all the same character length). Is there a way to read in the old and new file names from this text file into a script that can perform the copy and rename on all the .mat files in the directory.
Example of filenames.txt. old_name1.mat newfile_name1.mat old_name2.mat newfile_name2.mat old_name3.mat newfile_name3.mat Thank you in advance for any help you can give. |
|
||||
|
I was just giving the "newfile" as an example. Each filename is very complex (30ish characters) and the naming scheme between the old and new file is changing completely. That is why I need a script to read the first item in each line of the text file and rename it to the second item in that line then go on to the next for all 1000+ files. If it helps I could format the text file into something else like .csv or whatever.
Thanks |
|
||||
|
Quote:
It will be something like this YYMMDD_LongDesciption_of_File.mat changed to Totally_different_Char_string_MMDDYY.mat about a thousand times. Sorry about my lack of knowledge about Unix but I kind of just got thrown into full force in the last month or so. I will do some research on the sed command and try to figure out how to use it. Thanks for your help and any additional help/code anyone can give. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|