VectorLinux
September 01, 2014, 10:14:59 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [SOLVED] batch renaming to .txt  (Read 594 times)
overthere
Vectorian
****
Posts: 1273



« on: December 21, 2012, 12:28:23 pm »

I had/have an issue where if I copied a document saved in leafpad to a floppy it copied as an executable.

 what I have been doing is saving these files with a name and not an extension assuming they were saved as .txt with a hidden extension. they open from /home by default in leafpad

 when I create a document in leafpad and save as "document.txt" it is copied to floppy as document.txt rather than document/executable.

now I have to figure out how to batch convert all the saved documents to .txt so they are able to be backed up as text files.

If I place all the named documents in a folder called documents is there a command or application to convert them all to- there names.txt?

or do I have to correct my error by renaming each file

Thanks for any
« Last Edit: December 21, 2012, 01:24:51 pm by overthere » Logged

Everything Is Relative
M0E-lnx
Administrator
Vectorian
*****
Posts: 3179



« Reply #1 on: December 21, 2012, 01:05:44 pm »

Looks like leafpad does not provide a default file extension, but you could easily rename them all to .txt.

Place them all in one directory
open a terminal a cd to that directory
then run this command
Code:
for i in *; do mv $i $i.txt; done
Logged

overthere
Vectorian
****
Posts: 1273



« Reply #2 on: December 21, 2012, 01:24:25 pm »

Thank you very much..this worked
 less two files which had a space in the name, I renamed them individually to complete the task.

Thank you
Logged

Everything Is Relative
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!