Author Topic: Help: add extension to files with lisp  (Read 1025 times)

0 Members and 1 Guest are viewing this topic.

PM

  • Guest
Help: add extension to files with lisp
« on: March 04, 2022, 05:02:33 AM »
Hi. I  have a big list of *.sld files. The problem is that missing the extension .sld. I have only the name of the file.Is it possible to put all this files in a folder and add the extension .sld with a lisp file without change the name of the files ?

Thanks

JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: Help: add extension to files with lisp
« Reply #1 on: March 04, 2022, 03:17:14 PM »
Why does this have to be done with Lisp?

This could be fairly simple for you to do:
1. Create folder.
2. Sort your directory by filetype.
3. drag those files into the folder.
4. use a .bat file to rename the files in that directory.


Code - Bash: [Select]
  1. rename * *.sld
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BIGAL

  • Swamp Rat
  • Posts: 1423
  • 40 + years of using Autocad
Re: Help: add extension to files with lisp
« Reply #2 on: March 04, 2022, 10:55:12 PM »
Like john use old fashioned DOS, lower left cnr of windows not cad, type cmd, ok tricky bit

CD \whereis\my slides files       replace with correct path
rename * *.sld        hOPEFULLY ALL DONE



A man who never made a mistake never made anything

mhupp

  • Bull Frog
  • Posts: 250
Re: Help: add extension to files with lisp
« Reply #3 on: March 11, 2022, 08:33:47 AM »
BIGAL little time saver with cmd. navigate to the folder you want to run the command in with windows explorer. Then type cmd in the address bar the command prompt will start in that folder location.

I use PowerToys you can select files you want to rename directly form windows explorer
https://docs.microsoft.com/en-us/windows/powertoys/

Tho I mainly use PowerToys for Fancy zones and always on top.
« Last Edit: March 11, 2022, 08:47:00 AM by mhupp »

JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: Help: add extension to files with lisp
« Reply #4 on: March 11, 2022, 09:43:29 AM »
Use a .BAT file.
1. Navigate to the folder.
2. Create a new text file and call it "rename.bat".
3. Edit the file and place the code in it.
Code: [Select]
@echo off
rename * *.sld
4. Save and close the file.
5. Double click the "rename.bat" file.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

PM

  • Guest
Re: Help: add extension to files with lisp
« Reply #5 on: March 12, 2022, 04:22:05 AM »
Thanks