Découpage d'un fichier txt sous PowerShell
Bonsoir
J'ai un ami qui m'a fait un script sous linux, mais depuis peu je ne peux plus l'utiliser. Je voudrais faire le même sous powershell.
Voici le script sous linux
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| #!/bin/bash
fichier_source="Rsf.txt"
NoLigne=0
while read ligne
do
NoLigne=$(($NoLigne+1))
# la ligne commence par un A
if [[ $ligne =~ ^A ]] ; then
# la ligne a un 0 en position 47
if [[ ${ligne:46:2} == "00" ]] ;then
echo "$NoLigne : $ligne"
fi
fi
done < $fichier_source >test.txt |
Merci