help||Editing single line in txt file (on extension .as)

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

ransaymour
Posts: 11
Joined: 20 Jun 2016, 18:30

help||Editing single line in txt file (on extension .as)

Postby ransaymour » 05 Dec 2017, 13:29

Hello everyone, :wink:
I need help in "_server.writeFile()" function...
If I have a .txt file and I want to edit a line which already exists in the file Is there a way to do that ?

for example:

1.Banana
2.Apple
3.Tomatoes
I want to change the second line to something else It is possible?

Thank, ran. :D
User avatar
Lapo
Site Admin
Posts: 19679
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: help||Editing single line in txt file (on extension .as)

Postby Lapo » 05 Dec 2017, 15:47

Hi,
you can do that by loading the text file in memory, change the line and saving the file again.
To change the content of a specific line you can use string manipulation functions.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 9 guests