hey guys,
Can you please help me write a program that would divide lines into the fields. Each field is separated by comma. I only need to save nonnumerical fields in the array for each nonnumerical column. For example:
0,tcp,http,SF,181,5450,0,0,0,0,0,1,0,0,0,0,0,0,0,0 ,0,0,8,8,0.00,0.00,0.00,0.00,1.00,0.00,0.00,9,9,1. 00,0.00,0.11,0.00,0.00,0.00
,0.00,0.00,normal.
0,udp,ftp,SF,239,486,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0 ,0,8,8,0.00,0.00,0.00,0.00,1.00,0.00,0.00,19,19,1. 00,0.00,0.05,0.00,0.00,0.0
0,0.00,0.00,normal.
0,tcp,smtp,SF,235,1337,0,0,0,0,0,1,0,0,0,0,0,0,0,0 ,0,0,8,8,0.00,0.00,0.00,0.00,1.00,0.00,0.00,29,29, 1.00,0.00,0.03,0.00,0.00,0.
00,0.00,0.00,normal.
0,tcp,http,SF,219,1337,0,0,0,0,0,1,0,0,0,0,0,0,0,0 ,0,0,6,6,0.00,0.00,0.00,0.00,1.00,0.00,0.00,39,39, 1.00,0.00,0.03,0.00,0.00,0.
00,0.00,0.00,smurf.
I would like to save each nonnumerical column (in this case 2nd column - starting with tcp, 3rd column starting with http, 4th column - SF and 42nd column - starting with normal) in separate array. Each array would contain different values for the same field in the column. (For example, 3rd column contains http, ftp, smtp, etc...)
How would you do this with a C++ program (not standard C)?
Thanks a lot!
~Dmitry