Solved Rearranging lines with batch..?

Hewlett-packard / Pavilion touchsmart amd a...
January 4, 2014 at 13:35:38
Specs: Any Windows OS, 8GB
Hi, so I know I've been asking a lot of questions of a similar topic to you guys, but I'm 2 small steps away from completing my A.I. Chat Bot which can learn from past user experiences, and has passed 2 IQ tests receiving a score of 98 the first time and 138 the second time after more learning! (average human intelligence is 100)

PROBLEM: I need to move the bottom line of a text file down to the next line using batch, thanks!

See More: Rearranging lines with batch..?

Report •

January 5, 2014 at 10:25:15
✔ Best Answer
"Specs: Any Windows OS, 8GB"

This will work with NT5-like win; as long as the file has no blank lines.

::====== script starts here ===============
:: move bottom line down
:: Danm992.bat 2014-01-05 22:21:04.10
@echo off > NEWFILE & setLocal enableDELAYedeXpansioN

set/a T=0 & set/a N=0 & call :sub1

for /f "tokens=* delims= " %%a in (myfile) do (
set/a N+=1
if !N! equ !T! (
) else (
goto :eof

for /f "tokens=* delims= " %%i in (myfile) do (
set/a T+=1
goto :eof
::====== script ends here =================

M2 Golden-Triangle

Report •

January 17, 2014 at 14:36:23
The line in the bottom is already the last, how do you move that, one down ?

Hi there.

Report •

January 18, 2014 at 02:58:48
Does that mean you don't understand the bat?

Or you tried it and it didn't work?

Or you didn't try it?

Or what?

M2 Golden-Triangle

Report •
Related Solutions

Ask Question