Pipe output to file under Command Prompt

Windows experts
 
I am able to pipe output to file using > or append next output with >> . But all outputs are mixing up. so I like to put some word before the next output. Please see what I like to achieve.

Now :

exclude = C:\Program Files\Veritas\NetBackup\bin\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bprd.d\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bpsched.d\*.lock
exclude = C:\Program Files\Veritas\NetBackupDB\data\*
exclude = C:\Program Files\Veritas\Volmgr\misc\*
exclude = C:\WINDOWS\system32\config\AppEvent.Evt
exclude = C:\WINDOWS\system32\config\SecEvent.Evt
exclude = C:\WINDOWS\system32\config\SysEvent.Evt
exclude = C:\Program Files\Veritas\NetBackup\bin\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bprd.d\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bpsched.d\*.lock
exclude = C:\Program Files\Veritas\NetBackupDB\data\*
exclude = C:\Program Files\Veritas\Volmgr\misc\*
exclude = C:\WINDOWS\system32\config\AppEvent.Evt
exclude = C:\WINDOWS\system32\config\SecEvent.Evt
exclude = C:\WINDOWS\system32\config\SysEvent.Evt

I WANT  LIKE THIS:

ACCTS
exclude = C:\Program Files\Veritas\NetBackup\bin\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bprd.d\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bpsched.d\*.lock
exclude = C:\Program Files\Veritas\NetBackupDB\data\*
exclude = C:\Program Files\Veritas\Volmgr\misc\*
exclude = C:\WINDOWS\system32\config\AppEvent.Evt
exclude = C:\WINDOWS\system32\config\SecEvent.Evt
exclude = C:\WINDOWS\system32\config\SysEvent.Evt
BAGSALE
exclude = C:\Program Files\Veritas\NetBackup\bin\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bprd.d\*.lock
exclude = C:\Program Files\Veritas\NetBackup\bin\bpsched.d\*.lock
exclude = C:\Program Files\Veritas\NetBackupDB\data\*
exclude = C:\Program Files\Veritas\Volmgr\misc\*
exclude = C:\WINDOWS\system32\config\AppEvent.Evt
exclude = C:\WINDOWS\system32\config\SecEvent.Evt
exclude = C:\WINDOWS\system32\config\SysEvent.Evt

So When I copy all outputs once from file , So I may recognize know what output belong to which server.
Thanks!
LVL 1
MSGK161091Netbackup Storage SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
How is the output being generated, is it one piece at a time, or all at once.  If in pieces, then you can add your breaks when needed by doing:

echo BAGSALE >> logfile.txt

If all the lines are written at the same time from a single command or program, then you would need to define some rules about where the breaks are inserted.

~bp
0
MSGK161091Netbackup Storage SpecialistAuthor Commented:
Hi Billprew
thanks for ur prompt reply.
But where  'echo' should fit in the  command because I tried few ways and it is reporting  error
Warning, unknown configuration item (BAGSALE)
Warning, unknown configuration item (echo)

Please see my command below and advise where to fit in

F:\Program Files\Veritas\NetBackup\bin\Admincmd>bpgetconfig -M BAGSALE exclude >> echo BAGSALE E:/Exclude.txt
Warning, unknown configuration item (BAGSALE)
Warning, unknown configuration item (echo)

0
Bill PrewCommented:
I think you will be doing the echo first as a seperate command.  This will write your line of text to divide the next section.  So something like this:

echo BAGSALE >>E:/Exclude.txt
bpgetconfig -M BAGSALE exclude >>E:/Exclude.txt

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT ConsultancyCommented:
btw i know you have your answer and bill knows this anyway but in case you dont know you can also redirect a whole batch of command in one go by enclosing them in (), e.g.

@echo off
(
echo %computername% at %date% %time%
yourprog.exe
someotherprog.exe
echo Finished %date %time%
echo.
) >logfile.txt

etc.

steve
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.