I am currently trying to write a script that reads a file (any filetype) and spits out the first line, deletes the existing file and recreates a file with all the information but the used line (in lieu of a "delete line" action - Please excuse any small errors as I've just typed this up quickly).
Currently, I have a script that reads every line 1 by 1 and transfers them to a new file, but this takes a considerable amount of time. I am just trying to streamline the process.
Code: Select all
//This is where I read the original file
ReadFile>C:\Users\Dom\Desktop\test.txt,varOriginalFile
//This is where I count how many lines there are
Separate>varOriginalFile,%CRLF%,totalLines
//This is where I get the line of data from the file
Let>varData=totalLines_%totalLines_Count%
//This is where I remove the used data line from the variable
StringReplace>varOriginalFile,varData,,varNewFile
//This is where I delete the old file and create the new file
DeleteFile>C:\Users\Dom\Desktop\test.txt
WriteLn>C:\Users\Dom\Desktop\test.txt,nWLNRes,varNewFile
MessageModal>This is the remaining lines of Data: %totalLines_Count%%CRLF%%CRLF%This is the line of data: %varData%
Hope this makes sense
Thanks in advance,
Dominic Fichera