[32951] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4227 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 31 16:09:17 2014

Date: Sat, 31 May 2014 13:09:02 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 31 May 2014     Volume: 11 Number: 4227

Today's topics:
    Re: sorting file according to a unicode column ehabaziz2001@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 31 May 2014 13:03:29 -0700 (PDT)
From: ehabaziz2001@gmail.com
Subject: Re: sorting file according to a unicode column
Message-Id: <bf37c7fa-2af7-48ef-86e8-5dad4e68cbe9@googlegroups.com>

Here it is the whole program after your modifications :
-------------------------------------------------------

use encoding 'utf8';=20
my @File;=20
my %Positions_and_lenghts =3D (=20
9 =3D> 200 ,=20
);=20



#For external file=20
open FILE, '>:utf8', 'F:\programs\sedawk\xerox_scripts\AlexBank\logs\all_cy=
cle_data.sorted' or die "$^E\n";=20
binmode STDOUT, ':utf8';=20


while (my $line =3D <DATA>) {=20

my @lines;=20
while (<DATA>) {chomp; push @lines, [split /\|/, $_,-1]}=20

foreach(sort { $a->[9] cmp $b->[9] } @lines) {print "@{$_}\n"}=20
    push @{$row}, substr $line, $POS, $Positions_and_lenghts{$POS}=20
    }=20
push @File, $row=20


}=20

Here is a sample of my long line (Required sorted field is fld2 pos9,length=
200):
---------------------------------------------------------------------------=
---
    514|- =D8=B4=D8=B1=D9=83=D9=87 =D9=85=D8=A7=D9=86=D8=AA=D8=B1=D8=A7=D9=
=83                                                                        =
                                                                           =
                            | 20206105400|0  |0  |0  |=D8=B3=D8=B9=D8=AF =
=D8=B2=D8=BA=D9=84=D9=88=D9=84                                             =
                                                          |CORPORATE=D8=AD=
=D8=B3=D8=A7=D8=A8 =D8=AC=D8=A7=D8=B1=D9=8A                                =
                 |YTMPW-bEUcE5a.RPT               |EGYPT ALEXANDRIA ALEXAND=
RIA =E2=80=8F=E2=80=8F =E2=80=8F=D8=A7=D9=84=D9=83=D9=8A=D9=84=D9=8828  =D8=
=A7=D9=84=D8=B9=D8=A7=D9=85=D8=B1=D9=8A=D9=87 =D8=A7=D9=84=D8=A7=D8=B3=D9=
=83=D9=86=D8=AF=D8=B1=D9=8A=D9=87
=20



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 4227
***************************************


home help back first fref pref prev next nref lref last post