zach
zach

Reputation: 71

Remove whitespace/trailing inbetween

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..!

Upvotes: 2

Views: 55

Answers (2)

SomethingDark
SomethingDark

Reputation: 14305

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

Upvotes: 3

Dinesh
Dinesh

Reputation: 4561

Try appending to your pipeline

|sed -e 's/\s\s*/ /g'

Upvotes: 0

Related Questions