The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-11-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,957
I have encountered this kind of problem !

I dont think we could use strtok to have solution as u desire ( I dont know )

Quite an easy way to tackle is,
parse the record using the delimiter.

for ,

123, 1, ,, 45

parse the record till the end of the line delimiter
when delimiter ' , ' is encountered you have a token
when a delimiter ' , ' follows another delimiter ' , ' obviously the string would have nothing hence the purpose would be solved

Hope this helps !