Reverse File Read
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
Last line first, or completely reversed?

Imagine this is the content of your file:

Код:
hello
test
Should it become:

Код:
tset
olleh
or:

Код:
test
hello
It's also important to know how long the file is. If it's not too big it's easy to use a buffer and then go through that in reverse (either line by line or character by character). Otherwise you must use fseek and fgetchar. fseek has different modes you can take advantage of.
I want it to last line first. Like the second one. The file size is uncertain. It can be up to 300 or 500 lines.
Reply


Messages In This Thread
Reverse File Read - by Novacaine - 04.06.2017, 12:52
Re: Reverse File Read - by NaS - 04.06.2017, 21:39
Re: Reverse File Read - by Novacaine - 04.06.2017, 22:08
Re: Reverse File Read - by NaS - 04.06.2017, 22:19
Re: Reverse File Read - by Novacaine - 04.06.2017, 22:36
Re: Reverse File Read - by NaS - 04.06.2017, 23:29
Re: Reverse File Read - by Novacaine - 05.06.2017, 00:21
Re: Reverse File Read - by NaS - 05.06.2017, 08:56
Re: Reverse File Read - by Gammix - 05.06.2017, 09:05
Re: Reverse File Read - by Novacaine - 05.06.2017, 15:05

Forum Jump:


Users browsing this thread: 2 Guest(s)