Associate
- Joined
- 24 Jun 2008
- Posts
- 1,168
So, I turned up and found out they were running Macs. Woops
The batch file worked a treat @SimonCHere I'll file that! How easy would it be for it to add a first line as 'File Name'?
Sooo, for Macs then what can I use? How do you use those Python scripts @Hades ?
no checking, error handling or anything but it prompts for file name and extension and then creates a new file.
Code:
@echo off
set /P fname="Enter filename: "
set /P ext="Enter extension: "
setlocal enabledelayedexpansion
for /f "tokens=*" %%a in ('type %fname%') do (
set line=%%a
echo !line!.%ext% >> modified_%fname%
)
Interestingly if you have Notepad++ you can do a search/replace of the new line character to get the same result.
If you use
"Extended" in the "Search Mode" you can use
"Find what: " \r\n
"Replace with: " .mov\r\n
@Hades You might want to tell him how to stop your python running as well!