Okay, now you're reminding of some UNIX command ('head', I think) where
you printed to stdout the first n lines. The 'tail' command printed the
last n lines to stdout (where n = 1). But you'd have to remove the last
1 line from the source file as you prepended it into a new file. Hard
to remember back 12 years ago when was the last time I got stuck having
to do testing on UNIX hosts (AIX, HP-UX, Solaris, SCO, Redhat, SuSE).
Aha, I just Googled on the syntax for 'tail'. You can use the -r
parameter to:
Reverse. Copies lines from the specified starting point in the file in
reverse order. The default for r is to print the entire file in
reverse order.
I doubt the OP wants to install Cygwin to see if it includes the 'tail'
command so he can print (to stdout which can be redirected into a new
file) his source file in reverse order. Alternatively, and instead of
using an emulation layer as does Cygwin to port UNIX commands into
Windows system calls, GNU Utilities for Win32 tries to provide C-coded
programs using the UNIX filenames to do similar functions in
Windows/DOS; see
http://sourceforge.net/projects/unxutils/. Doesn't
look to have been updated since 2003. After unzipping, it eats up only
10MB on the hard disk. Alas, like many ports to make a UNIX run native
on Windows, it's not a complete port. I didn't see -r was a support
switch. Maybe Cygwin is more complete. Microsoft had some UNIX for
Windows package but I never looked at it and am not sure about its name.
Microsoft include tail.exe in their Win2003 Resource Kit at
http://www.microsoft.com/download/en/details.aspx? displaylang=en&id=17657.
Never used it so I don't know if it supports the -r switch.
I haven't done any Powershell scripting. Powershell is one of those
non-critical updates that Microsoft pushed via Windows Updates so most
users have it. Since it's a scripting language, maybe you can define a
for-loop to read the nth line of a file to append to an output file
except n would decrement from whatever was the length of the file. There
is a newsgroup at microsoft.public.windows.powershell but it looks
pretty dead. There's also Microsoft's crappy web-based forums, like
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/