| | |
change file names
![]() |
•
•
Join Date: Dec 2008
Posts: 2
Reputation:
Solved Threads: 0
hi, can someone help me?
i need a hand to get a script for a smal change.
iget this kind of structure...
20080926RIM881T.20081127.104856
20080926RIM881T.20081127.104831.done
20080926RIM881T.20081202.084408.done
20080926RIM881T.20081127.104845
20080926RIM881T.20081127.104834
20080926RIM881T.20081216.084909.done
20080926RIM950T.20080929.101124.done
20080926RIM951T.20080929.101124.done
20080926RIM952T.20080929.101125.done
i woud like to have a script to find all files with .done then i shoug change all files with .done to files without .done
like...
20080926RIM881T.20081127.104831
20080926RIM881T.20081202.084408
20080926RIM881T.20081216.084909
20080926RIM950T.20080929.101124
20080926RIM951T.20080929.101124
20080926RIM952T.20080929.101125
i need a hand to get a script for a smal change.
iget this kind of structure...
20080926RIM881T.20081127.104856
20080926RIM881T.20081127.104831.done
20080926RIM881T.20081202.084408.done
20080926RIM881T.20081127.104845
20080926RIM881T.20081127.104834
20080926RIM881T.20081216.084909.done
20080926RIM950T.20080929.101124.done
20080926RIM951T.20080929.101124.done
20080926RIM952T.20080929.101125.done
i woud like to have a script to find all files with .done then i shoug change all files with .done to files without .done
like...
20080926RIM881T.20081127.104831
20080926RIM881T.20081202.084408
20080926RIM881T.20081216.084909
20080926RIM950T.20080929.101124
20080926RIM951T.20080929.101124
20080926RIM952T.20080929.101125
•
•
Join Date: Dec 2008
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
hi, can someone help me?
i need a hand to get a script for a smal change.
iget this kind of structure...
20080926RIM881T.20081127.104856
20080926RIM881T.20081127.104831.done
20080926RIM881T.20081202.084408.done
20080926RIM881T.20081127.104845
20080926RIM881T.20081127.104834
20080926RIM881T.20081216.084909.done
20080926RIM950T.20080929.101124.done
20080926RIM951T.20080929.101124.done
20080926RIM952T.20080929.101125.done
i woud like to have a script to find all files with .done then i shoug change all files with .done to files without .done
like...
20080926RIM881T.20081127.104831
20080926RIM881T.20081202.084408
20080926RIM881T.20081216.084909
20080926RIM950T.20080929.101124
20080926RIM951T.20080929.101124
20080926RIM952T.20080929.101125
is it possible to change all files name from blablabla.done to blablabla without done?
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
Hey there,
Just a word of practical advice. If you really "need" a solution and don't have time to wait for someone else to take of their own time to help you with your problem, try doing a search on google for something like:
and you'll have your answer straight away 
Best wishes,
Mike
Just a word of practical advice. If you really "need" a solution and don't have time to wait for someone else to take of their own time to help you with your problem, try doing a search on google for something like:
•
•
•
•
script to remove extension from filename

Best wishes,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
You can change filenames in batch by using the freeware tool "lupasrename".
I am sure it works for folder and filenames. You can select a group of files or folders and
> add or delete txt
> replace txt >>> this is the one you need !!!
> Crop left or right with N characters
> autonumber
I am not sure whether your files are all in the same folder or not. In case not, you probably will have to group them in one folder, then do the filename transformation, and then put them back in their respective original folders again.
Hope this helps
I am sure it works for folder and filenames. You can select a group of files or folders and
> add or delete txt
> replace txt >>> this is the one you need !!!
> Crop left or right with N characters
> autonumber
I am not sure whether your files are all in the same folder or not. In case not, you probably will have to group them in one folder, then do the filename transformation, and then put them back in their respective original folders again.
Hope this helps
•
•
Join Date: Dec 2008
Posts: 63
Reputation:
Solved Threads: 13
•
•
•
•
ls *.done | while read line ; do mv $line $(basename $line .done) ; done
You don't need ls.
You don't need basename (an external command).
Your script will fail if any filenames contain spaces, because you haven't quoted "$line" and "$(basename $line .done)"
Shell Scripting Syntax (Toggle Plain Text)
for file in *.done do mv "$file" "${file%.done}" done
Last edited by cfajohnson; Jan 25th, 2009 at 10:09 am.
Chris F.A. Johnson
http://cfajohnson.com
http://cfajohnson.com
![]() |
Similar Threads
- Set, View, Change, or Remove Special Permissions for Files and Folders in Windows XP (Windows tips 'n' tweaks)
- Managing music files: How to correct file names & tags (Mac Software)
- How to delete the First 3 characters from File-name using unix command (Shell Scripting)
- Saving file names from directory to array (C)
- Concat files with similar names in different directories (Shell Scripting)
- File Pathname Color (Windows NT / 2000 / XP)
- SpyAxe and hacktool.rootkit (Viruses, Spyware and other Nasties)
- Accessing network share programmatically (Visual Basic 4 / 5 / 6)
Other Threads in the Shell Scripting Forum
- Previous Thread: retrieving username and password
- Next Thread: noob question
| Thread Tools | Search this Thread |





