I have this script:
@ECHO OFF
(FOR /f tokens^=2^ delims^=^" %%a IN ('findstr /l "\<SOMETHING=\>" FILE.vav') DO (Echo | Set /p =%%a,)) >> Results.txt
Now the result looks like that:
SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING,
..but I need to insert blank line after every 5 results, so the result should look like this:
SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING,
//blank line
SOMETHING, SOMETHING, SOMETHING, SOMETHING, SOMETHING,
// blank line
SOMETHING, SOMETHING, SOMETHING,
Could you please help me, guys? I am hopeless..
Probably the solution will be with FOR /L
and IF
, but I cannot figure it out.
Thank you in advance, Jakub
As the title attracts questioners with a more general approach
than here presented (which is perfectly answered by Endoro)
I'd like to show a solution for inserting blank lines in a file read in:
And a very similar one which processes the output of another command,
here
sc
filtered by afindstr
:n
is self-evident.#
counts lines, is modulus devided byn
and if zero issues the wanted blank line inserted.!
exclamation marks in the output are dropped.try this: