tintin92 Posted May 30, 2005 Posted May 30, 2005 How to get the first line of a text ? With this script : $text = WinGetText("SampleText.txt", "") MsgBox(0, "Text read was:", $text) I get three lines in the $text string. first line second line Third line How to set $firstline with the first line from the $text string ? Thanks. Tintin92 Tintin92
quaizywabbit Posted May 30, 2005 Posted May 30, 2005 Filereadline() [u]Do more with pre-existing apps![/u]ANYGUIv2.8
the_lord_mephy Posted May 30, 2005 Posted May 30, 2005 If you wanted, you could set first line to $firstline and second line to $secondline, etc. $text = WinGetText("SampleText.txt", "") $lines = StringSplit($text, @CRLF) $firstline = $lines[1] $secondline = $lines[2] $thirdline = $lines[3] My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
tintin92 Posted May 31, 2005 Author Posted May 31, 2005 If you wanted, you could set first line to $firstline and second line to $secondline, etc.$text = WinGetText("SampleText.txt", "")$lines = StringSplit($text, @CRLF)$firstline = $lines[1]$secondline = $lines[2]$thirdline = $lines[3]<{POST_SNAPBACK}>Do the job.Thanks.Tintin92 Tintin92
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now