Reading all lines from a file
#1

Hi there.

Iґve got a file - it looks like this:

------------------------------------
email@email.com
mail@email.com
ohai@email.com
... and so on.
------------------------------------

Now Iґd like to read every single line from this file and do something with it ( Mail(); ). How can I do this?
Reply
#2

Sorry forgot, Iґm just using the default read/write functions, no dini or smth.
Reply
#3

https://sampwiki.blast.hk/wiki/File_Functions
Reply
#4

Thanks for replying, but I cant find anything helping me with this problem in there.
Reply
#5

https://sampwiki.blast.hk/wiki/Fopen
https://sampwiki.blast.hk/wiki/Scripting...ions_Old#fread

pawn Код:
new File:handler=fopen("file.txt", io_read);
  new string[256], MyVal[256], idx;
  while(fread(handler, string))
  {
    printf("Line %d contains the following text: %s", idx+1, string);
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)