Splawsh Posted May 4, 2020 Posted May 4, 2020 Hello all I have a problem I want get a line of a file to use in (ex:gg.alert) or other but i only know how get all lines please help me ex: [ /system/build.prop] | [line (7) only] I trying some codes but they didn't work print (" Help me :( ") os.exit()
Splawsh Posted May 5, 2020 Author Posted May 5, 2020 On 5/4/2020 at 9:04 PM, ItsSC said: you're welcome, if the line is not stable but text has a changing pattern, you can use string.gmatch to find the text you want. OK solve my problem by your help
ItsSC Posted May 4, 2020 Posted May 4, 2020 file = io.open("/system/build.prop") local number_of_loop = 0 local extracted = {} repeat text = file:read("l*") number_of_loop = number_of_loop + 1 extracted[number_of_loop] = text until number_of_loop == 7 gg.alert(extracted[7]) Simple loop to get seventh line in the file.
Splawsh Posted May 4, 2020 Author Posted May 4, 2020 35 minutes ago, ItsSC said: file = io.open("/system/build.prop") local number_of_loop = 0 local extracted = {} repeat text = file:read("l*") number_of_loop = number_of_loop + 1 extracted[number_of_loop] = text until number_of_loop == 7 gg.alert(extracted[7]) Simple loop to get seventh line in the file. hey bro very THANKS you❤❤❤
ItsSC Posted May 4, 2020 Posted May 4, 2020 3 minutes ago, Splawsh said: hey bro very THANKS you❤❤❤ you're welcome, if the line is not stable but text has a changing pattern, you can use string.gmatch to find the text you want.
Question
Splawsh
Hello all
I have a problem
I want get a line of a file to use in (ex:gg.alert) or other
but i only know how get all lines
please help me
ex: [ /system/build.prop] | [line (7) only]
I trying some codes but they didn't work
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.