TCOONlist={
(* 1 *) "Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\8779770_Port_Isabel_Ike_WL.txt",
(* 2 *) "Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87704751_Port_Arthur_Ike_WL.txt",
(* 3 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87705201_Rainbow_Bridge_Ike_WL.txt",
(* 4 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87705701_Sabine_Pass_Ike_WL.txt" ,
(* 5 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87706131_Morgans_Point_Ike_WL.txt",
(* 6 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87707771_Manchester_Houston_Ike_WL.txt",
(* 7 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87708221_Texas_Point_Ike_WL.txt" ,
(* 8 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87709711_Rollover_Pass_Ike_WL.txt" ,
(* 9 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87710130_Eagle_Point_Ike_WL.txt" ,
(* 10 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87714501_Galveston_Pier_21_Ike_WL.txt",
(* 11 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87715101_Galveston_Pleasure_Pier_Ike_WL.txt" ,
(* 12 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87724471_USCG_Freeport_Ike_WL.txt" ,
(* 13 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87730371_Seadrift_Ike_WL.txt",
(* 14 *) "Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87732591_Port_Lavaca_Ike_WL.txt",
(* 15 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87737011_Port_OConnor_Ike_WL.txt",
(* 16 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87745131_Copano_Bay_Ike_WL.txt",
(* 17 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87747701_Rockport_Ike_WL.txt",
(* 18 *) "Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87751881_White_Point_Ike_WL.txt",
(* 19 *) "Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87752221_Viola_Turning_Basin_Ike_WL.txt",
(* 20 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87752371_Port_Aransas_Ike_WL.txt",
(* 21 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87752831_Ingleside_Ike_WL.txt",
(* 22 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87752961_Texas_State_Aquarium_Ike_WL.txt",
(* 23 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87757921_Packery_Channel_Ike_WL.txt",
(* 24 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87758701_Bob_Hall_Pier_Ike_WL.txt",
(* 25 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87761391_South_Bird_Island_Ike_WL.txt",
(* 26 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87766041_Baffin_Bay_Ike_WL.txt",
(* 27 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87778121_Rincon_del_San_Jose_Ike_WL.txt",
(* 28 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87784901_Port_Mansfield_Ike_WL.txt",
(* 29 *) 
"Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\87797481_South_Padre_Ike_WL.txt"
};


numstations=Length[TCOONlist];


(* Get times for first hydrograph *)
timelist=OpenRead[TCOONlist[[1]]];
Skip[timelist,String,22];
raw=ReadList[timelist, String];
raw=StringSplit[raw];
raw=Drop[raw,-1];
LengthData=Length[raw];
dataarray={};

For[i=1,i≤LengthData,i++,

If[Length[raw[[i]]]<3,
raw[[i]]=Append[raw[[i]], "M"]
];

yearday=StringToStream[raw[[i,1]]];
SetStreamPosition[yearday,4];
day=ToExpression[Read[yearday,Number]];
yearday=StringToStream[StringDrop[raw[[i,1]],-3]];
year=ToExpression[Read[yearday,Number]];

hrmin=StringToStream[raw[[i,2]]];
SetStreamPosition[hrmin,3];
minute=ToExpression[Read[hrmin,Number]];
hrmin=StringToStream[StringDrop[raw[[i,2]],-2]];
hour=ToExpression[Read[hrmin,Number]];

dataarray=Append[dataarray,{AbsoluteTime[{year,1,day,hour,minute,0}]}];

];


(* Extract data from hydrographs *)

For[i=1, i≤numstations, i++,

datalist=OpenRead[TCOONlist[[i]]];
Skip[datalist,String,22];
raw=ReadList[datalist, String];
raw=StringSplit[raw];
raw=Drop[raw,-1];
LengthData=Length[raw];

For[j=1,j≤LengthData,j++,

If[Length[raw[[j]]]<3,
raw[[j]]=Append[raw[[j]], ToExpression[M]]
];

dataarray[[j]]=Append[dataarray[[j]],ToExpression[raw[[j,3]]]];

];

];

Export["Z:\\CHL-Archive-Projects\\Texas-Studies\\Hydro-observations\\StormSurge-data\\2008-Ike\\Observations-sourcedata\\TCOON-Permanent-Hydrographs\\TCOON_data_matrix.txt",dataarray,"Table"];

numstations