LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   search in char array (https://www.linuxquestions.org/questions/programming-9/search-in-char-array-265525/)

xxfunkxx 12-12-2004 08:32 AM

search in char array
 
Hello!
I need some help on searching parts in a char array
Code:

if (FD_ISSET(imp3out, &read_set)) {
                        iln = read(imp3out, output , 8191);
                        //current_line = strtok(output, ">>> *");
                        printf("\t--->counter %d\n", counter);

The outout has this content:

--> queue
Entry(s) : 1/[1024]
Position : 0 <01_Transistor.mp3>
>>> *311.lst
Play mode : Repeat
List view : Tag, then Filename
Memory : 16.53 Kbytes
Entry(s) : 19
Position : 0 <01_Transistor.mp3>
Status : 0.0% played, 0.0% skipped
--> sunday.lst
Play mode : Repeat
List view : Tag, then Filename
Memory : 16.27 Kbytes
Entry(s) : 5
Position : 0 <new_begining.mp3>
Status : 0.0% played, 0.0% skipped

What I need is the names in red and not the blue one.
I tried the function strtok but it didn not worked yet.
Has any one suggestion.
Forget to mention that it is a C Programm

xxfunkkx

xxfunkxx 12-12-2004 09:28 AM

Read my post again and definitly I did not tell much about my problem. I read from a named piped imp3out some status information in the char array output[8192];.

The status information contains the names of mp3 playlists. I need each name for display and selection option.
But I don`t know how to search inside this char array for a specific string.

So I hope I described my problem better than in the previous thread.

xxfunkxx

itsme86 12-12-2004 11:23 PM

Check out the strstr() function.


All times are GMT -5. The time now is 07:43 AM.