Showing last lines of file..
#1

Hey,
I've got a file which looks like this:
Quote:

A long string here
Another long string here
This string is also long
Something more
Long String here
A long string here

How can I get 3 last lines of this into separate arrays?
Like
str1[512] would be "Something more"
str2[512] would be "Long String here"
str3[512] would be "A long string here"
Reply
#2

Up to the space..
Reply
#3

Still unsolved..
Reply
#4

Using sa-mp's file functions I believe you can use the \n escape codes, so to read line 2 of the file \n%s, to read line 3 \n\n%s.

More info can be found here: https://sampwiki.blast.hk/wiki/File_Functions
Reply
#5

Tried.. But I couldn't make it read the 3 LAST lines of the file.. any help?
Reply
#6

Post here your file reading code.
Reply
#7

Quote:
Originally Posted by ¤Adas¤
Post here your file reading code.
Already removed it from my script O.O
Reply
#8

Hello.. Still hoping u can help me guys (or maybe girls?)
Reply
#9

Quote:
Originally Posted by ¤Adas¤
Post here your file reading code.
Reply
#10

Quote:
Originally Posted by SiJ
Quote:
Originally Posted by ¤Adas¤
Post here your file reading code.
Already removed it from my script O.O
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)