The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-20-2007
wizardy_maximus wizardy_maximus is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 3
Thumbs up Script to sort data

Hi All,

I have a .csv file with 3 columns called nLats, nLongs, and fRes. in following format :

"nLats","nLongs","fRes"
0,0,-1
0,1,-1
0,2,-1
0,3,-1
0,4,-1
.........
.........
0,143,-1 nLats increments at nLongs=143
1,0, -1
1,1, -1
..........
..........
1,143,-1
2,0,-1
2,1,-1
.........
.........
2,143,-1

Goes till nLats = 71.
I wish to sort fRes value in nLats*nLons Array, ie an array of 72*144.

(nLats 1st) -1 -1 -1 -1 -1......................-1
.............................................
.............................................
.............................................
(nLats 72nd)-1 -1 -1 -1 -1.....................-1
the max value of nLats=71 starting from 0, ie 72 rows
the max value of nLongs=143 starting from 0, ie 144 columns.

How shall I proceed???

Thanks all,
wiz_max