Rev 14245 | 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 |
||
15699 | bpr | 24 | !if ($ltest_cnt<4 and $keyword notwordof external_auth) or $ltest_cnt<2 |
13361 | bpr | 25 | bad_$keyword=!append item $ltest to $(bad_$keyword) |
26 | !else |
||
27 | loglist=!append item $ltest to $loglist |
||
15699 | bpr | 28 | !if @ isin $ltest or . isin $ltest or - isin $ltest |
13361 | bpr | 29 | !!!FIXME bidouillage - useful only to be able to define a variable dep_$ltest |
14245 | bpr | 30 | !!!! variables names must not content @ and - |
13361 | bpr | 31 | !!! replace by writing in a file ??? |
14245 | bpr | 32 | ltest=!replace internal @ by in $ltest |
33 | ltest=!replace internal . by in $ltest |
||
34 | ltest=!replace internal - by in $ltest |
||
35 | ttt=0 |
||
36 | ltest1=$ltest |
||
37 | !while $ltest1 isitemof $logtest |
||
38 | ltest1=$ltest$ttt |
||
39 | !increase ttt |
||
40 | !endwhile |
||
41 | ltest=$ltest1 |
||
13361 | bpr | 42 | !endif |
43 | logtest=!append item $ltest to $logtest |
||
44 | !endif |
||
45 | dep_$ltest=$l |
||
46 | !endif |
||
47 | !else |
||
48 | !if $i>3 |
||
49 | !exit |
||
50 | !endif |
||
51 | !if $keyword isitemof $l |
||
52 | l=!lower $l |
||
53 | types=!nospace $l |
||
54 | got$keyword=!positionof item $keyword in $l |
||
55 | got$keyword=!item 1 of $(got$keyword) |
||
56 | !endif |
||
5229 | bpr | 57 | !endif |
58 | !next i |