Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to rename file extension from *.bmp? to *.bmp .
Sorry i tried a lot but being a newbie to linux. i need some help.



VB
19024380_fp_2.bmp?        19024532_fp_4.bmp?     19024673_fp_7.bmp?     19024813_fp_6.bmp? 19024380_fp_6.bmp?        19024532_fp_7.bmp?     19024674_17012014.jpg  19024813_fp_9.bmp?     19037410_fp_3.bmp?     19068206_fp_8.bmp?     19093436_fp_9.bmp?



Thanks in advance.
Posted

assuming that you have ?(question mark) at the end of file:
$ ls -1 *.*"?" | sed 's/.$//' | while read a
 do
  mv $a"?" $a
 done
 
Share this answer
 
Comments
Sanjeev236 10-Feb-14 13:25pm    
No Vedat.. those are blank spaces. I tried after modify the given script from "?" to " ".
But no luck.
Sanjeev236 10-Feb-14 13:29pm    
Thanks a lot for giving best possible solution from your end..
but now i am going to rename using excel scripts.

Thanks A ton...
I don't know what it as to do with recursion. You may change file names this way:
rename 's/\.bmp\?/\.bmp/' *


(see How to: Rename multiple files with "rename"[^]).
 
Share this answer
 
v2
Comments
Sanjeev236 10-Feb-14 13:29pm    
Sorry No luck...Yet thanks a lot for giving best poosible solution from your end..
but now i am going to rename using excel scripts.

Thanks A ton...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900