×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    26

    How to read file and get token?

    Hello.
    I make a text file like that.(It's a script file)
    -----------------------------------
    command1 parameter1 paramter2
    command2 parameter1
    -----------------------------------
    the delimeter is \n or something.(I haven't decide yet.)

    I wanna read file and get token like that

    char* a = command1;
    char* b = parameter1;

    That means
    read command.
    read parameter
    do something.

    In C, I just read until EOF and use strtok.
    But In Symbian. How?
    How can I use the strtok?
    Or Do I use 'TFileText'?

  2. #2
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: How to read file and get token?

    you mean TLex?

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    26

    Re: How to read file and get token?

    Dear Skygyl
    No. I don't mean TLex.
    I just want to get token string from text file.

    text file is like that
    --------------
    A;B;C;D;
    --------------
    if ';' is delimeter, How can I get A, B, C, and D into another char string?

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,347

    Smile Re: How to read file and get token?

    Hello Seera,

    Have a look at following link:
    http://discussion.forum.nokia.com/fo...ad.php?t=67123

    Regards.
    Kiran.

  5. #5
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: How to read file and get token?

    en, still use TLex

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    26

    Re: How to read file and get token?

    Thanks all.
    I'll try TLex.

    I'll read file to big array and get token.
    and In symbian, there're no fgets() ?

    I just read file => file.read(buf, size)?

Posting Permissions

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