1.

Solve : dos edit help please?

Answer»

Hey all :-?

in a batch file when you edit a file using the dos EDITOR how can you go to the bottom of that file in the program

the file is huge

thanks .... What about End or Page Down repeatedly?that would work but I was hoping for something in the batch file that would just take me to the end

thanks :-?I'm not sure I understand the question. If you pull it up in the DOS EDIT command there is going to be some user interaction required anyway. Are you TRYING to automate something - like add text at the end of the file? Or view the last few lines? If you can give a better understanding of your desired outcome, that would help.view text in the last few linesIf you are running this in a command prompt under Windows 2000/XP/2003, you can add the following lines to replace your "EDIT":
Code: [Select]set /a number=10
if not {%2}=={} set /a number=%2
for /f %%i in ('find /v /c "" ^< %file%') do set /a lines=%%i
@echo %lines% lines in file %file%.
if %number% GEQ %lines% set /a start=0&GOTO console
set /a start=%lines% - %number%
:console
more /e +%start% %file%
This assumes you want the last 10 lines displayed, and the filename you want to display is contained in the environment variable called "file". You can change the number of lines in the "number" variable. If you need to process more in your batch file after doing this, then replace the "goto console" command with "call :console" and add a "goto :EOF" after the "more" command at the end.

Let me know if you don't understand or need more help.thank you



Discussion

No Comment Found