Subversion Repositories wimsdev

Rev

Rev 13361 | Rev 14245 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5229 bpr 1
!!INPUT name of csv file, keyword to look for
2
!!OUTPUT : position of the keyword, bad item for this keyword :
3
!! logtest loglist dep_$ltest  got$keyword types ???
4
!! list of types
5
!distribute items $wims_read_parm into file,keyword
6
n=!recordcnt $file
7
!if $n<=0
14087 bpr 8
  !exit
5229 bpr 9
!endif
10
 
11
loglist=
12
logtest=
13
!! look for the position of keyword in the two first lines
14
!! check if the keyword have more than 4 characters in all lines not commented by #
15
!for i=1 to $n
13361 bpr 16
  l=!record $i of $file
17
  l=!replace internal ; by , in $l
18
  l=!replace internal $	$ by , in $l
19
  !if $(got$keyword)!=$empty
20
    ltest=!item $(got$keyword) of $l
21
    ll=!wordcnt $ltest
22
    !if $ll=1 and # notin $ltest
23
      ltest_cnt=!charcnt $ltest
24
      !if $ltest_cnt<4
25
        bad_$keyword=!append item $ltest to $(bad_$keyword)
26
      !else
27
        loglist=!append item $ltest to $loglist
28
        !if @ isin $ltest or . isin $ltest
29
          !!!FIXME bidouillage - useful only to be able to define a variable dep_$ltest
30
          !!! replace by writing in a file ???
31
          ltest=!replace internal @ by _____ in _$ltest
32
          ltest=!replace internal . by 555555 in __$ltest
33
          ltest=!replace internal - by 666666 in __$ltest
34
          !!!!modification necessaire car les noms de variables ne peuvent pas
35
          !!!!contenir @ ; aucun login commencant par _ ne peut avoir été accepté,
36
          !!!!donc il n'y a pas de confusion possible
37
        !endif
38
        logtest=!append item $ltest to $logtest
39
      !endif
40
      dep_$ltest=$l
41
    !endif
42
  !else
43
    !if $i>3
44
      !exit
45
    !endif
46
    !if $keyword isitemof $l
47
      l=!lower $l
48
      types=!nospace $l
49
      got$keyword=!positionof item $keyword in $l
50
      got$keyword=!item 1 of $(got$keyword)
51
    !endif
5229 bpr 52
  !endif
53
!next i