Batch MSDos extraction chaines caractères
Fermé
Tifab27
-
30 juil. 2009 à 16:51
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 - 31 juil. 2009 à 11:05
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 - 31 juil. 2009 à 11:05
A voir également:
- Batch MSDos extraction chaines caractères
- Caractères ascii - Guide
- Caractères spéciaux symboles clavier - Guide
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Fichier batch - Guide
- Caractères spéciaux - Guide
3 réponses
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 615
30 juil. 2009 à 17:51
30 juil. 2009 à 17:51
hello
$ type f1.txt Répertoire de W:\IMBY5843\My Documents 17/07/2009 14:18 <REP> OutlookSoft Répertoire de W:\FRPS7596\My Documents 05/03/2009 12:55 <REP> OutlookSoft Répertoire de W:\zfrl3150\My Documents 28/07/2009 09:51 <REP> OutlookSoft $ aa IMBY5843 17/07/2009 14:18 FRPS7596 05/03/2009 12:55 zfrl3150 28/07/2009 09:51 $ type aa.bat @echo off setlocal enableDelayedExpansion for /f "tokens=3,5,6" %%a in (f1.txt) do ( set x=%%a set x=!x:\= ! for /f "usebackq tokens=2" %%d in (`echo !x!`) do echo %%d %%b %%c )
Hello dubcek,
il fonctionne super bien ton script... merci beaucoup :-)
De mon côté un collègue m'a aussi donné un coup de main. Ca ressemble étrangement à ce que tu as fait :
Encore Merci !
il fonctionne super bien ton script... merci beaucoup :-)
De mon côté un collègue m'a aussi donné un coup de main. Ca ressemble étrangement à ce que tu as fait :
SetLocal enabledelayedexpansion SetLocal enableextensions SET file_user="C:\users.txt" SET tmp="C:\tmp.txt" SET last_date_used=c:\last_date_used.csv Type NUL >%last_date_used% Type NUL >%liste_users% Type NUL >%tmp% SET rep_tmp="My Documents" SET rep_tmp=!rep_tmp:~1,-1! FOR /F "tokens=1 delims=$" %%A IN ('type "%file_user%"') DO ( DIR "w:\%%A\!rep_tmp!\Outlooksoft.*" /N>%tmp% FOR /F "tokens=1 delims= " %%d IN ('type "%tmp%" ^| FINDSTR "OutlookSoft"') DO ( echo.%%A;%%d>>%last_date_used% ) )
Encore Merci !
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 615
31 juil. 2009 à 11:05
31 juil. 2009 à 11:05
on peut simplifier
$ type f1.txt Répertoire de W:\IMBY5843\My Documents 17/07/2009 14:18 <REP> OutlookSoft Répertoire de W:\FRPS7596\My Documents 05/03/2009 12:55 <REP> OutlookSoft Répertoire de W:\zfrl3150\My Documents 28/07/2009 09:51 <REP> OutlookSoft $ aa IMBY5843 17/07/2009 14:18 FRPS7596 05/03/2009 12:55 zfrl3150 28/07/2009 09:51 $ type aa.bat @echo off for /f "tokens=4,7,8 delims=\ " %%a in ('type f1.txt') do echo %%a %%b %%c