If a program displays data that you would like pipe to a file, and use it for subsequent input, you may need to strip extraneous information and/or skip the first n lines.

I have scripted SkipStrip.bat to perform this task. The syntax is:

<b>
SkipStrip InputFile OutputFile \[-\]Lines_to_Skip ExtractPosition1 ExtractLength1
                                               \[ExtractPosition2 ExtractLength2 ... ExtractPosition<i>n</i> ExtractLength<i>n</i>\]</b>
where:

InputFile   The input file.
OutputFile   The output file.
-   Optional negative sign to cause the output file to be in CSV (Comma Separated Values) format. Each extracted field will be quoted.
Lines_to_Skip   The number of leading records to skip. The range is 0-number.
ExtractPosition1   The position, starting at 0, of the first field to be extracted.
ExtractLength1   The length of the first field to be extracted.
ExtractPosition2   The position, starting at 0, of the second field to be extracted.
ExtractLength2   The length of the second field to be extracted.
ExtractPosition1   The position, starting at 0, of the nth field to be extracted.
ExtractLength1   The length of the nth field to be extracted.

NOTE: The 'length' fields may NOT be zero (0).

NOTE: Due to limitation of the CMD processor, control symbols (!>), and un-paired " marks, in the input file causes problems. The script attempts to report these lines, as well as lines that contain nul data at the extraction positions.

Example:

To generate a regular file from an input file that contains:

** Program.exe output **
Version 2.5
User name=test1                    User Full Name=John Doe
User name=test name with space     User Full Name=Jane Smith

<b>SkipStrip C:\Folder1\inputfile.txt C:\folder2\outputfile.txt 2 10 25 50 256</b>

The output file would contain:

test1                    John Doe
test name with space     Jane Smith

To generate a <b>CSV</b> file:

<b>SkipStrip C:\Folder1\inputfile.txt C:\folder2\outputfile.csv -2 10 25 50 999</b>

The output file would contain:

"test1","John Doe"
"test name with space","Jane Smith"
SkipStrip.bat contains:
@echo off
setlocal ENABLEDELAYEDEXPANSION
if \{%5\}<h1><a name="_goto_syntax_if_not_exist_1_goto_syntax_set_of_2_if_i_1_EQU_of_goto_syntax_set_a_skip_3_if_not_skip_EQU_3_goto_syntax_set_wrk_3_set_csv_N_if_wrk_0_1_EQU_set_csv_Y_amp_set_a_skip_0_skip_set_a_stripp_4_if_not_stripp_EQU_4_goto_syntax_set_a_stripl_5_if_not_stripl_EQU_5_goto_syntax_if_stripl_EQU_0_goto_syntax_if_exist_of_del_q_f_of_set_a_cnt_skip_set_fl_1_if_skip_EQU_0_for_f_tokens_a_in_type_fl_do_set_ln_a_amp_call_str_ELSE_for_f_tokens_skip_skip_a_in_type_fl_do_set_ln_a_amp_call_str_if_not_exist_of_echo_gt_of_endlocal_goto_EOF_syntax_echo_Syntax_SkipStrip_input_output_skip_strippos_striplen_strippos2_striplen2_stripposn_striplenn_endlocal_goto_EOF_str_set_a_cnt_cnt_1_set_ou_str1_call_str3_4_5_gt_nul_2_gt_amp_1_if_xx_">\{\} goto syntax
if not exist %1 goto syntax
set of=%2
if /i %1 EQU %of% goto syntax
set /a skip=%3
if not %skip% EQU %3 goto syntax
set wrk=%3
set csv=N
if "%wrk:~0,1%" EQU "-" set csv=Y&set /a skip=0 - %skip%
set /a stripp=%4
if not %stripp% EQU %4 goto syntax
set /a stripl=%5
if not %stripl% EQU %5 goto syntax
if %stripl% EQU 0 goto syntax
if exist %of% del /q /f %of%
set /a cnt=%skip%
set fl=%1
if %skip% EQU 0 (
   for /f "tokens=*" %%a in ('type %fl%') do set ln=%%a&call :str %*
) ELSE (
   for /f "tokens=* skip=%skip%" %%a in ('type %fl%') do set ln=%%a&call :str %*
)
if not exist %of% @echo.>%of%
endlocal
goto :EOF
:syntax
@echo Syntax: SkipStrip input output skip strippos striplen \[strippos2 striplen2 .....stripposn striplenn\]
endlocal
goto :EOF
:str
set /a cnt=%cnt% + 1
set ou=
:str1
call :str3 %4 %5>nul 2>&1
if \{!xx!\}</a></h1>\{\} @echo command symbols or nul characters in line %cnt%
if "%csv%" EQU "N" goto nocsv
set yy=!xx!#@#
:space
set zz=%yy%
set yy=%yy:   #@#=#@#%
set yy=%yy:  #@#=#@#%
set yy=%yy: #@#=#@#%
if not "%yy%" EQU "%zz%" goto space
set xx=%yy:#@#=%
if not \{!ou!\}<h1><a name="_set_ou_ou_set_ou_ou_xx_goto_common_nocsv_set_ou_ou_xx_common_set_xx_shift_shift_if_4_">\{\} set ou=!ou!,
set ou=!ou!"!xx!"
goto common
:nocsv
set ou=!ou!!xx!
:common
set xx=
shift
shift
if \{%4\}</a></h1>\{\} goto str2
set /a stripp=%4
if not %stripp% EQU %4 goto syntax
set /a stripl=%5
if not %stripl% EQU %5 goto syntax
if %stripl% EQU 0 goto syntax
goto str1
:str2
@echo !ou!>>%of%
goto :EOF
:str3
for /f "Tokens=*" %%b in ('@echo !!ln:~%1^,%2!!') do set xx=%%b