|
Functions | |
| FILE * | qAwkOpen (char *filepath) |
| Open file for tokenizing. | |
| int | qAwkNext (FILE *fp, char array[][1024], char delim) |
| Read one line from opened file pointer to tokenize. | |
| bool | qAwkClose (FILE *fp) |
| Close opened FILE pointer. | |
| int | qAwkStr (char array[][1024], char *str, char delim) |
| String Tokenizer. | |
Plays a similar function to the AWK command of UNIX systems.
char array[7][1024]; qAwkOpen("/etc/passwd", ':'); for( ; qAwkNext(array) > 0; ) printf("ID=%s, NAME=%sn", array[0], array[4]); qAwkClose();
[Sample /etc/passwd] qdecoder:x:1001:1000:The qDecoder Project:/home/qdecoder:/bin/csh wolkykim:x:1002:1000:Seung-young Kim:/home/wolkykim:/bin/csh ziom:x:1003:1000:Ziom Corporation:/home/kikuchi:/bin/csh [Output] ID=qdecoder, NAME=The qDecoder Project ID=wolkykim, NAME=Seung-young Kim ID=ziom, NAME=Ziom Corporation
token1|token2...(length over 1023)...|tokenN
| FILE* qAwkOpen | ( | char * | filepath | ) |
Open file for tokenizing.
| filepath | file path to open |
| int qAwkNext | ( | FILE * | fp, | |
| char | array[][1024], | |||
| char | delim | |||
| ) |
Read one line from opened file pointer to tokenize.
| fp | file pointer which is retruned by qAwkOpen() | |
| array | splitted tokens will be stored here | |
| delim | delimeter |
| bool qAwkClose | ( | FILE * | fp | ) |
Close opened FILE pointer.
| fp | file pointer which is retruned by qAwkOpen() |
| int qAwkStr | ( | char | array[][1024], | |
| char * | str, | |||
| char | delim | |||
| ) |
String Tokenizer.
| array | splitted tokens will be stored here | |
| str | string to tokenize | |
| delim | delimeter |
| [Home] [About] [Examples] [Changes] [Download] [SVN Repository] [Install] [Reference] |