Should be no problem.

I'll just assume that your new filename is in the first line of the first file. I'll also assume that the path is fixed (C:\temp)

code:

$path = "C:\temp"
$file1 = "$path\file1.txt"

$nul = open(7,$file1,2)
$file2 = readline(7)
$nul = close(7)

$nul = open(7,"$file2.txt",5)
$nul = writeline(7,"This is my second file")
$nul = close(7)


------------------

"He was a good little monkey and always very curious..."

_________________________
He was a good little monkey and always very curious...