2

This might be a stupid question, but now I'd also like to remove whitespace/trailing inbetween (see also: Remove whitespace/trailing).

For example, I've this command:

fltmc volumes | find ":">>out.log

Which will give me output like:

C:                              \Device\HarddiskVolume1                  NTFS        
F:                              \Device\HarddiskVolume5                  FAT       

How can I make it be output like this for example?:

C: \Device\HarddiskVolume1  NTFS        
F: \Device\HarddiskVolume5  FAT    

Thank you..!

Community
  • 1
  • 1
zach
  • 71
  • 1
  • 7

2 Answers2

3

Run the command through a for /F loop:

for /F "tokens=1-3" %%A in ('fltmc volumes^|find ":"') do echo %%A %%B %%C>>out.log
SomethingDark
  • 13,229
  • 5
  • 50
  • 55
0

Try appending to your pipeline

|sed -e 's/\s\s*/ /g'
Dinesh
  • 4,437
  • 5
  • 40
  • 77
  • Hi Dinesh, thanks for your answer, but I don't want to use external tools if possible. You have another idea? cheers – zach Feb 26 '15 at 08:32