# Renaming files with . dot (Moved from Windows XP)



## Habool (Jan 4, 2008)

I have some files as shown below.
AAAAAAAB.AOX
AAAAAAAB.AOY
AAAAAAAB.AOZ

I need to rename it by DOS/WINDOWS batch script as given below

AAAAAAABAOX.ICA
AAAAAAABAOY.ICA
AAAAAAABAOZ.ICA

Please suggest how to write the batch.
There are almost millions of files to rename in this way.

Thanks in advance


----------



## matthiasvegh (Jan 4, 2008)

*Re: Renaming files with . dot*

you wanna rename them in DOS?

batch cmd: Ren [filename] [new filname]

But you could enter "help" at command prompt


----------



## Habool (Jan 4, 2008)

*Re: Renaming files with . dot*

Thanks for your reply.
I am using Windows system. Some windows batch will help.
With simple rename command I could not remove .(dot) from the file name. I need to remove the 9th character add the extention .ICA
Please see the question once again.

Thanks in advance


----------



## JohnthePilot (Mar 30, 2006)

I've moved your thread into Programming where you may get more help.


----------



## matthiasvegh (Jan 4, 2008)

can you see the extension? If you want to rename it in windows, and also be able to edit the extension, simply enable viewing of extensions, in options.

Tools\Folder Options
Select the "View" tab.
Scroll down to "hide file extensions for known file types"
Uncheck it.

You can now change the extension, by simply renaming (F2) and entering name as: name.extension


----------



## Habool (Jan 4, 2008)

I have milions of files. So can't do....


----------



## JohnthePilot (Mar 30, 2006)

Habool has made it clear that he doesn't just want to change the extension, but wants to make the existing extension part of the filename by removing the dot and then adding the .ICA extension.


----------



## Patrick Mc (Feb 6, 2009)

*Re: Renaming files with . dot using biterscripting*

I use biterscripting to do things like this - especially if you have millions of files. I wrote a quick script for you. Save the following script in a file called FileRename.txt, start biterscripting interactive (for free download, http://www.biterscripting.com), then invoke the script as follows.

cd <your directory where these files are located>
script FileRename.txt

Also, if you do this repeatitively, you can call this script in a batch mode from DOS prompt, any other program, using a shortcut on the desktop, or using a scheduled task. The script will work on every version of windows.

Hope this helps. If you make this script better than my version, please do not forget to repost it for the benefit of others.

Patrick

# START OF SCRIPT

# Collect list of files. There may be variable number of files.
var str list
lf -n "AAAA*" > $list

# Process files one at a time
while ($list <> "")
do
# Get the next file
var str file
lex "1" $list > $file

# Create new file name
var str new_name

# Remove the dot from file name, but only the last dot.
sal -p "^.^l" "" $file > $new_name # sal=string alterer, -p preserve $file - we will need it for the rename command.

# Add .ICA
set $new_name = $new_name+".ICA"

# Rename file
script SS_SlashBack.txt ospath($file) > $file
stex "^/^l]" $new_name > null
system rename ("\""+$file+"\"") ("\""+$new_name+"\"")

done

# END OF SCRIPT


----------



## JohnthePilot (Mar 30, 2006)

Thanks Patrick and welcome to TSF. :wave:


----------



## jamiemac2005 (Jul 5, 2007)

Okay if you want a simple way to do this:

- Download the "Superb Batch Renamer":
http://www.1-4a.com/rename/
- Once you've downloaded it, run the program.
- Navigate to the folder (In the treeview of your system)
- Change the radio button underneath the treeview to "Whole Name"
- Tick the replace button
- In "Replace this" put a "."
- Delete the contents of the "with that" box (so that its empty).
- Click the Start Button

Then to add the .ica extension:
- Click the extension radio button (below the treeview)
- Click the replace check box
- Delete the contents of the "replace this" textbox (so that everything is included)
- In the "With that" box put ".ica"
- Press the Start button

Sorry for the long winded solution but in all honesty it's the only one i've found which requires no actual programming.

Hope this helps.

Cheers,
Jamey


----------



## JohnthePilot (Mar 30, 2006)

Thanks Jamey. Let's see how Habool gets on with those suggestions.


----------



## jamiemac2005 (Jul 5, 2007)

Yeah, i was hoping that he tried patricks(I always prefer the programmatic way tbh).


----------

