On 1/30/2016 1:03 AM, Christian Gollwitzer wrote:
Am 30.01.16 um 05:58 schrieb Random832:
On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote:
awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
perl -e 'print reverse<>' input_file
Well, both of those read the whole file into memory - ta
Christian Gollwitzer writes:
> Am 30.01.16 um 05:58 schrieb Random832:
>> On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote:
>>> awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
>>> perl -e 'print reverse<>' input_file
>>
>> Well, both of those read the whole file into memory - tac is so
Am 30.01.16 um 08:56 schrieb Jussi Piitulainen:
Christian Gollwitzer writes:
Am 30.01.16 um 05:58 schrieb Random832:
On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote:
awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
perl -e 'print reverse<>' input_file
Well, both of those read th
Christian Gollwitzer wrote:
> Am 30.01.16 um 05:58 schrieb Random832:
>> On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote:
>>> awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
>>> perl -e 'print reverse<>' input_file
>>
>> Well, both of those read the whole file into memory - tac is som
On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote:
> Hi all,
>
> I can use the following methods for mimicking tac command bellow:
>
> awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
> perl -e 'print reverse<>' input_file
Well, both of those read the whole file into memory - tac is so
Hi all,
I can use the following methods for mimicking tac command bellow:
awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
perl -e 'print reverse<>' input_file
Is it possible to do the same thing with python?
Regards
--
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :
On Fri, 29 Jan 2016 23:58:38 -0500, Random832 wrote:
> python <(echo 'import sys;print("".join(reversed(list(sys.stdin')
Why do you write it as follows:
cat input_file | python -c 'import sys;print("".join(reversed(list
(sys.stdin'
Regards
--
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ]
Am 30.01.16 um 05:58 schrieb Random832:
On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote:
awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
perl -e 'print reverse<>' input_file
Well, both of those read the whole file into memory - tac is sometimes
smarter than that, but that makes fo
On Sat, Jan 30, 2016 at 3:46 PM, Hongyi Zhao wrote:
> I can use the following methods for mimicking tac command bellow:
>
> awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file
> perl -e 'print reverse<>' input_file
>
> Is it possible to do the same thing with python?
python -c 'import sys;