Arragement of vectors and matrix in text file

المشرف العام

Administrator
طاقم الإدارة
My ASCII file has a vector of latitudes, and the indices of those latitude values tie latitude values to the data sharing the same index.

That is, if given:

latitude[x=0,1,2,3] = 10, 20, 30, 40

longitude[y=0,1,2] = 15, 25, 35

pressure[z=0,1] = 1000, 950

Then GPHeight_A[z][x] = var_0, var_1, var_2 provides that variable for 3 longitudes, whose pressure and latitude are identified by z and x respectively.

So GPHeight_A[0,0] = a, b, c means for this simple example

a longitude is 15, pressure is 1000, latitude is 10

b longitude is 25, pressure is 1000, latitude is 10

c longitude is 35, pressure is 1000, latitude is 10

Whereas GPHeight_A[1,3] = d, e, f means for this simple example

d longitude is 15, pressure is 950, latitude is 40

e longitude is 25, pressure is 950, latitude is 40

f longitude is 35, pressure is 950, latitude is 40

There are 20 such columns(representing longitude value) in corresponding to each latitude. I want to mange this text file to such text file. Which consist on three columns. First column is latitude and second is longitude corresponding to third column is value of these lat and log from the text file.

Range of latitude and longitude for which i have this data are (22-39N,60-79E).

Please guide me how can i arrange this data according to my requirement.

Thanks in advance for this kind effort.

This is the text file

GPHeight_A[0][0], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][1], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][2], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][3], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][4], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][5], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][6], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][7], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][8], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][9], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][10], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][11], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][12], -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, 28, 28, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][13], 27, 34, 38, 37, 33, 35, 33, 35, 25, 24, 32, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][14], 29, 33, 35, 33, 34, 36, 36, 36, 30, 29, 35, 36, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][15], 30, 33, 32, 34, 33, 33, 34, 36, 39, 38, 39, 41, 45, -9999, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][16], 32, 32, 35, 36, 34, 36, 35, 36, 38, 45, 47, 45, 46, 52, -9999, -9999, -9999, -9999, -9999, -9999GPHeight_A[0][17], 34, 36, 37, 37, 38, 39, 40, 42, 41, 45, 57, 50, 50, 54, -9999, -9999, -9999, -9999, -9999, -9999

أكثر...
 
أعلى