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