Jump to content

newbie wants to read in specific line numbers from plain text file


Go to solution Solved by rossnixon,

Recommended Posts

Hi all, if anyone still uses this forum...

I don't think I need to post all my code, but it goes like this.

I read in files of certain extensions from a directory using _FileListToArray() 
Should be no problem as I pulled this from an old working script from 2007.

For each file, I have a function that creates new files with boilerplate text plus various text from the original file.

Here is the first part of the function:

Func ProcessFile($name)
    $text = StringSplit(FileRead($name), @CRLF, 1)
    $text2 = $header & "File" & ' "' & StringMid($name,1,stringLen($name)-4) & '.ecw"' & @CRLF & 'Type "RASTER"'& @CRLF
    
    $minX = FileReadLine($name,line=5)
    $maxY = FileReadLine($name,line=6)

Error message is:
$minX = FileReadLine($name,line=5)
$minX = FileReadLine($name,^ ERROR

Error: Unknown function name.

 

 

Edited by rossnixon
putting into code format
Link to comment
Share on other sites

You can also use _FileReadToArray instead, and see the array number as line number.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...