Author Topic: Text file functions  (Read 666 times)

What are all of the functions for modifying text files in torque script? I searched the forums and googled but i got nothing on google and the forums have a couple of code snippets. Could someone tell me the functions or give me a link please?

Code: [Select]
%f = new fileObject();
%f.openForRead("filename");
while(!%f.isEOF()) //until %f has reached the end of the file
{
   echo(%f.readLine());
}
%f.close();

%f.openForWrite("filename"); //Clear a file and being editing it
%f.writeline("blah");
%f.close();

%f.openForAppend("filename"); //Open a file and add lines to the end of it
%f.writeline("blah");
%f.close();

Thank you. Is there a function to jump to a specific line in the file? Or a specific column?

No, you'll have to do %file.readLine(); until you reach the line you need.

stuff...okay thank you for the help.