Jump to content

Recommended Posts

Posted

Bored???

 

How about writing a .bat file to take a iterate over a list of Scratch files held inside filelist.txt

 

john.sb
amy.sb
...

 

 

and use this


 

and replace Humpty.sb with john.sb amy.sb etc and give me one file with them all in so I can just upload the code onto a website.

 

'nixers welcome to join in just to show how easy it is (and how clever they are :) )

 

Si

Posted

Powershell for you Si!

 

$myFile = Get-Content c:\temp\myFile.txt
$out = ""
foreach ($line in $myFile){
   $out = $out + '
'
}
$out | out-file c:\temp\myNewFile.txt

  • Thanks 1
Posted

strstart = "
"
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\output.txt", ForAppending, True)
Set fso = CreateObject("Scripting.FileSystemObject") 
Set listFile = fso.OpenTextFile("filelist.txt") 
do while not listFile.AtEndOfStream  
   fName =  listFile.ReadLine() 
   objTextFile.WriteLine(fName + ".txt") 
loop 
objTextFile.Close

 

This as a vbs should work, I'd test it first though as I just chucked it together in notepad and have not tested it at all.

  • Thanks 1
Posted
Conceeded :D Is powershell avalible on Windows 98 though :D

 

No... but Si has gone all modern and uses XP nowadays so he should be good ;)

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...