]> henry.ined.fr Git - .git/commitdiff
Add the possibility to read data file including tab characters.
authorN. Brouard <brouard@ined.fr>
Wed, 15 Sep 2004 17:31:30 +0000 (17:31 +0000)
committerN. Brouard <brouard@ined.fr>
Wed, 15 Sep 2004 17:31:30 +0000 (17:31 +0000)
src/imach.c

index 936d26dfac674fc73ea19756a8b1eba01e25d0ad..262493d430933069b3117efabe2ab3c3b9adf3dd 100644 (file)
@@ -1,6 +1,9 @@
 /* $Id$
   $State$
   $Log$
+  Revision 1.101  2004/09/15 10:38:38  brouard
+  Fix on curr_time
+
   Revision 1.100  2004/07/12 18:29:06  brouard
   Add version for Mac OS X. Just define UNIX in Makefile
 
 /* $Id$ */
 /* $State$ */
 
-char version[]="Imach version 0.97b, May 2004, INED-EUROREVES ";
+char version[]="Imach version 0.97c, September 2004, INED-EUROREVES ";
 char fullversion[]="$Revision$ $Date$"; 
 int erreur, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings  */
 int nvar;
@@ -436,8 +439,8 @@ int nbocc(char *s, char occ)
 
 void cutv(char *u,char *v, char*t, char occ)
 {
-  /* cuts string t into u and v where u is ended by char occ excluding it
-     and v is after occ excluding it too : ex cutv(u,v,"abcdef2ghi2j",2)
+  /* cuts string t into u and v where u ends before first occurence of char 'occ' 
+     and v starts after first occurence of char 'occ' : ex cutv(u,v,"abcdef2ghi2j",'2')
      gives u="abcedf" and v="ghi2j" */
   int i,lg,j,p=0;
   i=0;
@@ -4396,7 +4399,10 @@ int main(int argc, char *argv[])
   i=1;
   while (fgets(line, MAXLINE, fic) != NULL)    {
     if ((i >= firstobs) && (i <=lastobs)) {
-       
+      for(j=0; line[j] != '\n';j++){  /* Untabifies line */
+       if(line[j] == '\t')
+         line[j] = ' ';
+      }
       for (j=maxwav;j>=1;j--){
        cutv(stra, strb,line,' '); s[j][i]=atoi(strb); 
        strcpy(line,stra);