0

I'm New to Batch script and i'm trying to remove the last blank line from .dat file but i'm not succeed and i tried many steps but no luck. please help me to achieve this ..

below are the commands i tried:

findstr . Efor_17112016.dat> Eform1_17112016.dat
(for /f "delims=" %%a in ('type "Efor_17112016.dat"') do echo %%a)>"Efor1_17112016.dat"
findstr.exe /r "." <Efor_17112016.dat> Efor1_17112016.dat
findstr /V /R /B /E /C:" *" "Efor_17112016.dat">"E:\Staging\LandingArea\Efor1_17112016.dat"
aschipfl
  • 33,626
  • 12
  • 54
  • 99
s jobmail
  • 1
  • 1
  • 2
    Could you clarify your request. Do you want to read the entire content of the dat file noting each line with 'no data' then remove the last of them? Or do you want to remove the last line which appears always to include 'no data'. _For informational or search purposes look for CR LF instead of blank_. – Compo Nov 22 '16 at 11:03
  • 1
    [related question](http://stackoverflow.com/questions/40694797/prevent-bat-file-from-leaving-blank-line-in-the-end-while-creating-another-bat) – Stephan Nov 22 '16 at 18:19

0 Answers0