#!/bin/csh # Execute this file in unix to create links (alternate names) for files with # obscure numerical names. # For example, the file 36373_prf.xy will get an alternate name w39_prf.xy # File names range from w01 to w39 and e01 to e31, running north to south. # This program was based on the table in the asciii file "value_side_order_xy". # This program now handles only files that end in xy. It can be easily # modified by altering the regular expression in the second "foreach" line, # or by adding another expression sepated by a space, # .e.g. foreach fil (${old}_*xy ${old}*\.gen) # There is a potential for the creation of extra links because of confusion of # basin 1243 and basin 12431. foreach pair (12431,w18 11041,e05 12139,e06 12486,e07 13270,e08 13008,e09 13898,e10 13989,e11 14801,e12 14714,e13 14859,e14 15468,e15 15791,e16 16174,e17 16003,e18 16311,e19 17273,e20 17966,e21 18959,e22 26022,e23 27789,e24 28549,e25 29406,e26 30808,e27 31828,e28 35468,e29 36035,e30 36619,e31 2998,e01 6283,e02 6890,e03 6831,e04 553,w01 1243,w02 2877,w03 2993,w04 3064,w05 3223,w06 3791,w07 4368,w08 4687,w09 5098,w10 6328,w11 7101,w12 7378,w13 10656,w14 11654,w15 11716,w16 12261,w17 12761,w19 13384,w20 13907,w21 16238,w22 16352,w23 16563,w24 17051,w25 16322,w26 17641,w27 20340,w28 24010,w29 25788,w30 28452,w31 29125,w32 16380,w33 29048,w34 29499,w35 35371,w36 35856,w37 36289,w38 36373,w39) set old = `echo $pair | sed 's/,.*//'` set new = `echo $pair | sed 's/.*,//'` foreach fil (${old}_*xy) echo creating link `echo $fil | sed "s/$old/$new/"` to $fil ln -s $fil `echo $fil | sed "s/$old/$new/"` end end