public static IEnumerable <GeonamesCountryEntity> ParseToEnumerable(string path)
        {
            using (var file = new StreamReader(path))
            {
                string line;

                while ((line = file.ReadLine()) != null)
                {
                    if (string.IsNullOrWhiteSpace(line))
                    {
                        continue;
                    }

                    if (line.TrimStart().StartsWith("#"))
                    {
                        continue;
                    }

                    var parse  = line.Split(new char[] { '\t' });
                    var entity = GeonamesCountryEntity.Parse(parse);

                    yield return(entity);
                }
            }
        }
        public static GeonamesCountryEntity Parse(string[] parts)
        {
            var entity = new GeonamesCountryEntity();

            if (parts.Length != 19)
            {
                throw new ArgumentException("Expecting 19 columns as input");
            }

            int geonameId;

            if (int.TryParse(parts[16], out geonameId))
            {
                entity.Id = geonameId;
            }
            else
            {
                throw new ArgumentException("Could not parse Geonames ID");
            }

            entity.ISOCode        = parts[0];
            entity.ISO3Code       = parts[1];
            entity.ISONumericCode = parts[2];
            entity.FIPSCode       = parts[3];
            entity.Name           = parts[4];
            entity.Capital        = parts[5];

            uint areaSqKm;

            if (uint.TryParse(parts[6], out areaSqKm))
            {
                entity.AreaSqKm = areaSqKm;
            }

            uint population;

            if (uint.TryParse(parts[7], out population))
            {
                entity.Population = population;
            }

            entity.ContinentCode = parts[8];
            entity.TLD           = parts[9];
            entity.CurrencyCode  = parts[10];
            entity.CurrencyName  = parts[11];

            short countryCallingCode;

            if (short.TryParse(parts[7], out countryCallingCode))
            {
                entity.CountryCallingCode = countryCallingCode;
            }

            entity.PostalCodeFormat     = parts[13];
            entity.PostalCodeRegex      = parts[14];
            entity.Languages            = parts[15].Trim().Split(',').ToList();
            entity.NeighboringCountries = parts[17].Trim().Split(',').ToList();
            entity.EquivalentFIPSCode   = parts[18];

            return(entity);
        }