linux - Easy tool to convert data to different format -
i'm studying statistics , programming on own. kind of c or python program solve following problem in linux?
i have text (maybe csv) file of form
pcb138  pcb180  pcb52   pcb118  pcb 1,46    ,738    ,532    ,72 19,9959 ,64 ,664    ,03 ,236    6,0996 3,29    1,15    ,134    1,54    24,9655 3,94    1,33    ,466    1,94    37,4436 ... 32,3    31,5    1,8 8,49    318,7461 now convert format program understands. namely, text file of form
pcb138=[1.46,0.64,3.94,...,32.3] pcb180=[0.738,0.664, 1.15,1.33,...,31.5] pbc52=[0.532, 0.03, 0.134, 0.466, ...,1.8] pbc118=[0.72, 0.236, 0.154, 1.94, ...,8.49] pbc=[19.9959, 6.0996, 24.9655, 37.4436, ...,318.7461] 
write c program using 2 dimensional array , strtok() parsing http://www.cplusplus.com/reference/cstring/strtok/
/* strtok example */ #include <stdio.h> #include <string.h>  int main () {   char str[] ="- this, sample string.";   char * pch;   printf ("splitting string \"%s\" tokens:\n",str);   pch = strtok (str," ,.-");   while (pch != null)   {     printf ("%s\n",pch);     pch = strtok (null, " ,.-");   }   return 0; } 
Comments
Post a Comment