Deleting Part of a String That Includes Spaces
Posted: 27 Sep 2016 11:57
We are trying to retrieve the computer name on a single line.
The command I am using is inserting this with preceding text on the line:
ipconfig/all | find "Host Name" >c:\whoami\whoami2.txt
produces
Host Name . . . . . . . . . . . . : MyPCName
but we are trying to have the txt file read:
MyPCName
I am getting close with FART
fart c:\whoami\whoami2.txt " Host Name . . . . . . . . . . . . : "
...but the output includes a space before the PC Name
Any advice on removing the entire string before the PC Name?
The FART app is really excellent, in case you are unfamiliar with it, available from:
http://fart-it.sourceforge.net/
and it stands for Find And Replace Text
The command I am using is inserting this with preceding text on the line:
ipconfig/all | find "Host Name" >c:\whoami\whoami2.txt
produces
Host Name . . . . . . . . . . . . : MyPCName
but we are trying to have the txt file read:
MyPCName
I am getting close with FART
fart c:\whoami\whoami2.txt " Host Name . . . . . . . . . . . . : "
...but the output includes a space before the PC Name
Any advice on removing the entire string before the PC Name?
The FART app is really excellent, in case you are unfamiliar with it, available from:
http://fart-it.sourceforge.net/
and it stands for Find And Replace Text