Home: Perl Programming Help: Advanced:
need help for filtering data of file



mojo
New User

Aug 24, 2012, 12:13 AM


Views: 7653
need help for filtering data of file

I am getting huge data in the form of a table from database. first column containd unique ID and third column contains some other id. this data is stored in a file
now I want to arrange this data based on the first column id (unique id). Is there any in built library or module that can help

Thanks in advance


BillKSmith
Veteran

Aug 24, 2012, 9:12 AM


Views: 7620
Re: [mojo] need help for filtering data of file

Refer to the section on Schwartzian Transform in the FAQ perldoc -q sort
Good Luck,
Bill


Laurent_R
Veteran / Moderator

Aug 25, 2012, 2:17 AM


Views: 7602
Re: [mojo] need help for filtering data of file

I understand that you want to sort the data according to the first column, which contains unique IDs. A simple sort (the default ASCIIbetical sort) should do it, without the need of a Schwarzian Transform.


BillKSmith
Veteran

Aug 25, 2012, 7:57 AM


Views: 7591
Re: [Laurent_R] need help for filtering data of file

True, but the OP specified "huge data". Depending on how the database table is organized in perl, the transform could be much faster.
Good Luck,
Bill