ÐÂÊÖÔÚÏß¼±ÎÊSHELL£¬Ð»Ð»£¡
ÎļþÄÚÈÝÈçÏ£¨×îºóÒ»ÐÐÊÇÎļþ»»ÐУ©£º00000346130
00000346131
20070209|000020|0000016782000|01|
ÎÒÏÖÔÚÏë°Ñ¡°20070209|000020|0000016782000|01|¡±·Åµ½µÚÒ»ÐУ¬ÐèÒªµÄ½á¹ûÈçÏ£º
20070209|000020|0000016782000|01|
00000346130
00000346131
ÇëÎÊÔÚLINUX»òUNIXÓÐʲôÃüÁî»ò·½·¨ÊµÏÖÄØ£¿ÏÈлл£¡ I do not find a simple way using bash ...
[php]
huan@huan:~/test$ cat process.pl
#! /usr/bin/perl -w
use Tie::File;
my @arr;
tie @arr, 'Tie::File', shift or die $@;
my $cnt = scalar @arr;
($arr[0], $arr[$cnt - 2]) = ($arr[$cnt - 2], $arr[0]);
huan@huan:~/test$ cat txt
00000346130
00000346131
20070209|000020|0000016782000|01|
huan@huan:~/test$ perl process.pl txt
huan@huan:~/test$ cat txt
20070209|000020|0000016782000|01|
00000346131
00000346130
huan@huan:~/test$
[/php] лл°ßÖñ!!!
Ò³:
[1]