Home
> Uncategorized > Parsing WindJet routes
Parsing WindJet routes
Probobly a particularly niche field, but I just developed some code to parse airline routes from the website VolaWindJet.
private
string GetWindJetRoutes(string HTML){
string outRoutes = ""; // Step 1. Delete between FL_Departure> and /SELECT string strOutboundRoutes = DeleteBetween(HTML,"FL_Departure>","/SELECT");MatchCollection mcDepIata = Regex.Matches(strOutboundRoutes,"value=(?<FromIata>[A-Z]{3})");
// Step 2. extract ToIata Array string strRegex = @"arrayVoli[(?<IDFrom>d+)][(?<IDTo>d+)]=new.Option(‘w.*'(?<ToIata>w{3})";MatchCollection mcDestIata = Regex.Matches(HTML,strRegex);
for(int iMatch=0;iMatch<mcDestIata.Count;iMatch++){
int intIDFrom = Convert.ToInt32(mcDestIata[iMatch].Groups["IDFrom"].Value); string strFromIata = mcDepIata[intIDFrom-1].Groups["FromIata"].Value; string strToIata = mcDestIata[iMatch].Groups["ToIata"].Value;outRoutes += "’" + strFromIata + "’,’" + strToIata + "’rn";
}
return outRoutes;}
Might be of interest to someone out there…. (or if not, my own personal reference)
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback