How can I create an fscanf format string to accept white space and comma (,) tokenization
- by Jamie
I've got some analysis code (myprog) that sucks in data using the following:
if(5 == fscanf(in, "%s%lf%f%f%f", tag, & sec, & tgt, & s1, & s2))
which works just fine. But in the situation where I've got data files that are separated by commas, I'm currently doing something like:
sed 's/,/ /g' data | myprog
Can I modify the format string in the fscanf() function to accept both delimitation formats?