Jump to content

Delete something from a file


Gordon_G

Recommended Posts

@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 by Gordon_G
Link to comment
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 by Master_MTA
Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...