3
Line 1
Line 2
Line 3
Line 4
Line 5
should become
Line 5
Line 4
Line 3
Line 2
Line 1
I need a notepad script to do this.
3
Line 1
Line 2
Line 3
Line 4
Line 5
should become
Line 5
Line 4
Line 3
Line 2
Line 1
I need a notepad script to do this.
7
If you have Perl installed you can use
perl -e 'print reverse <> ' filename > newfile
As in
$ cat file.txt
line 1
line 2
line 3
line 4
line 5
$ perl -e 'print reverse <>' file.txt > new.txt
$ cat new.txt
line 5
line 4
line 3
line 2
line 1
(its the same on Windows but use type
instead of cat
and use double-quotes (") in the perl
command.)
You have tagged your question "notepad" and mentioned "notepad" in the text. If you want a solution using "notepad++", you should edit the question accordingly.
4
This is a three step process in Notepad++ using TextFX.
TextFX Tools -> Insert Line Numbers
.TextFX Tools -> +Sort ascending
is unchecked and then select TextFX Tools -> Sort lines case sensitive (at column)
. This will reverse the order of the lines.TextFX Tools -> Delete Line Numbers or First Word
, and you're done.The Notepad app that ships with Windows is pretty much useless. There are many alternatives, but I prefer Notepad++.
3
Notepad, unless you mean some other than the one that comes with Windows OS, is not scriptable. Were you to use Vim, it would be simply
:g/^/m0
0
You could try tac which reverses line by line
tac filename
0
If you were after a ready made script, the script center has one contributed by the community (i.e. not written by Microsoft)
http://gallery.technet.microsoft.com/scriptcenter/55ba15dc-9933-4c9d-a2b0-524453a66343
Notepad is not scriptable, is it? – user1686 – 2011-12-12T18:32:14.960