J'ai un fichier test.txt
Code:
1 2 3 4 5 6
|
options/extend_source
subroutine AFFICHAGE(CARTE,DEFINITION_CARTE)
implicit none
EXIT
EXIT |
J'ai essayé ca :
ici $keyword vaut EXIT
Code:
1 2 3 4 5 6 7 8
| grep -n $keyword test.txt |
while
read line
do
num_ligne=ligne:$(echo $line | cut -d : -f 1)
num_col=colonne:$(echo `expr index "$line" $keyword`)
echo $num_ligne,$num_col
done |
j'obtiens :
Code:
1 2
| ligne:4,colonne:4
ligne:5,colonne:5 |
alors qu'il devrait afficher :
ligne:4,colonne:8
ligne:5,colonne:16
une tabulation est égale a 8 espaces je ne vois pas comment faire pour bien compter.
Merci d'avance