CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 16

Threaded View

  1. #1

    Parse buffer

    Hi,

    I'm programming in C Ansi under Unix so a C (and not C++) answer would really be appreciated

    My program is supposed to get a text file from the net. This part is coded well (I think) and I get the file with 'GET file.txt HTTP/1.1'.

    Now I receive the file with a HTTP header like:

    HTTP/1.1 200 OK
    Date: Mon, 30 sep 2002 13:55:33 GMT
    [..]
    Content-Type: text/plain

    NAME=name1&SURNAME=surname1&ENTER=yes
    NAME=name2&SURNAME=surname2&ENTER=yes
    NAME=name3&SURNAME=surname3&ENTER=yes
    NAME=name4&SURNAME=surname4&ENTER=yes
    NAME=name5&SURNAME=surname5&ENTER=yes


    I wanted to parse the file to get NAME and SURNAME for each line with a 'while' loop and 'strstr' but it gets the first line and get it over and over..

    Please, what's the (best) way to parse a buffer and get all the NAME and SURNAME.

    I already have the part to manage the users so just help me with the loop part.

    Regards,

    Pierrick
    Last edited by tux0r; September 30th, 2002 at 09:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured