You are not logged in.
Pages: 1
Hello everybody,
I want to format rows in a txt file, I don't know how I can :
In the txt file -> there is
"CN=ORD324,OU=Computer_Test,OU=Computers,DC=Company,DC=local"
"CN=ORD325,OU=Computer_Test,OU=Computers,DC=Company,DC=local"
"CN=ORD328,OU=Computer_Test,OU=Computers,DC=Company,DC=local"
"CN=ORD344,OU=Computer_Test,OU=Computers,DC=Company,DC=local"
I hope to format this in this :
ORD324
ORD325
ORD328
ORD344
If someone can show me
Thank's
BIGnotor
Offline
Assuming text file is named Text.txt
@echo off
for /F "tokens=2 delims==," %%A in ('type Text.txt') do echo(%%A
pause
Windows Shell Scripting and InstallShield
Offline
It is not working, thank you for help
I've just find a solution, I use this methode, I don't know if it optimised but it's works
Assuming text file is named Text.txt too
SETLOCAL enableDelayedExpansion
FOR /f "delims=" %%x IN ('TYPE Text.txt') DO (
SET ORD=%%x
ECHO Nom ORD = fichier text : !ORD!
SET ORDformat=!ORD:~4,6!
ECHO Nom ORD formate : !ORD!
IF %ComputerName%==!ORDformat! (
IF EXIST P:\ (
NET USE P: /delete /yes)
)else (
ECHO Bad Condition
)
)
ENDLOCAL
And if I want, I write this in another text file
BIGnotor
Offline
Pages: 1