An open API service indexing awesome lists of open source software.

https://github.com/guitarbum722/libqualified

Like strsep, but considers quoted tokens in delimited data.
https://github.com/guitarbum722/libqualified

c csv delimited-data delimited-files quotes text-processing

Last synced: about 1 month ago
JSON representation

Like strsep, but considers quoted tokens in delimited data.

Awesome Lists containing this project

README

          

# libqualified

It's basically `strsep` from ``, but allows for quoted fields.

This is useful if the input's delimiter characters is actually part of the data in one or more of the tokens (eg. a comma delimited field in a CSV such as "Moby, M.D.").

### Sample usage

```c
#include

#include "qual.h"

int
main()
{
char *field, *input, *tofree;

tofree = input = strdup("Don|K|\"Moby, M.D.\"|don.moby@nothing.com");

while ((field = strqsep(&input, "|", "\"")) != NULL) {
printf("%s\n", field);
}
free(tofree);
return 0;
}

```

Output:
```
Don
K
"Moby, M.D."
don.moby@nothing.com
```