Gordon_G Posted June 15, 2017 Share Posted June 15, 2017 Is this possible to remove a string from a file ? Link to comment
Hale Posted June 15, 2017 Share Posted June 15, 2017 Please be more specific. Is string.gsub what you're looking for? Link to comment
Gordon_G Posted June 16, 2017 Author Share Posted June 16, 2017 (edited) @Hale Sorry, you're right, I hav'nt explained this very good. So, for exemple I've file 'something.txt', and in this file I've this : "I like donuts", and, I would like to remove 'I ' from this string. So, I can use string.gsub, yes, but, how to set it to the file ? 'Cause fileWrite can only add a string to a file, it can't replace it. Edited June 16, 2017 by Gordon_G Link to comment
Master_MTA Posted June 16, 2017 Share Posted June 16, 2017 (edited) 28 minutes ago, Gordon_G said: @Hale Sorry, you're right, I hav'nt explained this very good. So, for exemple I've file 'something.txt', and in this file I've this : "I like donuts", and, I would like to remove 'I ' from this string. So, I can use string.gsub, yes, but, how to set it to the file ? 'Cause fileWrite can only add a string to a file, it can't replace it. maybe that can help u https://wiki.multitheftauto.com/wiki/FileSetPos u can use it first then u can use file write and if you want to get pos of i in i like donuts then u should do loop for string in the target file then u can break the loop and get the pos of file https://wiki.multitheftauto.com/wiki/FileGetPos Edited June 16, 2017 by Master_MTA Link to comment
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