Monday 15 August 2011

Parsing multiline string in C -


I am trying to parse the file using C language with a format like this:

  FILE, "CONTENT", Pat   

So, for example I have an input:

  file.txt, " This is a simple file ", / home / user config.txt," #ID = 'PC1' version = 1.25 ", / etc   

to use any configuration First, I read a line in the file and puts it in the buffer, I do it:

  sscanf (buffer, "% [^,], \ "% [^ \"] \ ",% S", name, content, path)   

But, however, I get only one line input correctly. Is there any way to force the CONTENT string to accept new lines?

non-trivial parsing For, I'm a technical expert to use Flex and Bison

No comments:

Post a Comment