V
vlsidesign
-- Looking for ideas to get me going --
I want to 'sort lines of file based on a numeric field of each line'.
I was looking for some ideas on how to approach this.
Basically, each line in the file is in this format:
pad_cell xcoord ycoord label_name
For example,
pad_cell 30 30 vdd
pad_cell 30 1000 vss
pad_cell 30 500 data1
pad_cell 60 30 vdd
pad_cell 500 30 vss
pad_cell 350 30 data2
etc....
Program usage: I am trying to sort a computer chip pad order list in a
file. My sort is basically done by assign top left corner as PAD1 and
going around counter clockwise. Anyway, the file I have is out of order
and I want to sort it.
------------------------------------------------------------------------------
P.S.
I am familiar with basics like split, join, regex (using parenthesis to
retain parts in memory). Anything more exotic needed I am willing to
lookup and study in an Oreilly book or elsewhere. However, I am just on
limited time schedule, and wanted to get good direction first. I
haven't used PERL yet for numeric sorting (I usually use the plan unix
'sort' utility, but I think Perl will better handle this case
I want to 'sort lines of file based on a numeric field of each line'.
I was looking for some ideas on how to approach this.
Basically, each line in the file is in this format:
pad_cell xcoord ycoord label_name
For example,
pad_cell 30 30 vdd
pad_cell 30 1000 vss
pad_cell 30 500 data1
pad_cell 60 30 vdd
pad_cell 500 30 vss
pad_cell 350 30 data2
etc....
Program usage: I am trying to sort a computer chip pad order list in a
file. My sort is basically done by assign top left corner as PAD1 and
going around counter clockwise. Anyway, the file I have is out of order
and I want to sort it.
------------------------------------------------------------------------------
P.S.
I am familiar with basics like split, join, regex (using parenthesis to
retain parts in memory). Anything more exotic needed I am willing to
lookup and study in an Oreilly book or elsewhere. However, I am just on
limited time schedule, and wanted to get good direction first. I
haven't used PERL yet for numeric sorting (I usually use the plan unix
'sort' utility, but I think Perl will better handle this case