Greetings and Salutations,
I've been thrust into a situation at work where I need to do C programming. The problem is that I have never had any formal training in any kind of programming nor do I have the time to spend for the rest of the day to read a book as I have a deadline and this stupid (stupid on my part) problem is getting in the way. I am attempting to extract a value from a string and I cannot seem to get my code to work.
I'm using a tool called VuGen and what I'm attempting to do is extract "299288" from the string passed into the cExhibitionID variable. Please do not worry about the lr_log_message. That function is specific to VuGen.Code:char cExhibitionID; cExhibitionID = "<data jsxid=\"jsxroot\" entityName=\"Exhibition\"><record jsxid=\"N26D698DD\" a1=\"299288\" a2=\"38\" a3=\"32\" a4=\"PCTESTEXHIBITION1\" a5=\"PC1\" a6=\"EX0000589\"><record jsxid=\"N7A004F5B\" a9="" a99=""><record jsxid=\"N55D0B4D8\" a10="" a100=""/></record></record></data>"; char cString; sscanf(cExhibitionID, "<data jsxid=\"jsxroot\" entityName=\"Exhibition\"><record jsxid=\"N26D698DD\" a1=\"%s\" a2=\"38\" a3=\"32\" a4=\"PCTESTEXHIBITION1\" a5=\"PC1\" a6=\"EX0000589\"><record jsxid=\"N7A004F5B\" a9="" a99=""><record jsxid=\"N55D0B4D8\" a10="" a100=""/></record></record></data>", cString); lr_log_message("The value is %s", cString);
In the sscanf I attempted to extract this value by putting a "%s" in place of the number thinking this would work. Clearly it does not. I've been at this for hours and I'm having great difficulty. If anyone can assist me with some ideas I would greatly appreciate it.
Thank you.