I have a bcp output file from sybase that i need to parse using 'c' and write to a new file.
A sample line from bcp o/p file is below
9890000501:74667:0:6::2:0000:0:6:0:5:0:0:0:0:0:0:0:::9890000501:1:1:0::::::::0:0:3::::::::::\202^B:\202^B^D:0:0
:1:0:0:0:0:0:0:0:0:0::::0:0:0:::::::::0::0:0:0:0:
The file has ":" has the delimitor.
I need to create a new file with a single line string as something like this
CUST:NAME=9890000501,HT=74667&0&6,LT=PT-0&PQ-5;
There will be thousands of subscribers.I also will need to get data from different bcp output files to get the data to be filled in this string.
The 'c' program needs to be fast.
I'm a novice with 'c'.
The only way i know is read char by char and check for ":" and then store the value into a char array.
I would have as many variables as there are in the string!!
What would be the fast way to do this?
Is there any function that would in one shot give me the values separated by a delimitor of my choice?
Which is the best way to build up the final string?
Can i create the fixed parts of the string and then just fill up values that need to be taken from the bcp output file??
please HELP!!!