anixe_csv 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in anixe_csv.gemspec
4
+ gemspec
5
+
6
+ gem 'riot', :group => "test"
7
+
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+ Dir["**/*.rake"].each {|ext| load ext}
data/anixe_csv.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "anixe_csv/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "anixe_csv"
7
+ s.version = AnixeCsv::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Piotr Zolnierek"]
10
+ s.email = ["pz@anixe.pl"]
11
+ s.homepage = ""
12
+ s.summary = %q{Read and write Csv files, easily}
13
+ s.description = %q{as above}
14
+
15
+ s.rubyforge_project = "anixe_csv"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
@@ -0,0 +1,100 @@
1
+ "HotelId"|"HotelName"|"ExclusiveDeal"|"CheckInHour"|"CheckOutHour"|"TotalRoomsInHotel"|"ThumbnailPath"|"ShortDescription"|"HotelCurrency"|"Stars"|"Address"|"AddressZip"|"AddressCity"|"Location"|"StateCode"|"State"|"CountryCode"|"CountryName"|"Longitude"|"Latitude"|"sDestination"|"sHotelCityName"|"DestinationId"|"Provider"|"Phone"|"Fax"|"NearestAirportIATACode"|"RefDirection"|"RefPointDist"|"DistUnit"|"TimeStamp"|"ProductStatus"
2
+ 1226415|"Rodeway Inn"|0|15|11|"28"|"http://image1.urlforimages.com/1226415/exterior_Thumbnailed.jpg"|"Providing guests with exceptional service at an affordable price. "|"USD"|"1"|"1503 South Atlantic Ave"|"32118"|"Daytona Beach"|""|"FL"|"Florida"|"US"|"USA"|-80.99922800000000|29.20859100000000|"DAB"|"Daytona Beach"|3001|"localTgsProvider"|"3862553617"|"3862554838"|"DAB"|"S"|8.00|"Mile"|2010-05-28 11:25:06.530000000|"New"
3
+ 1226417|"Douar al Hana & Spa"|0|15|12|"70"|"http://image1.urlforimages.com/1226417/main_Thumbnailed.jpg"|"Experience the local culture and attractions of this beautiful location. "|"MAD"|"4"|"Melk Dahman Rehamna Sud lieu Dit Zaouia Ben Sassi Cercle El-Bour"|"40000"|"Marrakech"|""|""|""|"MA"|"Morocco"|-7.99899077757920|31.62756661214840|"RAK"|"Marrakech"|6432|"localTgsProvider"|"2120524328627"|"2120524329815"|"RAK"|"NE"|25.00|"Km"|2010-05-25 11:48:30.943000000|"New"
4
+ 1226443|"Hotel Versan"|0|15|11|"34"|"http://image1.urlforimages.com/1226443/exterior_Thumbnailed.jpg"|"Ensuring guests a stay that is both productive and comfortable; the Hotel Versan provides every comfort and amenity "|"EUR"|"2"|"3 rue jean lecanuet"|"76000"|"Rouen"|""|""|""|"FR"|"France"|1.09800434894174|49.44363353379020|"URO"|"Rouen"|8767|"localTgsProvider"|"33235077707"|"33235700467"|"URO"|"SE"|11.00|"Km"|2010-05-27 09:53:58.100000000|"New"
5
+ 1226468|"Apartamentos Estelar Medellin"|0|15|11|"53"|"http://image1.urlforimages.com/1226468/exterior_Thumbnailed.jpg"|"Apartamentos Estelar Medellin is equally convenient to those here on business and those here for pleasure "|"USD"|"4"|"Cra. 43 B No. 8 sur -10"|"0000"|"Medellin"|""|""|""|"CO"|"Colombia"|-75.58009346836890|6.24495977890584|"MDE"|"Medellin"|6549|"localTgsProvider"|"5746041544"|"5746041548"|"EOH"|"S"|.00|"Km"|2010-05-28 10:17:45.933000000|"New"
6
+ 1226509|"AS Hotel Monza"|0|15|11|"66"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Whatever your reason for visiting; AS Hotel Monza ensures that your vacation will be a memorable one "|"EUR"|"4"|"Viale Lombardia 76/78"|"20052"|"Monza"|""|""|""|"IT"|"Italy"|9.30741767347998|45.56653470804040|"LIN"|"Monza"|18611|"localTgsProvider"|"039272831"|"03927283200"|"LIN"|"S"|30.00|"Km"|2010-06-01 11:57:06.723000000|"NEW"
7
+ 1226521|"Cambay Spa & Resort Jaipur"|0|15|11|"99"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Superior accommodations and fabulous service meet all your business and leisure needs "|"INR"|"5"|"SP-36B RIICO Industrial Area; Delhi-Jaipur Highway; Kukas"|"303101"|"Jaipur"|""|""|""|"IN"|"India"|||"JAI"|"Jaipur"|4821|"localTgsProvider"|"+99 09953682"|"+99 09953682"|"JAI"|"E"|27.00|"Km"|2010-06-03 09:53:47.623000000|"NEW"
8
+ 1226664|"Rodeway Inn Gardena/LA"|0|15|11|"50"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"USD"|"2"|"15607 S. Normandie Ave."|"90247"|"Gardena"|""|"CA"|"California"|"US"|"USA"|||"LAX"|"Gardena"|12374|"localTgsProvider"|"+ 1 310 516 8701"|"+ 1 310 327 6943"|"LAX"|"S"|10.00|"Mile"|2010-06-04 16:25:17.123000000|"NEW"
9
+ 1226452|"Candlewood Suites"|0|15|11|"84"|"http://image1.urlforimages.com/1226452/main_Thumbnailed.jpg"|"Comfortable and classic; the Candlewood Suites is sure to feel like your home away from home "|"USD"|"5"|"2930 Pineda Plaza Way"|"32940"|"Melbourne"|""|"FL"|"Florida"|"US"|"USA"|-80.66789000000000|28.20379200000000|"MLB"|"Melbourne"|6569|"localTgsProvider"|"3218219009"|"3218219010"|"MLB"|"SW"|9.00|"Mile"|2010-05-27 09:48:58.343000000|"New"
10
+ 1226467|"Atlantic Inn"|0|15|11|"26"|"http://image1.urlforimages.com/1226467/exterior_Thumbnailed.jpg"|"World famous beaches and local attractions are within reach when you stay as a special guest "|"USD"|"2.5"|"2900 N A1A"|"32903"|"Indialantic"|""|"FL"|"Florida"|"US"|"USA"|-80.57940000000000|28.13219100000000|"MCO"|"Indialantic"|19369|"localTgsProvider"|"3217799994"|"3218219010"|"MCO"|"SW"|5.00|"Mile"|2010-05-28 10:45:31.387000000|"New"
11
+ 1226519|"Piao Home Inn Qian Men"|0|15|11|"60"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Providing guests with exceptional service at an affordable price. "|"CNY"|"2"|"17 han Jia Hu Tong; West Street; Zhu Shi Kou"|""|"Beijing"|"Xuanwu"|""|""|"CN"|"China"|||"BJS"|"Beijing"|1589|"localTgsProvider"|"+86 1063177878"|"+86 1063027178"|"PEK"|"NW"|35.00|"Km"|2010-06-03 11:10:58.513000000|"NEW"
12
+ 1226536|"Moevenpick Resort & Thalasso Crete"|0|15|11|"285"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Picturesque beaches provide the beautiful setting at Moevenpick Resort & Thalasso Crete where you can really escape "|"EUR"|"5"|"Andrea Papandreou 72; Gazi ;"|"71414"|"Heraklion"|""|""|""|"GR"|"Greece"|25.13414162671040|35.33804980328490|"HER"|"Heraklion"|4414|"localTgsProvider"|"+30 28 103 77 000"|"+ 30 28 102 50 669"|"HER"|"W"|11.00|"Km"|2010-06-03 10:26:24.127000000|"NEW"
13
+ 1226540|"Hotel Savoia and Jolanda"|0|15|11|"51"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Close to major attractions and city excitement; we invite you to be our guest "|"EUR"|"4"|"Castello 4187 Riva Degli Schiavoni"|"30122"|"Venice"|"San Marco"|""|""|"IT"|"Italy"|12.34263933496510|45.43386852869660|"VCE"|"Venice"|744|"localTgsProvider"|"+39 04 152 0644"|"+39 04 152 07 494"|"VCE"|"E"|7.00|"Km"|2010-06-03 13:47:12.337000000|"NEW"
14
+ 1226560|"Dionysos Mykonos Hotel"|0|15|11|"45"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Have an amazing vacation that you will remember for years to come! "|"EUR"|"4"|"Ornos Beach"|"846000"|"Mykonos"|""|""|""|"GR"|"Greece"|23.74103746057440|38.30097903504730|"JMK"|"Mykonos"|11550|"localTgsProvider"|"+30 22 89027220"|"+30 22 89023402"|"JMK"|"N"|3.00|"Km"|2010-06-04 12:30:54.747000000|"NEW"
15
+ 1226634|"Sonora Days Inn"|0|15|11|"63"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"USD"|"2"|"160 So. Washington St."|""|"Twain Harte"|""|"CA"|"California"|"US"|"USA"|||"SAC"|"Sonora"|11568|"localTgsProvider"|"+ 1 209 532 2400"|"+ 1 209 532 4542"|"SAC"|"SW"|147.00|"Mile"|2010-06-03 17:53:02.530000000|"NEW"
16
+ 1226662|"Novotel Accra City Centre"|0|15|16|"190"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"4"|"Barnes Road"|""|"Accra"|""|""|""|"GH"|"Ghana"|-.20000000000000|5.55800000000000|"ACC"|"Accra"|52|"localTgsProvider"|"+233 21 667 533"|"+233 21 667 533"|"ACC"|"N"|8.00|"Km"|2010-06-04 15:02:03.010000000|"NEW"
17
+ 1226399|"Fullon Hotel Sanying"|0|15|11|"288"|"http://image1.urlforimages.com/1226399/exterior_Thumbnailed.jpg"|"The Fullon Hotel Sanying is ideal of either vacationing or busy travel "|"TWD"|"4"|"No. 63; Dasyue Road"|"237"|"Ta pei"|""|""|""|"TW"|"Taiwan"|||"TPE"|"Ta pei"|12581|"localTgsProvider"|"+886 286721234"|"+886 286720036"|"TPE"|"S"|30.00|"Km"|2010-05-28 17:20:24.633000000|"New"
18
+ 1226508|"Clube Praia da Rocha"|0|15|11|"487"|"http://image1.urlforimages.com/1226508/pool_Thumbnailed.jpg"|"Creating an exciting vacation experience; you will be impressed with accommodations and amenities "|"EUR"|"3"|"Avenida Comunidade Lus�ada"|""|"Algarve"|"Praia da Rocha"|""|""|"PT"|"Portugal"|-8.53891723146871|37.12152147860190|"FAO"|"Algarve"|11891|"localTgsProvider"|"+351 282 417 745"|"+351 282 485 955"|"FAO"|"W"|60.00|"Km"|2010-06-04 11:26:18.413000000|"NEW"
19
+ 1226586|"Impressa"|0|||"18"|"http://image1.urlforimages.com/1226586/exterior_Thumbnailed.jpg"|"Creating an impressive experience; the lovely Impressa surrounds its guests with style; service and local area entertainment "|"USD"|"4"|"21 Sagaidachnogo St"|""|"Kiev"|""|""|""|"UA"|"Ukraine"|30.51622900000000|50.43527500000000|"IEV"|"Kiev"|5271|"localTgsProvider"|"+38 044 206 22 00"|"+38 044 206 22 00"|"KBP"|"NE"|34.00|"Km"|2010-06-04 12:55:16.253000000|"NEW"
20
+ 1226611|"Jingyi Hotel"|0|15|11|"349"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"CNY"|"5"|"No. 9 Dazhngsi East Road"|""|"Beijing"|"Haidian"|""|""|"CN"|"China"|||"BJS"|"Beijing"|1589|"localTgsProvider"|"+86 010 621 65588"|"+86 010 82125267"|"PEK"|"NE"|30.00|"Km"|2010-06-03 13:26:32.910000000|"NEW"
21
+ 1226616|"Berjaya Tioman Resort"|0|15|11|"268"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"MYR"|"5"|"P.O. Box 4"|"86807"|"Merang"|""|""|""|"MY"|"Malaysia"|||"XKL"|"Merang"|15840|"localTgsProvider"|"+609 419 1000"|"+609 419 1718"|"XKL"|"E"|25.00|"Km"|2010-06-03 15:14:59.243000000|"NEW"
22
+ 1226633|"Novotel Abidjan"|0|15|11|"201"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"3.5"|"10 Avenue du General de Gaulle"|"3718"|"Abidjan"|""|""|""|"CI"|"Cote d'Ivoire"|-4.01644000000000|5.31600800000000|"ABJ"|"Abidjan"|33|"localTgsProvider"|"+225 20 31 8000"|"+225 20 31 8020"|"ABJ"|"N"|15.00|"Km"|2010-06-04 08:54:38.453000000|"NEW"
23
+ 1226639|"Asia Palace Hotel Hanoi"|0|15|11|"37"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"USD"|"3"|"44 Hang Tre Street-Hoan Kiem district"|"844"|"Hanoi"|""|""|""|"VN"|"Vietnam"|105.84814507717200|21.03189244516030|"HAN"|"Hanoi"|4315|"localTgsProvider"|""|""|"HAN"|"N"|35.00|"Km"|2010-06-04 09:38:30.847000000|"NEW"
24
+ 1226453|"Awwa Suites & Spa"|0|15|11|"61"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Whatever your reason for visiting; Awwa Suites & Spa ensures that your vacation will be a memorable one "|"USD"|"4"|"Lafinur 3370"|"C1425FAJ"|"Buenos Aires"|""|"BA"|"Buenos Aires"|"AR"|"Argentina"|-58.37243589232980|-34.60914226034490|"BUE"|"Buenos Aires"|2080|"localTgsProvider"|"00541139660000"|"00541139660000"|"AEP"|"W"|3.00|"Km"|2010-05-28 15:05:04.493000000|"New"
25
+ 1226525|"Cambay Beach Resort"|0|15|11|"22"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Exotic ocean breezes and unforgettable views await your stay "|"INR"|"3"|"Holiday Street; Kerkarart Gallery Lane"|"403516"|"Goa"|""|""|""|"IN"|"India"|||"GOI"|"Goa"|4015|"localTgsProvider"|"+011 83 265 16353"|"+011 83 265 16353"|"GOI"|"NE"|45.00|"Km"|2010-06-03 09:59:17.507000000|"NEW"
26
+ 1226533|"Radisson Inn Akron Fairlawn"|0|15|11|"128"|"http://image1.urlforimages.com/1226533/exterior_Thumbnailed.jpg"|"Be our guest and put our service to the test at the well known Radisson Inn Akron Fairlawn "|"USD"|"3.5"|"200 Montrose West Ave; Akron; OH 44321"|"44321"|"Akron"|""|"OH"|"Ohio"|"US"|"USA"|-81.65449000000000|41.12776000000000|"CAK"|"Akron"|11377|"localTgsProvider"|"13306669300"|"13306682270"|"CAK"|"N"|20.00|"Mile"|2010-06-02 09:49:48.343000000|"NEW"
27
+ 1226551|"Grand Hyatt Erawan Bangkok"|0|15|11|"380"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"You will find exactly what your looking for with many amenities and exciting city attractions "|"THB"|"5"|"494 Rajdamri Road"|"10330"|"Bangkok"|""|""|""|"TH"|"Thailand"|||"BKK"|"Bangkok"|1426|"localTgsProvider"|"+662 254 1234"|"+662 254 6244"|"BKK"|"E"|20.00|"Km"|2010-06-04 11:31:13.633000000|"NEW"
28
+ 1226612|"Cambay Spa & Golf Resort"|0|15|11|"183"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"INR"|"5"|"Plot No. X 22; 23 & 24; GIDC; Sector 25"|"382044"|"Gandhinagar"|""|""|""|"IN"|"India"|||"AMD"|"Gandhinagar"|22410|"localTgsProvider"|"+079 23289000"|"+079 23289012"|"AMD"|"E"|30.00|"Km"|2010-06-03 23:10:53.617000000|"NEW"
29
+ 1226635|"Zar Guadalajara"|0|15|11|"72"|"http://image1.urlforimages.com/1226635/exterior_Thumbnailed.jpg"|"Ensuring guests a stay that is both productive and comfortable; the Zar Guadalajara provides every comfort and amenity "|"USD"|"3.5"|"CARRETERA GUADALAJARA-NOGALES KM 14 NO. 9146; zapopan; Jalisco 44630"|"44630"|"Zapopan"|""|""|""|"MX"|"Mexico"|-103.34307800000000|20.67330300000000|"GDL"|"Zapopan"|17485|"localTgsProvider"|"523336150252"|"523333301112"|"GDL"|"N"|10.00|"Km"|2010-06-04 10:13:40.090000000|"NEW"
30
+ 1226663|"Radisson Blu Royal Hotel Dublin"|0|15|11|"150"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"4"|"Golden Lane"|"8"|"Dublin"|""|""|""|"IE"|"Ireland"|||"DUB"|"Dublin"|3208|"localTgsProvider"|"+00353 1 898 2900"|"+00353 1 898 2904"|"DUB"|"S"|12.00|"Km"|2010-06-04 15:00:52.287000000|"NEW"
31
+ 1226397|"Hanoi Advisor hotel"|0|15|11|"26"|"http://image1.urlforimages.com/1226397/exterior_Thumbnailed.jpg"|"Take a step back in time and learn about history when you visit this ancient city. "|"USD"|"3"|"51 Nguyen Sieu Street - Hoan Kiem - Hanoi"|"100000"|"Hanoi"|""|""|""|"VN"|"Vietnam"|105.85200000000000|21.03700000000000|"HAN"|"Hanoi"|4315|"localTgsProvider"|"84439290469"|"84439328980"|"HAN"|"S"|40.00|"Km"|2010-05-25 12:00:22.837000000|"New"
32
+ 1226407|"Costa Inn"|0|15|11|"90"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Be impressed with dynamic service and local major attractions as a guest of Costa Inn "|"USD"|"3"|"Avda Peru y Calle 39; Panama City; Panama"|"0816-01510"|"Panama City"|""|""|""|"PA"|"Panama"|-79.53500000000000|8.97400000000000|"PTY"|"Panama City"|7807|"localTgsProvider"|"5072271522"|"5072251281"|"PTY"|"S"|25.00|"Km"|2010-05-28 10:57:42.370000000|"New"
33
+ 1226513|"Four Points by Sheraton"|0|15|11|"132"|"http://image1.urlforimages.com/1226513/exterior_Thumbnailed.jpg"|"Comfortable and classic; the Four Points by Sheraton is sure to feel like your home away from home "|"USD"|"3"|"315 E Woodlawn Rd; Charlotte; NC 28217"|"28217"|"Charlotte"|""|"NC"|"North Carolina"|"US"|"USA"|-80.87914300000000|35.17782100000000|"CLT"|"Charlotte"|2445|"localTgsProvider"|"17045220852"|"17045221634"|"CLT"|"E"|6.00|"Mile"|2010-06-02 09:25:24.697000000|"NEW"
34
+ 1226534|"Grand Mercure Shanghai Zhongya"|0|15|11|"288"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"The Grand Mercure Shanghai Zhongya is ideal of either vacationing or busy travel "|"CNY"|"5"|"330 Meiyuan Road"|""|"Shanghai"|"Zhabei"|""|""|"CN"|"China"|||"SHA"|"Shanghai"|9323|"localTgsProvider"|"+86 21 6353 5555"|"+86 21 6353 5555"|"PVG"|"SE"|25.00|"Km"|2010-06-03 10:20:19.730000000|"NEW"
35
+ 1226562|"Cambay Boutique Apartment"|0|15|11|"18"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Whatever your reason for visiting; Cambay Boutique Apartment ensures that your vacation will be a memorable one "|"INR"|"3"|"DLF Phase-I; H-34/13; Gurgaon"|""|"New Delhi"|""|""|""|"IN"|"India"|||"DEL"|"New Delhi"|17191|"localTgsProvider"|"+0124 4300210"|"+0124 4300213"|"DEL"|"E"|18.00|"Km"|2010-06-04 12:37:55.720000000|"NEW"
36
+ 1226566|"Hotel Villa Igea"|0|15|11|"17"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Hotel Villa Igea awaits your arrival to enjoy many amenities and experience the local attractions "|"EUR"|"3"|"Castello 4684 Campo San Zaccaria"|"30122"|"Venice"|"San Marco"|""|""|"IT"|"Italy"|12.34291937272100|45.43441835892480|"VCE"|"Venice"|744|"localTgsProvider"|"+39 04 124 10 956"|"+39 04 152 06 859"|"VCE"|"E"|7.00|"Km"|2010-06-04 12:47:28.680000000|"NEW"
37
+ 1226617|"Pullman Abidjan"|0|15|11|"209"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"4"|"Rue Abdoulaye Fadiga 01 BP 2185"|""|"Abidjan"|""|""|""|"CI"|"Cote d'Ivoire"|-4.03050000000000|5.33200000000000|"ABJ"|"Abidjan"|33|"localTgsProvider"|"+225 203 020 20"|"+225 202 120 28"|"ABJ"|"N"|20.00|"Km"|2010-06-04 14:17:55.310000000|"NEW"
38
+ 1226625|"Novotel Dakar"|0|15|11|"245"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"3.5"|"Avenue Abdoulaye Fadiga"|""|"Dakar"|""|""|""|"SN"|"Senegal"|-17.44389900000000|14.69529700000000|"DKR"|"Dakar"|2926|"localTgsProvider"|"+221 38 849 6161"|"+221 33 823 8929"|"DKR"|"N"|10.90|"Km"|2010-06-04 08:47:18.533000000|"NEW"
39
+ 1226511|"Sleep Inn"|0|15|11|"54"|"http://image1.urlforimages.com/1226511/exterior_Thumbnailed.jpg"|"Providing guests with exceptional service at an affordable price. "|"USD"|"2"|"18 Market St."|"27537"|"Henderson"|""|"NC"|"North Carolina"|"US"|"USA"|-78.44999700000000|36.32776900000000|"RDU"|"Henderson"|12799|"localTgsProvider"|"2524339449"|"2524339423"|"RDU"|"S"|35.00|"Mile"|2010-06-02 10:59:17.953000000|"NEW"
40
+ 1226517|"White Peach Hotel"|0|15|11|"87"|"http://image1.urlforimages.com/1226517/main_Thumbnailed.jpg"|"Exotic location meets superior service at the White Peach Hotel "|"THB"|"3"|"113/8 Karon Road"|"83100"|"Phuket"|""|""|""|"TH"|"Thailand"|||"HKT"|"Phuket"|8021|"localTgsProvider"|"+66 76 371600"|"+66 76 371648"|"HKT"|"S"|45.00|"Km"|2010-06-03 21:31:03.520000000|"NEW"
41
+ 1226520|"GRAND MIRAMAR CLUB & SPA"|0|15|11|"16"|"http://image1.urlforimages.com/1226520/exterior1_Thumbnailed.jpg"|"Exotic ocean breezes and unforgettable views await your stay "|"USD"|"4.5"|"PASEO DE LOS CORALES 139 COL. CONCHAS CHINAS; PUERTO VALLARTA; JAL. CP 48390"|"48390"|"Puerto Vallarta"|""|""|""|"MX"|"Mexico"|-105.24044200000000|20.58798900000000|"PVR"|"Puerto Vallarta"|8365|"localTgsProvider"|"523222215699"|"523222215699"|"PVR"|"S"|10.00|"Km"|2010-06-02 09:31:10.167000000|"NEW"
42
+ 1226613|"Novotel Orisha Cotonou"|0|15|11|"110"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"3"|"Boulevard De La Marina"|""|"Cotonou"|""|""|""|"BJ"|"Benin"|2.43320400000000|6.35049600000000|"COO"|"Cotonou"|2821|"localTgsProvider"|"+229 21 305 662"|"+229 21 304 188"|"COO"|"N"|1.80|"Km"|2010-06-04 10:14:30.867000000|"NEW"
43
+ 1226621|"Berjaya Redang Resort"|0|15|11|"220"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"MYR"|"5"|"P.O. Box 126; Main Post Office"|"20298"|"Redang"|""|""|""|"MY"|"Malaysia"|||"RDN"|"Redang"|8553|"localTgsProvider"|"+609 630 8888"|"+609 630 8880"|"RDN"|"S"|30.00|"Km"|2010-06-03 15:35:00.083000000|"NEW"
44
+ 1226659|"Comfort Suites near Industry Hills"|0|15|11|"41"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"USD"|"3"|"753 Glendora Ave."|"91744"|"La Puente"|""|"CA"|"California"|"US"|"USA"|||"LAX"|"Los Angeles"|6031|"localTgsProvider"|"+ 1 626 330 0030"|"+ 1 626 330 0027"|"LAX"|"W"|35.00|"Mile"|2010-06-04 14:40:26.323000000|"NEW"
45
+ 1226673|"Comfort Inn Woodland Hills"|0|15|11|"99"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"TRL"|"3"|"20157 Ventura Blvd."|"91364"|"Woodland Hills"|""|"CA"|"California"|"US"|"USA"|||"LAX"|"Woodland Hills"|12133|"localTgsProvider"|"+1 818 347 8080"|"+ 1 818 716 5333"|"LAX"|"N"|24.00|"Mile"|2010-06-04 17:00:09.700000000|"NEW"
46
+ 1226677|"Days Inn Studio City/Hollywood"|0|15|11|"65"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"USD"|"2"|"12933 Ventura Blvd"|"91604"|"Studio City"|""|"CA"|"California"|"US"|"USA"|||"LAX"|"Studio City"|21275|"localTgsProvider"|"+ 1818 789 6900"|"+ 1 818 789 6980"|"LAX"|"N"|22.00|"Mile"|2010-06-04 17:44:07.387000000|"NEW"
47
+ 1226510|"AS HOTEL BERGAMO"|0|15|11|"140"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Prime location and superior treatment await you at AS HOTEL BERGAMO "|"EUR"|"4"|"Via PADERGNONE 54"|"24050"|"Bergamo"|""|""|""|"IT"|"Italy"|9.70872885325867|45.65959262038720|"MIL"|"Bergamo"|11221|"localTgsProvider"|"035587011"|"0035587012"|"BGY"|"S"|2.00|"Km"|2010-06-01 11:34:23.507000000|"NEW"
48
+ 1226528|"Sport"|0|15|11|"173"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Close to major attractions and city excitement; we invite you to be our guest "|"USD"|"3"|"55; Krasnoarmeyskaya str"|""|"Kiev"|""|""|""|"UA"|"Ukraine"|||"IEV"|"Kiev"|5271|"localTgsProvider"|"+38 044 206 22 00"|"+38 044 206 22 00"|"KBP"|"E"|9.00|"Km"|2010-06-03 10:03:06.477000000|"NEW"
49
+ 1226530|"I Style Trendhotel"|0|15|11|"90"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Whatever your reason for visiting; I Style Trendhotel ensures that your vacation will be a memorable one "|"THB"|"4"|"14/4 Sukhumvit Soi 22; Kwang Klongtoey; Khet Klongtoey"|"10110"|"Bangkok"|""|""|""|"TH"|"Thailand"|||"BKK"|"Bangkok"|1426|"localTgsProvider"|"+ 66 0 2261 7711"|"+ 66 0 2261 7970"|"BKK"|"N"|32.00|"Km"|2010-06-03 10:08:16.280000000|"NEW"
50
+ 1226537|"Deerfoot Inn Casino"|0|15|11|"188"|"http://image1.urlforimages.com/1226537/exterior_Thumbnailed.jpg"|"The superior Deerfoot Inn Casino is the perfect location for a weekend getaway "|"CAD"|"4"|"1000; 11500 35 Street SE"|"T2Z 3W4"|"Calgary"|""|"AB"|"Alberta"|"CA"|"Canada"|-113.98544900000000|50.94936900000000|"YYC"|"Calgary"|2197|"localTgsProvider"|"14032367529"|"14032524767"|"YYC"|"S"|35.00|"Km"|2010-06-02 09:21:02.443000000|"NEW"
51
+ 1226542|"Ca' Pisani Hotel"|0|15|11|"29"|"http://image1.urlforimages.com/1226542/main_Thumbnailed.jpg"|"Experience the local culture and attractions of this beautiful location. "|"EUR"|"4"|"Dorsoduro 979/n"|"30123"|"Venice"|"Dorsoduro"|""|""|"IT"|"Italy"|12.32827886223510|45.43048075486830|"VCE"|"Venice"|744|"localTgsProvider"|"+39 041 2401411"|"+39 041 2771061"|"VCE"|"N"|15.00|"Km"|2010-06-03 10:34:46.567000000|"NEW"
52
+ 1226555|"Panorama Hotel"|0|15|11|"111"|"http://image1.urlforimages.com/1226555/exterior_Thumbnailed.jpg"|"Experience the local culture and attractions of this beautiful location. "|"BHD"|"4"|"Building 1579 Road 4041 Block 340 Juffair"|"15009"|"Manama"|""|""|""|"BH"|"Bahrain"|50.58376286099450|26.21563377989020|"BAH"|"Manama"|6283|"localTgsProvider"|"+973 1782 6888"|"+973 1782 7427"|"BAH"|"W"|6.40|"Km"|2010-06-03 17:24:25.137000000|"NEW"
53
+ 1226556|"The Palm Beach Club"|0|15|11|"39"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Exotic beaches; secluded accommodations are what await you at The Palm Beach Club "|"THB"|"5"|"35 Moo 4; Cherngtalay"|"83110"|"Phuket"|""|""|""|"TH"|"Thailand"|||"HKT"|"Phuket"|8021|"localTgsProvider"|"+66 76 310400"|"+66 76 310408"|"HKT"|"W"|27.00|"Km"|2010-06-04 11:42:33.227000000|"NEW"
54
+ 1226610|"UR MISION DE SAN MIGUEL"|0|15|11|"32"|"http://image1.urlforimages.com/1226610/main_Thumbnailed.jpg"|"The UR MISION DE SAN MIGUEL is ideal of either vacationing or busy travel "|"EUR"|"4"|"Ca�n Ma�anet; 1A"|"07003"|"Mallorca"|"Palma de Mallorca"|""|""|"ES"|"Spain"|2.64952002528080|39.57715548523450|"PMI"|"Mallorca"|11281|"localTgsProvider"|"971214848"|"971214545"|"PMI"|"NW"|12.00|"Km"|2010-06-04 10:09:33.137000000|"NEW"
55
+ 1226627|"Pullman Teranga"|0|15|11|"230"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|""|"EUR"|"5"|"10; Rue Colbert"|""|"Dakar"|""|""|""|"SN"|"Senegal"|-17.45190000000000|14.68670000000000|"DKR"|"Dakar"|2926|"localTgsProvider"|"+221 33 889 2200"|"+221 33 823 5001"|"DKR"|"N"|10.70|"Km"|2010-06-04 08:51:07.560000000|"NEW"
56
+ 1226398|"Petinos Hotel"|0|15|12|"74"|"http://image1.urlforimages.com/1226398/main_Thumbnailed.jpg"|"Scenic views and beautiful beaches await you for your next vacation getaway "|"EUR"|"4"|"Platis Yialos; Mykonos; Mykonos Island; Cyclades Islands; Greece 84600"|"84600"|"Mykonos"|""|""|""|"GR"|"Greece"|23.74103746057440|38.30097903504730|"JMK"|"Mykonos"|11550|"localTgsProvider"|"00302289024310"|"00302289023680"|"JMK"|"W"|4.00|"Km"|2010-05-28 11:08:53.523000000|"New"
57
+ 1226507|"Fortina Hotel"|0|15|12|"194"|"http://image1.urlforimages.com/1226507/exterior_Thumbnailed.jpg"|"Prime location and superior treatment await you at Fortina Hotel "|"EUR"|"4"|"Tigne Seafront"|"SLM3012"|"Sliema"|""|""|""|"MT"|"Malta"|14.50650558950130|35.91642339201240|"MLA"|"Sliema"|17271|"localTgsProvider"|"35623460000"|"35623462162"|"MLA"|"NE"|8.00|"Km"|2010-06-01 12:24:25.700000000|"NEW"
58
+ 1226512|"Citycenter Hotel"|0|15|11|"81"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Superior accommodations and fabulous service meet all your business and leisure needs "|"EUR"|"4"|"Katip Celebi Mahallesi Billurcu Sokak No:1 Siraselviler"|"34433"|"Istanbul"|""|""|""|"TR"|"Turkey"|28.98339300000000|41.03566500000000|"IST"|"Istanbul"|4762|"localTgsProvider"|"+90 212 292 27 71"|"+90 212 292 27 74"|"IST"|"S"|25.00|"Km"|2010-06-02 11:04:17.997000000|"NEW"
59
+ 1226531|"Cambay Palm Lagoon Kollam"|0|15|11|"21"|"http://www.touricoholidays.com/en/Modules/customizable/images/photo-not-available-small.gif"|"Experience the local culture and attractions of this beautiful location. "|"INR"|"3"|"Vellimon West; Kollam"|"691511"|"Kollam"|""|""|""|"IN"|"India"|||"TRV"|"Kerala"|22409|"localTgsProvider"|"+0474 2549500"|"+0474 2548974"|"TRV"|"E"|85.00|"Km"|2010-06-03 10:14:24.833000000|"NEW"
60
+ 1226532|"Kyriad Lyon Croix Rousse"|0|15|11|"50"|"http://image1.urlforimages.com/1226532/exterior_Thumbnailed.jpg"|"Affordable; charming with plenty of amenities; the Kyriad Lyon Croix Rousse is sure to make you feel right at home "|"EUR"|"2"|"48 Rue Henon"|"69004"|"Lyon"|""|""|""|"FR"|"France"|4.82649383972110|45.77956147806390|"LYS"|"Lyon"|6134|"localTgsProvider"|"+ 33 4 72 00 22 22"|"+ 33 4 72 00 00 49"|"LYN"|"N"|30.00|"Km"|2010-06-02 16:21:43.437000000|"NEW"
61
+ 1226563|"Radisson Blu Hotel, Milan"|0|15|11|"250"|"http://image1.urlforimages.com/1226563/exterior_Thumbnailed.jpg"|"Fabulous service and superior accommodations are here to serve all your needs "|"EUR"|"4"|"Via Villapizzone; 24"|"20156"|"Milan"|""|""|""|"IT"|"Italy"|9.14519128918207|45.50086243917070|"MIL"|"Milan"|6656|"localTgsProvider"|"+39 023631888"|"+39 023631870"|"LIN"|"SE"|41.00|"Km"|2010-06-04 12:42:50.257000000|"NEW"
62
+ 791|"Crowne Plaza Times Square"|1|16|12|"770"|"http://image1.urlforimages.com/791/exterior01_Thumbnailed.jpg"|"City lights and city excitement await your arrival at the centrally located Crowne Plaza Times Square Elaborate accommodations and superior service will impress you as our guest "|"USD"|"4"|"1605 Broadway"|"10019"|"New York"|"Manhattan - Midtown"|"NY"|"New York"|"US"|"USA"|-73.98460800000000|40.76054500000000|"NYC"|"New York"|7263|"localTgsProvider"|"+1 212 977 4000"|"+1 212 333 7393"|"LGA"|"SW"|17.00|"Km"|2010-06-04 16:45:24.167000000|"UPDATED"
63
+ 807|"Park Central Hotel"|0|15|12|"935"|"http://image1.urlforimages.com/807/dining_Thumbnailed.jpg"|"Amazing views and exciting amenities await you and your guest at the Park Central Hotel Being a guest means getting impressive accommodations and first class service "|"USD"|"3.5"|"870 7th Avenue & 56th Street"|"10019"|"New York"|"Manhattan - Midtown"|"NY"|"New York"|"US"|"USA"|-73.98053829683280|40.76482634415680|"NYC"|"New York"|7263|"localTgsProvider"|"+1 212 247 8000"|"+1 212 707 5557"|"LGA"|"S"|11.61|"Km"|2010-06-03 10:44:45.630000000|"UPDATED"
64
+ 812|"Roosevelt Hotel"|0|15|12|"1015"|"http://image1.urlforimages.com/812/Exterior_Thumbnailed.jpg"|"Perfect location and fabulous service meet here; making it your perfect New York City accommodation Close to major attractions and city excitement; we invite you to be our guest "|"USD"|"4"|"45 East 45th Street"|"10010"|"New York"|"Manhattan - Midtown"|"NY"|"New York"|"US"|"USA"|-73.97740600000000|40.75453700000000|"NYC"|"New York"|7263|"localTgsProvider"|"+1 212 661 9600"|"+1 212 661 9600"|"LGA"|"S"|8.50|"Mile"|2010-05-26 13:03:58.257000000|"Updated"
65
+ 824|"W - New York"|0|15|12|"652"|"http://image1.urlforimages.com/824/Extfront-cj_Thumbnailed.jpg"|"As one of New York's finest accommodations; the W New York truly stands out above the rest "|"USD"|"4.5"|"541 Lexington Avenue"|"10022"|"New York"|"Manhattan - Midtown"|"NY"|"New York"|"US"|"USA"|-73.97258700000000|40.75612500000000|"NYC"|"New York"|7263|"localTgsProvider"|"+1 212 755 1200"|"+1 212 319 8344"|"LGA"|"S"|11.08|"Km"|2010-06-01 18:00:21.037000000|"UPDATED"
66
+ 975|"Venetian Resort-Hotel-Casino"|0|15|11|"4027"|"http://image1.urlforimages.com/975/newexterior2_Thumbnailed.jpg"|"Sure to please any traveler; the Venetian Resort-Hotel-Casino is proud to offer outstanding service and superior accommodations Opulent surroundings with luxury accommodations are offered for your pleasure "|"USD"|"5"|"3355 Las Vegas Boulevard South"|"89109"|"Las Vegas"|"The Strip"|"NV"|"Nevada"|"US"|"USA"|-115.17087936401367|36.12290084314000|"LAS"|"Las Vegas"|5751|"localTgsProvider"|"+1 702 414 1000"|"+1 702 414 4805"|"LAS"|"S"|4.99|"Km"|2010-06-04 15:33:27.770000000|"UPDATED"
67
+ 1008|"Holiday Inn Fisherman's Wharf"|1|15|12|"585"|"http://image1.urlforimages.com/1008/Holiday-Inn-FW-front[1]_Thumbnailed.jpg"|"Families will love to vacation at the Holiday Inn fisherman's Wharf with all the amenities and attractions it provides "|"USD"|"3"|"1300 Columbus Avenue"|"94133"|"San Francisco"|"Fishermans Wharf"|"CA"|"California"|"US"|"USA"|-122.41843500000000|37.80602300000000|"SFO"|"San Francisco"|8953|"localTgsProvider"|"+1 415 771 9000"|"+1 415 771 7006"|"SFO"|"S"|25.33|"Km"|2010-06-02 16:57:55.850000000|"UPDATED"
68
+ 1436|"Comfort Inn Butte"|0|15|11|"145"|"http://image1.urlforimages.com/1436/comfort-inn-front_Thumbnailed.jpg"|"The Comfort Inn is a leading hotel in Butte with easy access off I-90 and"|"USD"|"2.5"|"2777 Harrison Avenue"|"59701"|"Butte"|""|"MT"|"Montana"|"US"|"USA"|-112.50819900000000|45.98530400000000|"BTM"|"Butte"|2146|"localTgsProvider"|"1-406-494-8850"|"14064942801"|"BTM"|"N"|2.00|"Mile"|2010-06-04 16:54:39.730000000|"UPDATED"
69
+ 2061|"Hilton Waterfront Beach Resort"|0|16|12|"290"|"http://image1.urlforimages.com/2061/HWBRexterior_Thumbnailed.jpg"|"Beautiful beaches and wonderful accommodations await your arrival "|"USD"|"4"|"21100 Pacific Coast Highway"|"92648"|"Huntington Beach"|""|"CA"|"California"|"US"|"USA"|-117.99549600000000|33.65320000000000|"SNA"|"Huntington Beach"|11662|"localTgsProvider"|"+1 714 845 8000"|"+1 714 845 8424"|"SNA"|"NW"|13.00|"Mile"|2010-05-24 12:59:48.380000000|"Updated"
70
+ 2112|"La Quinta San Bernardino"|0|15|11|"153"|"http://image1.urlforimages.com/2112/laquintasb-front_Thumbnailed.jpg"|"Whether traveling for business or pleasure; guests of the La Quinta San Bernardino find all they need and more at a great price"|"USD"|"2.5"|"205 East Hospitality Lane"|"92408-3411"|"San Bernardino"|""|"CA"|"California"|"US"|"USA"|-117.28287200000000|34.06580000000000|"SBT"|"San Bernardino"|8929|"localTgsProvider"|"+1 909 888 7571"|"+1 909 884 3864"|"SBD"|"SW"|3.31|"Mile"|2010-05-28 12:02:31.690000000|"Updated"
71
+ 2122|"La Quinta Denver Central"|0|15|11|"105"|"http://image1.urlforimages.com/2122/laquinta901-frnt_Thumbnailed.jpg"|"When visiting Denver excellent customer service and superb accommodations make the La Quinta Denver Central your ideal choice With world-famous attractions located near by; this is the perfect hotel location"|"USD"|"2.5"|"3500 Park Avenue West"|"80216"|"Denver"|"Downtown Area"|"CO"|"Colorado"|"US"|"USA"|-104.99415993690492|39.76685305118730|"DEN"|"Denver"|3050|"localTgsProvider"|"+1 303 458 1222"|"+1 303 433 2246"|"DEN"|"S"|16.04|"Km"|2010-05-28 10:09:31.863000000|"Updated"
72
+ 2216|"Nikko Union Square"|0|15|11|"533"|"http://image1.urlforimages.com/2216/Nikko-Union-Square-front[1]_Thumbnailed.jpg"|"Great value and world-class quality reside here at the Nikko Union Square ; which will exceed all your expectations "|"USD"|"4"|"222 Mason Street"|"94102"|"San Francisco"|"Downtown/Union Square/Nob Hill"|"CA"|"California"|"US"|"USA"|-122.40931391716005|37.78585142310515|"SFO"|"San Francisco"|8953|"localTgsProvider"|"+1 415 394 1111"|"+1 415 394 1106"|"SFO"|"S"|22.49|"Km"|2010-05-24 09:39:14.173000000|"Updated"
73
+ 2284|"La Quinta Alexandria"|0|15|11|"117"|"http://image1.urlforimages.com/2284/LaQuinta-961-front_Thumbnailed.jpg"|"Affordability meets service and comfort at the La Quinta Alexandria"|"USD"|"2.5"|"6116 West Calhoun Drive"|"71303"|"Alexandria"|""|"LA"|"Louisiana"|"US"|"USA"|-92.52001200000000|31.34545100000000|"AEX"|"Alexandria"|200|"localTgsProvider"|"+1 318 442 3700"|"+1 318 442 0870"|"AEX"|"NE"|3.00|"Mile"|2010-05-28 14:19:36.630000000|"Updated"
74
+ 2293|"Monumental Hotel Orlando"|1|15|11|"234"|"http://image1.urlforimages.com/2293/02Exterior_Thumbnailed.jpg"|"A great place to launch your fabulous vacation; the Monumental Hotel Orlando provides guests with the ultimate experience "|"USD"|"3.5"|"12120 International Drive"|"32821"|"Orlando"|"International Drive/Sea World Area"|"FL"|"Florida"|"US"|"USA"|-81.47319900000000|28.38890000000000|"MCO"|"Orlando"|7647|"localTgsProvider"|"+1 407 239 1222"|"+1 407 239 1190"|"MCO"|"W"|8.00|"Mile"|2010-06-04 10:21:26.930000000|"UPDATED"
75
+ 2428|"La Quinta Texarkana"|0|15|11|"130"|"http://image1.urlforimages.com/2428/LqQuinta-front_Thumbnailed.jpg"|"A great place to launch your fabulous vacation; the La Quinta Texarkana provides guests with the ultimate experience"|"USD"|"2.5"|"5201 State Lane Avenue"|"75503"|"Texarkana"|""|"TX"|"Texas"|"US"|"USA"|-94.04319900000000|33.46710000000000|"TXK"|"Texarkana"|11413|"localTgsProvider"|"+1 903 794 1900"|"+1 903 792 5506"|"TXK"|"N"|5.00|"Mile"|2010-05-28 11:00:37.027000000|"Updated"
76
+ 2865|"Westin Resort & Spa Cancun"|1|15|11|"293"|"http://image1.urlforimages.com/2865/WestinFront[1]_Thumbnailed.jpg"|"Want a vacation to remember for years to come? Welcome to Westin Resort & Spa Cancun "|"USD"|"4.5"|"BLVD KUKULCAN KM. 20"|"77500"|"Cancun"|"Hotel Zone"|""|""|"MX"|"Mexico"|-86.78169250488281|21.03884496851295|"CUN"|"Cancun"|2247|"localTgsProvider"|"+52 998 848 7400"|"+52 998 8852084"|"CUN"|"NE"|20.00|"Km"|2010-06-03 15:04:52.423000000|"UPDATED"
77
+ 3156|"Riu Palace Aruba All Inclusive"|0|15|11|"450"|"http://image1.urlforimages.com/3156/Sunset-from-BalconyAR_Thumbnailed.jpg"|"Exotic location meets superior service at the Riu Palace Aruba "|"USD"|"5"|"JE Irausquin Boulevard 79"|"33496"|"Palm Beach"|"Palm Beach"|""|""|"AW"|"Aruba"|-70.04390000000000|12.57140000000000|"AUA"|"Aruba"|501|"localTgsProvider"|"+1 297 586 39 00"|"+1 297 586 19 41"|"AUA"|"E"|10.00|"Km"|2010-05-24 15:45:47.050000000|"Updated"
78
+ 3162|"Hyatt Regency Aruba"|0|16|12|"360"|"http://image1.urlforimages.com/3162/Hyatt-Regency-Aruba_Thumbnailed.jpg"|"Extraordinary views and beautiful beaches are in walking distance "|"USD"|"5"|"Juan Irausquin Boulevard #85"|"1"|"Palm Beach"|"Palm Beach"|""|""|"AW"|"Aruba"|-70.03830000000000|12.56740000000000|"AUA"|"Aruba"|501|"localTgsProvider"|"+1 297 58 61234"|"+1 297 58 60584"|"AUA"|"N"|13.00|"Km"|2010-05-26 14:56:26.420000000|"Updated"
79
+ 3181|"British Colonial Hilton Nassau"|1|15|11|"291"|"http://image1.urlforimages.com/3181/british-hilton-lobby_Thumbnailed.jpg"|"Luxury accommodations and exotic views await your arrival "|"USD"|"4.5"|"Number One Bay Street PO Box N-7148"|"00001"|"Nassau"|""|""|""|"BS"|"Bahamas"|-77.26478576660157|25.03272786351901|"NAS"|"Nassau"|7174|"localTgsProvider"|"+1 242 322 3301"|"+1 242 302 9011"|"NAS"|"NE"|11.00|"Mile"|2010-06-04 09:03:37.490000000|"UPDATED"
80
+ 3229|"Sheraton Nassau Beach Resort"|1|15|11|"700"|"http://image1.urlforimages.com/3229/SN-Beach-&-Pool_Thumbnailed.jpg"|"The perfect choice for any vacation; the Sheraton Nassau Beach Resort boasts spectacular beaches; outstanding service; and thrilling activities Extraordinary views and beautiful beaches are in walking distance "|"USD"|"4"|"West Bay Street - P.O Box N 4914"|"1"|"Nassau"|"Cable Beach"|""|""|"BS"|"Bahamas"|-77.33900000000000|25.06610000000000|"NAS"|"Nassau"|7174|"localTgsProvider"|"+1 242 327 6000"|"+1 242 327 6987"|"NAS"|"W"|5.00|"Km"|2010-06-04 16:13:01.643000000|"UPDATED"
81
+ 3413|"Buenaventura Grand Hotel & Spa"|0|15|12|"236"|"http://image1.urlforimages.com/3413/buenaventura-overview_Thumbnailed.jpg"|"For a luxurious resort complete with picturesque beaches; look no further then the Buenaventura Grand Hotel & Spa "|"USD"|"5"|"Ave. Mexico No. 1301"|"48350"|"Puerto Vallarta"|"Central"|""|""|"MX"|"Mexico"|-105.18300000000000|20.64840000000000|"PVR"|"Puerto Vallarta"|8365|"localTgsProvider"|"+52 322 22 67000"|"+52 32 22223546"|"PVR"|"N"|7.00|"Km"|2010-06-02 15:28:27.390000000|"UPDATED"
82
+ 3645|"Holiday Inn Bloomington Airport"|0|15|11|"171"|"http://image1.urlforimages.com/3645/exterior001_Thumbnailed.jpg"|"With its prime location and impeccable service; it is no wonder this hotel is the ideal place to stay when visiting Holiday Inn Bloomington Airport"|"USD"|"3"|"1201 West 94th Street"|"55431"|"Bloomington"|""|"MN"|"Minnesota"|"US"|"USA"|-93.29570200000000|44.83350000000000|"MSP"|"Bloomington"|12241|"localTgsProvider"|"+1 952 884 8211"|"+1 950 884 4557"|"MSP"|"E"|6.00|"Mile"|2010-06-04 16:52:02.463000000|"UPDATED"
83
+ 3721|"Butterfly Beach"|0|15|11|"94"|"http://image1.urlforimages.com/3721/Barbados-Butterfly-Beach-pic1_Thumbnailed.jpg"|"A great place to launch your fabulous vacation; the Butterfly Beach provides guests with the ultimate experience "|"USD"|"3"|"Maxwell Road"|""|"Barbados"|"Christ Church"|""|""|"BB"|"Barbados"|-59.55371000000000|13.06660000000000|"BGI"|"Barbados"|11650|"localTgsProvider"|"+246 428 9095"|"+246 418 0502"|"BGI"|"S"|10.00|"Mile"|2010-05-28 12:54:48.150000000|"Updated"
84
+ 3827|"Cranley"|0|15|11|"39"|"http://image1.urlforimages.com/3827/front_Thumbnailed.jpg"|"A perfect oasis for your vacation weekend; come see what Cranley is known for "|"GBP"|"4"|"10-12; Bina Gardens South Kensington"|"SW5 OLA"|"London"|"Kensington/Earls Court"|""|""|"GB"|"United Kingdom"|-.18325578970044|51.49168283189140|"LON"|"London"|5981|"localTgsProvider"|"+44 207 373 0123"|"+44 207 373 9497"|"LCY"|"S"|19.95|"Km"|2010-05-24 13:49:35.927000000|"Updated"
85
+ 3848|"Melia White House"|0|15|12|"582"|"http://image1.urlforimages.com/3848/London-UK-Melia-White-House-front_Thumbnailed.jpg"|"Major attractions and local shopping venues makes this the ideal travelers choice stay "|"GBP"|"4"|"Albany Street; Regents Park"|"NW1 3UP"|"London"|"Mayfair/Marylebone"|""|""|"GB"|"United Kingdom"|-.14425059372269|51.52413989082730|"LON"|"London"|5981|"localTgsProvider"|"+442073913000"|"+442073876788"|"LCY"|"S"|17.58|"Km"|2010-05-24 13:50:47.090000000|"Updated"
86
+ 3969|"Bled Hotel"|0|15|11|"47"|"http://image1.urlforimages.com/3969/Bled-F_Thumbnailed.jpg"|"A great place to launch your fabulous vacation; the Bled Hotel provides guests with the ultimate experience "|"EUR"|"3"|"Via S. Croce In Gerusalemme; 40"|"00185"|"Rome"|"San Giovanni"|""|""|"IT"|"Italy"|12.51178128579760|41.89043468918570|"ROM"|"Rome"|8723|"localTgsProvider"|"+39 06 47 82 47 69"|"+39 06 481 8077"|"CIA"|"NE"|34.71|"Km"|2010-05-28 15:21:05.177000000|"Updated"
87
+ 4253|"Hotel Milano Corso Genova"|0|15|11|"105"|"http://image1.urlforimages.com/4253/Mercure-Corso-Genova-front_Thumbnailed.jpg"|"A perfect choice for those traveling on leisure the Milano Corso Genova Hotel is a well-known vacation oasis "|"EUR"|"3"|"Via Conca del Naviglio; 20"|"20123"|"Milan"|"Duomo"|""|""|"IT"|"Italy"|9.17739648489233|45.45667794542990|"MIL"|"Milan"|6656|"localTgsProvider"|"+390258104141"|"+390289401012"|"LIN"|"SW"|8.00|"Km"|2010-05-28 16:07:45.823000000|"Updated"
88
+ 4290|"Royal National Hotel"|1|15|11|"1630"|"http://image1.urlforimages.com/4290/Exterior_Thumbnailed.jpg"|"Perfect for any occasion; the Royal National Hotel provides amazing service and an ideal location; all at a great price "|"GBP"|"3"|"Russell Square; Bedford Way"|"WC1H 0DG"|"London"|"Bloomsbury/Soho"|""|""|"GB"|"United Kingdom"|-.12713249881642|51.52225134352180|"LON"|"London"|5981|"localTgsProvider"|"+44 207 637 2488"|"+44 207 837 4653"|"LCY"|"S"|15.04|"Km"|2010-06-02 09:50:06.733000000|"UPDATED"
89
+ 4406|"La Quinta Inn Irvine Spectrum"|0|15|11|"148"|"http://image1.urlforimages.com/4406/Laquinta-front_Thumbnailed.jpg"|"With its amazing views; great location; and affordable rates; the La Quinta Inn Irvine Spectrum is perfect for any traveler on any occasion"|"USD"|"2.5"|"14972 Sand Canyon Avenue"|"92618"|"Irvine"|""|"CA"|"California"|"US"|"USA"|-117.75885701179506|33.67561986272387|"SNA"|"Irvine"|11356|"localTgsProvider"|"+1 949 551 0909"|"+1 949 551 2945"|"SNA"|"N"|12.89|"Km"|2010-05-26 15:45:53.437000000|"Updated"
90
+ 4416|"La Quinta Inn Dallas Lewisville"|0|15|11|"129"|"http://image1.urlforimages.com/4416/exterior-1-yp_Thumbnailed.jpg"|"Affordable; charming with plenty of amenities; the La Quinta Inn Dallas Lewisville is sure to make you feel right at home "|"USD"|"2.5"|"1657 South Stemmons Freeway"|"75067-6401"|"Dallas"|"Lewisville"|"TX"|"Texas"|"US"|"USA"|-96.98465640257070|33.01951135367280|"DFW"|"Dallas"|2939|"localTgsProvider"|"+1 972 221 7525"|"+1 972 221 7525"|"DFW"|"SE"|.00|"Km"|2010-06-02 16:05:18.340000000|"UPDATED"
91
+ 4448|"La Quinta Lomaland"|0|15|11|"138"|"http://image1.urlforimages.com/4448/exterior001_Thumbnailed.jpg"|"La Quinta Lomaland awaits your arrival to enjoy many amenities and experience the local attractions"|"USD"|"2.5"|"11033 Gateway (Interstate 10)"|"79935-5003"|"El Paso"|""|"TX"|"Texas"|"US"|"USA"|-106.33305000000000|31.74541100000000|"ELP"|"El Paso"|3378|"localTgsProvider"|"+1 915 591 2244"|"+1 915 592 9300"|"ELP"|"SE"|6.25|"Mile"|2010-05-26 16:05:02.787000000|"Updated"
92
+ 4454|"La Quinta Oklahoma City Airport"|0|15|11|"168"|"http://image1.urlforimages.com/4454/airportlaquinta-front_Thumbnailed.jpg"|"La Quinta Oklahoma City Airport is known for beautiful accommodations for budget minded travelers"|"USD"|"2.5"|"800 South Meridien"|"73108"|"Oklahoma City"|"Will Rogers World"|"OK"|"Oklahoma"|"US"|"USA"|-97.60109900000000|35.45759700000000|"OKC"|"Oklahoma City"|7550|"localTgsProvider"|"+1 405 942 0040"|"+1 405 942 0638"|"OKC"|"N"|8.67|"Mile"|2010-05-28 14:14:44.570000000|"Updated"
93
+ 4459|"La Quinta Inn Grand Prairie"|0|15|11|"122"|"http://image1.urlforimages.com/4459/exterior002_Thumbnailed.jpg"|"Be impressed with dynamic service and local major attractions as a guest of La Quinta Inn Grand Prairie"|"USD"|"2.5"|"1410 NW 19th Street"|"75050-2802"|"Grand Prairie"|""|"TX"|"Texas"|"US"|"USA"|-97.02840800000000|32.75730400000000|"DFW"|"Grand Prairie"|11400|"localTgsProvider"|"+1 972 641 3021"|"+1 972 660 3041"|"DFW"|"S"|7.00|"Mile"|2010-06-02 16:02:29.993000000|"UPDATED"
94
+ 4465|"Baymont Suites Highland Mall"|0|15|11|"116"|"http://image1.urlforimages.com/4465/laquinta514-front_Thumbnailed.jpg"|"A perfect oasis for your vacation weekend; come see what La Quinta Inn Highland Mall is known for"|"USD"|"2.5"|"7100 I-35 North"|"78752"|"Austin"|"North Side"|"TX"|"Texas"|"US"|"USA"|-97.70487252979190|30.33236125493350|"AUS"|"Austin"|606|"localTgsProvider"|"+1 512 452 9401"|"+1 512 452 0856"|"AUS"|"N"|11.00|"Mile"|2010-06-04 16:23:49.217000000|"UPDATED"
95
+ 4466|"La Quinta Inn Fort Myers Central"|0|15|11|"129"|"http://image1.urlforimages.com/4466/LaQuinta-Front_Thumbnailed.jpg"|"Affordability meets service and comfort at the LaQuinta Inn Fort Myers Central"|"USD"|"2.5"|"4850 South Cleveland Avenue"|"33907"|"Fort Myers"|"Fort Myers and vicinity"|"FL"|"Florida"|"US"|"USA"|-81.87304615974426|26.59044597041873|"FMY"|"Fort Myers"|3718|"localTgsProvider"|"+1 239 275 3300"|"+1 239 275 6661"|"RSW"|"S"|22.91|"Km"|2010-05-26 16:16:42.690000000|"Updated"
96
+ 4473|"La Quinta Haywood Road"|0|15|11|"125"|"http://image1.urlforimages.com/4473/laquinta-haywood-front_Thumbnailed.jpg"|"Fabulous fun and excitement await you and your family at the La Quinta Haywood Road"|"USD"|"2.5"|"65 West Orchard Park Drive"|"29615"|"Greenville"|""|"SC"|"South Carolina"|"US"|"USA"|-82.33728300000000|34.85739500000000|"GSP"|"Greenville"|4135|"localTgsProvider"|"+1 864 233 8018"|"+1 864 233 2038"|"GSP"|"W"|10.00|"Mile"|2010-05-26 16:04:42.667000000|"Updated"
97
+ 4484|"La Quinta Inn & Suites Fort Worth Southwest"|0|15|11|"128"|"http://image1.urlforimages.com/4484/exterior002_Thumbnailed.jpg"|"You will be impressed with many amenities and attractions offered at La Quinta Inn & Suites Fort Worth Southwest"|"USD"|"2.5"|"4900 Bryant Irvin Road"|"76132"|"Fort Worth"|""|"TX"|"Texas"|"US"|"USA"|-97.41639375686647|32.67840468362119|"DFW"|"Fort Worth"|3743|"localTgsProvider"|"+1 817 370 2700"|"+1 817 370 2733"|"DFW"|"SW"|11.00|"Mile"|2010-06-02 16:25:35.657000000|"UPDATED"
98
+ 4496|"La Quinta Inn & Suites Houston Park 10"|0|15|11|"117"|"http://image1.urlforimages.com/4496/laquintahpfront_Thumbnailed.jpg"|"Giving guests a taste of home; the La Quinta Inn & Suites Houston Park 10 makes for an excellent stay"|"USD"|"2.5"|"15225 Katy Freeway"|"77094"|"Houston"|"Downtown Area"|"TX"|"Texas"|"US"|"USA"|-95.65156459808350|29.78385916871836|"HOU"|"Houston"|4531|"localTgsProvider"|"+1 281 646 9200"|"+1 281 646 9201"|"HOU"|"NE"|11.00|"Mile"|2010-05-28 10:23:53.100000000|"Updated"
99
+ 4499|"La Quinta Inn Seaworld"|0|15|11|"45"|"http://image1.urlforimages.com/4499/exterior-ab_Thumbnailed.jpg"|"Our accommodations and first class service are the staple of this prime location"|"USD"|"2.5"|"7134 NW Loop 410"|"78238-4116"|"San Antonio"|"Lackland Air Force Base Area"|"TX"|"Texas"|"US"|"USA"|-98.62860202789306|29.45417233016589|"SAT"|"San Antonio"|8924|"localTgsProvider"|"+1 210 680 8883"|"+1 210 681 3877"|"SAT"|"NE"|12.00|"Mile"|2010-05-28 12:14:23.190000000|"Updated"
100
+ 4505|"La Quinta Airport West"|0|15|11|"143"|"http://image1.urlforimages.com/4505/exterior_Thumbnailed.jpg"|"With its amazing views; great location; and affordable rates; the La Quinta Airport West is perfect for any traveler on any occasion"|"USD"|"3"|"8730 North West 27th Street"|"33172"|"Miami"|"Miami International Airport Area"|"FL"|"Florida"|"US"|"USA"|-80.33868312835693|25.79956276266678|"MIA"|"Miami"|6634|"localTgsProvider"|"+1 305 436 0830"|"+1 305 436 0840"|"MIA"|"S"|4.00|"Mile"|2010-05-28 10:56:25.573000000|"Updated"
Binary file
@@ -0,0 +1,178 @@
1
+ module AnixeCsv
2
+ module Formatter
3
+
4
+ def self.included(base)
5
+ base.class_eval do
6
+ extend ClassMethods
7
+ include InstanceMethods
8
+ end
9
+ end
10
+
11
+ module ClassMethods # visible in the singleton
12
+ def fields
13
+ @fields ||= {}
14
+ end
15
+
16
+ def rules
17
+ @rules ||= []
18
+ end
19
+
20
+ def delimiter(value=nil)
21
+ @delimiter = value
22
+ end
23
+
24
+ def get_delimiter
25
+ @delimiter ||= ','
26
+ end
27
+
28
+ def escape(from_str, to_str)
29
+ @escape = [from_str, to_str]
30
+ end
31
+
32
+ def get_escape
33
+ @escape ||= [get_delimiter,"_"]
34
+ end
35
+
36
+ def validate(field, regexp)
37
+ @fields[field].regexp = regexp
38
+ end
39
+
40
+ def field(*args, &block)
41
+ Field.new(*args).tap do |field|
42
+ self.fields[field.name] = field
43
+
44
+ field.block = block
45
+ create_accessor(field.name)
46
+ end
47
+ end
48
+
49
+ # A rule shall raise an exception if it is not conforming
50
+ def rule(&block)
51
+ rules << block
52
+ end
53
+
54
+ def headers
55
+ fields.keys.join(get_delimiter)
56
+ end
57
+
58
+ private
59
+ def create_accessor(name)
60
+ self.module_eval <<-end_eval
61
+ def #{name}
62
+ fields[:#{name}].value
63
+ end
64
+ def #{name}= (value)
65
+ fields[:#{name}].value = value
66
+ end
67
+ end_eval
68
+ end
69
+ end
70
+
71
+ module InstanceMethods # visible in the including class
72
+
73
+ # returns the value of the field by name or index
74
+ def [](arg)
75
+ return self.send(arg) if arg.kind_of? String
76
+ return fields.values[arg.to_i] if arg.kind_of? Fixnum
77
+
78
+ nil
79
+ end
80
+
81
+ # Reset all fields to nil or their default value
82
+ def clear!
83
+ set_field_values([])
84
+ self
85
+ end
86
+
87
+ def delimiter
88
+ singleton.get_delimiter
89
+ end
90
+
91
+ def fields
92
+ singleton.fields
93
+ end
94
+
95
+ alias kernel_to_s to_s # candy - otherwise formatting definition in field blocks would be called e.g. in irb
96
+ def inspect
97
+ to_hash
98
+ end
99
+
100
+ def to_hash
101
+ ary = fields.values.collect {|field| [field.name, field.value]}
102
+ Hash[ary]
103
+ end
104
+
105
+ # outputs all fields in one line and formats each field with a block if given
106
+ def to_s
107
+ values = fields.values.collect do |field|
108
+ value = field.to_s.to_s
109
+ value = value.tr(*singleton.get_escape)
110
+ validate_field(field, value) if validate?
111
+
112
+ value
113
+ end
114
+
115
+ singleton.rules.each do |rule|
116
+ rule.call(self)
117
+ end
118
+
119
+ values.join(delimiter)
120
+ end
121
+
122
+ def validate?
123
+ @validate
124
+ end
125
+
126
+ def validate=(value=true)
127
+ @validate = value
128
+ end
129
+
130
+ def values=(ary)
131
+ set_field_values(ary)
132
+ end
133
+
134
+ def values
135
+ fields.values.collect(&:value)
136
+ end
137
+ end
138
+
139
+ private
140
+ def singleton
141
+ self.class
142
+ end
143
+
144
+ def validate_field(field, value)
145
+ raise RegexpError, "Field '#{field.name}' contains an invalid value '#{value}' it should match #{field.regexp}" if field.regexp && value !~ field.regexp
146
+ end
147
+
148
+ # assign all the fields their values from an array, if nil is passed the default value is used
149
+ def set_field_values(array)
150
+ fields.values.each_index do |idx|
151
+ value = array[idx]
152
+ field = fields.values[idx]
153
+ value = field.default if value.nil?
154
+ field.value = value
155
+ end
156
+ end
157
+
158
+ class Field
159
+ attr_accessor :name, :value, :block, :default, :regexp
160
+
161
+ def initialize(*args)
162
+ @name = args[0]
163
+ @value = @default = args[1] unless args[1].nil?
164
+ end
165
+
166
+ def to_s
167
+ unless block.nil?
168
+ block.call(self.value, self)
169
+ else
170
+ value
171
+ end
172
+ end
173
+ end
174
+
175
+ class RuleError < StandardError
176
+ end
177
+ end
178
+ end
@@ -0,0 +1,16 @@
1
+ require 'zlib'
2
+ require 'anixe_csv/reader'
3
+
4
+ module AnixeCsv
5
+ # Yields a Row to the block provided
6
+ class GzipReader < Reader
7
+ def initialize
8
+ super
9
+ end
10
+
11
+ def open(path)
12
+ file = File.open(path, "r")
13
+ @file = Zlib::GzipReader.new(file)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,84 @@
1
+ # encoding: utf-8
2
+
3
+ require 'csv'
4
+ require 'iconv'
5
+ require 'anixe_csv/row'
6
+
7
+ module AnixeCsv
8
+ # Reads a csv file using the ruby csv class
9
+ # Arguments:
10
+ # path - full path to file
11
+ # options - see FasterCsv class
12
+ class Reader
13
+
14
+ ## Class Methods
15
+ # Yields a oww to the block provided
16
+ def self.read(path, options=Hash.new, &block)
17
+ raise ArgumentError, "Must provide a block to iterate over csv file" unless block_given?
18
+
19
+ self.open(path) do |reader|
20
+ reader.each_line(options, &block)
21
+ end
22
+ end
23
+
24
+ def self.open(path)
25
+ reader = self.new
26
+ reader.open(path)
27
+
28
+ if block_given?
29
+ yield reader
30
+ reader.close
31
+ else
32
+ reader
33
+ end
34
+ end
35
+
36
+ # parses a header_line and returns a hash of fields and their index
37
+ def self.parse_fields(header_line, options=Hash.new)
38
+ header = options[:split] ? Reader.split_line(header_line, options) : CSV.parse_line(header_line, options)
39
+ Hash[ header.collect {|v| [v.delete("\"").to_sym, header.index(v)] } ]
40
+ end
41
+
42
+ def self.split_line(line, options={:col_sep => ','})
43
+ line.split(options[:col_sep]).collect { |field| field.empty? ? nil : field }
44
+ end
45
+
46
+ ## Instance Methods
47
+
48
+ def initialize
49
+ @ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
50
+ end
51
+
52
+ def open(path)
53
+ @file = File.open(path, "r")
54
+ end
55
+
56
+ def close
57
+ @file.close unless @file.nil?
58
+ end
59
+
60
+ # reads all lines from the open file, and yields block for each file
61
+ def each_line(options, &block)
62
+
63
+ fields = read_fields(options)
64
+
65
+ line_no = 0
66
+ @file.each_line do |line|
67
+ begin
68
+ line_no += 1
69
+ valid_line = @ic.iconv(line.chomp + ' ')[0..-2] # convert to valid utf-8
70
+ row = options[:split] ? Reader.split_line(valid_line, options) : CSV.parse_line(valid_line, options)
71
+ yield(Row.new(row, fields))
72
+ rescue CSV::MalformedCSVError
73
+ raise CSV::MalformedCSVError, "#{$!.to_s.gsub(/\w+.$/, line_no.to_s)}" if options[:ignore_errors] == true
74
+ end
75
+ end
76
+ end
77
+
78
+ # reads the first line of a csv file and returns a collection with its field names
79
+ def read_fields(options=Hash.new)
80
+ header_line = options[:header_line] || @file.readline.chomp
81
+ Reader.parse_fields(header_line, options)
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,46 @@
1
+ module AnixeCsv
2
+ # A class returned by Reader, a wrapper around an array allowing to access fields by their names from the header of the file
3
+ class Row
4
+ include Enumerable
5
+ def initialize(row, fields)
6
+ throw ArgumentError unless row.kind_of? Array
7
+ throw ArgumentError unless fields.kind_of? Hash
8
+ @row = row
9
+ @fields = fields
10
+ end
11
+
12
+ attr_reader :row, :fields
13
+ #private :row, :fields
14
+
15
+ def method_missing(m, *args)
16
+ throw ArgumentError, "#{m} is not in the headers" unless @fields.keys.include? m
17
+ @row[@fields[m]]
18
+ end
19
+
20
+ def [](index)
21
+ @row[index]
22
+ end
23
+
24
+ def each(*args)
25
+ @row.each(*args) {|i| yield i}
26
+ end
27
+
28
+ def +(other)
29
+ new_row = (self.row + other.row)
30
+
31
+ header = merge_headers(self.fields, other.fields)
32
+ new_fields = Hash[ header.collect {|v| [v, header.index(v)] } ]
33
+
34
+ Row.new(new_row, new_fields)
35
+ end
36
+
37
+ def values
38
+ @row
39
+ end
40
+
41
+ def merge_headers(a, b)
42
+ a.keys + b.keys.collect {|k| a.keys.include?(k) ? "b#{k.to_s}".to_sym : k }
43
+ end
44
+ private :merge_headers
45
+ end
46
+ end
@@ -0,0 +1,3 @@
1
+ module AnixeCsv
2
+ VERSION = "0.0.1"
3
+ end
data/lib/anixe_csv.rb ADDED
@@ -0,0 +1,3 @@
1
+ module AnixeCsv
2
+ # Your code goes here...
3
+ end
@@ -0,0 +1,28 @@
1
+ require 'test_config'
2
+ require 'anixe_csv/formatter'
3
+
4
+ context 'Formatter' do
5
+ class CsvWriterRuleTest
6
+ include AnixeCsv::Formatter
7
+
8
+ delimiter ';' # field delimiter
9
+
10
+ field :one
11
+ field :two
12
+ field :three # pass-through
13
+ field :four
14
+
15
+ rule do |line|
16
+ raise "must be one" if line.one == 1
17
+ end
18
+ end
19
+
20
+ setup do
21
+ CsvWriterRuleTest.new.tap do |writer|
22
+ writer.values = [1, 2, 3, 4]
23
+ end
24
+ end
25
+
26
+ asserts(:to_s).raises(RuntimeError, "must be one")
27
+
28
+ end
@@ -0,0 +1,66 @@
1
+ require 'test_config'
2
+ require 'anixe_csv/formatter'
3
+
4
+ context 'Formatter' do
5
+ DEFAULT_TWO = "DefaultTwo"
6
+ VALUES = [1, nil, 3, 4, ';', nil]
7
+
8
+ class CsvWriterTest
9
+ include AnixeCsv::Formatter
10
+
11
+ delimiter ';' # field delimiter
12
+ escape ";&", "_" # escapes characters using string.tr
13
+
14
+ field :one do |value, field| "#{field.name}" end # access field meta data
15
+ field :two, DEFAULT_TWO # set a default if value is nil
16
+ field :three # pass-through
17
+ field :four do |value| "#{value}k" end # use a block to format the value
18
+ field :five # show escaping
19
+ field :six # nil field, no default
20
+ field :seven # assign by setter
21
+
22
+ validate :one, /^.{3}$/ # enforce maximum length
23
+ validate :three, /\d/ # validate this field with the regexp, recommended for quality data
24
+ end
25
+
26
+ setup { CsvWriterTest }
27
+ asserts(:headers).equals("one;two;three;four;five;six;seven")
28
+
29
+ context "set & output" do
30
+ setup do
31
+ CsvWriterTest.new.tap do |writer|
32
+ writer.values = VALUES # assign values using an array
33
+ writer.seven = "bread & butter"
34
+ writer.validate = true # validation must be turned on explicitely
35
+ end
36
+ end
37
+
38
+ [:one, :two, :three, :four, :five, :six, :seven].each do |item|
39
+ asserts_topic.respond_to(item)
40
+ end
41
+
42
+ asserts(:one).equals(1)
43
+ asserts(:two).equals(DEFAULT_TWO)
44
+ asserts(:three).equals(VALUES[2])
45
+ asserts(:four).equals(VALUES[3])
46
+ asserts(:five).equals(VALUES[4])
47
+ asserts(:six).nil;
48
+ asserts(:seven).equals("bread & butter")
49
+ asserts(:values).equals([1, DEFAULT_TWO, 3, 4, ";", nil, "bread & butter"])
50
+ asserts(:delimiter).equals(';')
51
+ asserts(:to_s).equals("one;DefaultTwo;3;4k;_;;bread _ butter")
52
+ asserts(:to_hash).equals({:one => 1, :two => DEFAULT_TWO, :three => 3, :four => 4, :five => ";", :six => nil, :seven => "bread & butter"})
53
+ end
54
+
55
+ context "#clear!" do
56
+ setup do
57
+ CsvWriterTest.new.tap do |writer|
58
+ writer.values = VALUES
59
+ writer.validate = true
60
+ end.clear!
61
+ end
62
+
63
+ asserts(:values).equals([nil, DEFAULT_TWO, nil, nil, nil, nil, nil])
64
+ asserts(:to_s).raises(RegexpError)
65
+ end
66
+ end
@@ -0,0 +1,15 @@
1
+ require 'test_config'
2
+ require 'anixe_csv/gzip_reader'
3
+
4
+ context 'Reader' do
5
+ setup do
6
+ filename = "./examples/PDS2_HotelInfo_THF2.csv.gz"
7
+ [].tap do |rows|
8
+ AnixeCsv::GzipReader.read(filename, :col_sep => '|') {|row| rows << row}
9
+ end
10
+ end
11
+
12
+ asserts_topic.size(99)
13
+ asserts("#all rows have 32 fields") { topic.any? {|r| r.count == 32 } }
14
+
15
+ end
@@ -0,0 +1,73 @@
1
+ require 'test_config'
2
+ require 'anixe_csv/reader'
3
+
4
+ context 'Reader' do
5
+ # helper(:filename) { "data/tourico/unit_test/PDS2_HotelInfo_THF.csv" }
6
+
7
+ context '#read' do
8
+ setup do
9
+ filename = "./examples/PDS2_HotelInfo_THF.csv"
10
+ [].tap do |rows|
11
+ AnixeCsv::Reader.read(filename, :col_sep => '|') do |row|
12
+ rows << row
13
+ end
14
+ end
15
+ end
16
+
17
+ asserts_topic.size(99)
18
+ asserts("#all rows have 32 fields") { topic.any? {|r| r.count == 32 } }
19
+ asserts("hotel names") { topic.collect {|h| h.HotelName } }.equals(["Rodeway Inn","Douar al Hana & Spa","Hotel Versan","Apartamentos Estelar Medellin","AS Hotel Monza","Cambay Spa & Resort Jaipur","Rodeway Inn Gardena/LA","Candlewood Suites","Atlantic Inn","Piao Home Inn Qian Men","Moevenpick Resort & Thalasso Crete","Hotel Savoia and Jolanda","Dionysos Mykonos Hotel","Sonora Days Inn","Novotel Accra City Centre","Fullon Hotel Sanying","Clube Praia da Rocha","Impressa","Jingyi Hotel","Berjaya Tioman Resort","Novotel Abidjan","Asia Palace Hotel Hanoi","Awwa Suites & Spa","Cambay Beach Resort","Radisson Inn Akron Fairlawn","Grand Hyatt Erawan Bangkok","Cambay Spa & Golf Resort","Zar Guadalajara","Radisson Blu Royal Hotel Dublin","Hanoi Advisor hotel","Costa Inn","Four Points by Sheraton","Grand Mercure Shanghai Zhongya","Cambay Boutique Apartment","Hotel Villa Igea","Pullman Abidjan","Novotel Dakar","Sleep Inn","White Peach Hotel","GRAND MIRAMAR CLUB & SPA","Novotel Orisha Cotonou","Berjaya Redang Resort","Comfort Suites near Industry Hills","Comfort Inn Woodland Hills","Days Inn Studio City/Hollywood","AS HOTEL BERGAMO","Sport","I Style Trendhotel","Deerfoot Inn Casino","Ca' Pisani Hotel","Panorama Hotel","The Palm Beach Club","UR MISION DE SAN MIGUEL","Pullman Teranga","Petinos Hotel","Fortina Hotel","Citycenter Hotel","Cambay Palm Lagoon Kollam","Kyriad Lyon Croix Rousse","Radisson Blu Hotel, Milan","Crowne Plaza Times Square","Park Central Hotel","Roosevelt Hotel","W - New York","Venetian Resort-Hotel-Casino","Holiday Inn Fisherman's Wharf","Comfort Inn Butte","Hilton Waterfront Beach Resort","La Quinta San Bernardino","La Quinta Denver Central","Nikko Union Square","La Quinta Alexandria","Monumental Hotel Orlando","La Quinta Texarkana","Westin Resort & Spa Cancun","Riu Palace Aruba All Inclusive","Hyatt Regency Aruba","British Colonial Hilton Nassau","Sheraton Nassau Beach Resort","Buenaventura Grand Hotel & Spa","Holiday Inn Bloomington Airport","Butterfly Beach","Cranley","Melia White House","Bled Hotel","Hotel Milano Corso Genova","Royal National Hotel","La Quinta Inn Irvine Spectrum","La Quinta Inn Dallas Lewisville","La Quinta Lomaland","La Quinta Oklahoma City Airport","La Quinta Inn Grand Prairie","Baymont Suites Highland Mall","La Quinta Inn Fort Myers Central","La Quinta Haywood Road","La Quinta Inn & Suites Fort Worth Southwest","La Quinta Inn & Suites Houston Park 10","La Quinta Inn Seaworld","La Quinta Airport West"])
20
+ end
21
+
22
+ context '#parse_fields' do
23
+ helper(:header) { '"HotelId"|"HotelName"|"ExclusiveDeal"|"CheckInHour"|"CheckOutHour"|"TotalRoomsInHotel"|"ThumbnailPath"|"ShortDescription"|"HotelCurrency"|"Stars"|"Address"|"AddressZip"|"AddressCity"|"Location"|"StateCode"|"State"|"CountryCode"|"CountryName"|"Longitude"|"Latitude"|"sDestination"|"sHotelCityName"|"DestinationId"|"Provider"|"Phone"|"Fax"|"NearestAirportIATACode"|"RefDirection"|"RefPointDist"|"DistUnit"|"TimeStamp"|"ProductStatus"' }
24
+ setup { AnixeCsv::Reader.parse_fields(header, :col_sep => '|') }
25
+ asserts(:keys).equals([:HotelId, :HotelName, :ExclusiveDeal, :CheckInHour, :CheckOutHour, :TotalRoomsInHotel, :ThumbnailPath, :ShortDescription, :HotelCurrency, :Stars, :Address, :AddressZip, :AddressCity, :Location, :StateCode, :State, :CountryCode, :CountryName, :Longitude, :Latitude, :sDestination, :sHotelCityName, :DestinationId, :Provider, :Phone, :Fax, :NearestAirportIATACode, :RefDirection, :RefPointDist, :DistUnit, :TimeStamp, :ProductStatus])
26
+ end
27
+
28
+ context 'uses header_line passed in options' do
29
+ helper(:header) { "HotelId|HotelName" }
30
+
31
+ setup do
32
+ file = ['12345|Armanda Beach','666|Pen']
33
+ reader = AnixeCsv::Reader.new
34
+ def reader.file=(file_string); @file = file_string; end
35
+ def file.each_line(&block); each(&block); end
36
+ def file.readline; shift; end
37
+ reader.file = file
38
+
39
+ result = []
40
+ reader.each_line({ :col_sep => '|', :split => true, :header_line => header}) do |row|
41
+ result << row.HotelId
42
+ result << row.HotelName
43
+ end
44
+
45
+ result
46
+ end
47
+
48
+ asserts_topic.equals(["12345", "Armanda Beach", "666", "Pen"])
49
+ end
50
+ context 'split' do
51
+ setup do
52
+ example = ["a,b,c,d,e", "1,2,3,,5"]
53
+ def example.each_line(&block); each(&block); end
54
+ def example.readline; shift; end
55
+
56
+ reader = AnixeCsv::Reader.new
57
+ def reader.file=(example); @file = example; end
58
+ reader.file = example
59
+
60
+ result = []
61
+ reader.each_line(:col_sep => ',', :split => true) do |row|
62
+ result << row
63
+ end
64
+
65
+ result.first
66
+ end
67
+
68
+ asserts(:fields).equals({:a=>0, :b=>1, :c=>2, :d=>3, :e=>4})
69
+ asserts(:values).equals(["1", "2", "3", nil, "5"])
70
+ end
71
+
72
+ end
73
+
data/test/row_test.rb ADDED
@@ -0,0 +1,58 @@
1
+ require 'test_config'
2
+ require 'anixe_csv/row'
3
+
4
+ context 'Row' do
5
+ context 'created from hash' do
6
+
7
+ setup do
8
+ fields = {:a => 0, :b => 1, :c => 3}
9
+ row = [1, 2, 3]
10
+ AnixeCsv::Row.new(row, fields)
11
+ end
12
+
13
+ asserts('#[0]') { topic[0] }.equals(1)
14
+ asserts(:b).equals(2)
15
+ asserts(:values).equals([1, 2, 3])
16
+ asserts(:non_existing_field).raises(ArgumentError)
17
+ end
18
+
19
+ context 'created from two hash' do
20
+ setup do
21
+ AnixeCsv::Row.new([1,2,5], {:a1 => 0, :a2 => 1, :dupe => 2}) + AnixeCsv::Row.new([3,4,6], {:b1 => 0, :b2 => 1, :dupe => 2})
22
+ end
23
+
24
+ asserts("united[0]") { topic[0] }.equals(1)
25
+ asserts("united[1]") { topic[1] }.equals(2)
26
+ asserts("united[2]") { topic[2] }.equals(5)
27
+ asserts("united[3]") { topic[3] }.equals(3)
28
+ asserts("united[4]") { topic[4] }.equals(4)
29
+ asserts("united[5]") { topic[5] }.equals(6)
30
+ asserts(:a1).equals(1)
31
+ asserts(:a2).equals(2)
32
+ asserts(:b1).equals(3)
33
+ asserts(:b2).equals(4)
34
+ asserts(:dupe).equals(5)
35
+ asserts(:bdupe).equals(6)
36
+
37
+ end
38
+
39
+ context 'when adding two Rows using + they should merge' do
40
+ setup do
41
+ a = AnixeCsv::Row.new(
42
+ ["4505", "La Quinta Airport West", "0", "15", "11", "143", "http://image1.urlforimages.com/4505/exterior_Thumbnailed.jpg", "With its amazing views; great location; and affordable rates; the La Quinta Airport West is perfect for any traveler on any occasion", "USD", "3", "8730 North West 27th Street", "33172", "Miami", "Miami International Airport Area", "FL", "Florida", "US", "USA", "-80.33868312835693", "25.79956276266678", "MIA", "Miami", "6634", "localTgsProvider", "+1 305 436 0830", "+1 305 436 0840", "MIA", "S", "4.00", "Mile", "2010-05-28 10:56:25.573000000", "Updated"],
43
+ {:HotelId=>0, :HotelName=>1, :ExclusiveDeal=>2, :CheckInHour=>3, :CheckOutHour=>4, :TotalRoomsInHotel=>5, :ThumbnailPath=>6, :ShortDescription=>7, :HotelCurrency=>8, :Stars=>9, :Address=>10, :AddressZip=>11, :AddressCity=>12, :Location=>13, :StateCode=>14, :State=>15, :CountryCode=>16, :CountryName=>17, :Longitude=>18, :Latitude=>19, :sDestination=>20, :sHotelCityName=>21, :DestinationId=>22, :Provider=>23, :Phone=>24, :Fax=>25, :NearestAirportIATACode=>26, :RefDirection=>27, :RefPointDist=>28, :DistUnit=>29, :TimeStamp=>30, :ProductStatus=>31}
44
+ )
45
+ b = AnixeCsv::Row.new(
46
+ ["4505", "La Quinta Airport West", "localTgsProvider", "17", "2142", "3", "Standard", "4", "2", "2005-08-14 00:31:56.143000000", "NoChange"],
47
+ {:HotelID=>0, :HotelName=>1, :Provider=>2, :ChildAge=>3, :HotelRoomTypeId=>4, :RoomId=>5, :RoomTypeName=>6, :MaxAdults=>7, :MaxChild=>8, :TimeStamp=>9, :ProductStatus=>10}
48
+ )
49
+
50
+ a + b
51
+ end
52
+
53
+ asserts(:RoomTypeName).equals("Standard")
54
+ asserts(:bHotelName).equals("La Quinta Airport West")
55
+ asserts(:HotelName).equals("La Quinta Airport West")
56
+
57
+ end
58
+ end
data/test/test.rake ADDED
@@ -0,0 +1,7 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new(:test) do |test|
4
+ test.pattern = 'test/**/*_test.rb'
5
+ test.libs << ["test", "lib"]
6
+ test.verbose = true
7
+ end
@@ -0,0 +1,24 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ Bundler.setup
4
+
5
+ require 'riot'
6
+ require 'anixe_csv'
7
+
8
+ class Riot::Situation
9
+ # include Rack::Test::Methods
10
+ end
11
+
12
+ class Riot::Context
13
+ # Set the Rack app which is to be tested.
14
+ #
15
+ # context "MyApp" do
16
+ # app { [200, {}, "Hello!"] }
17
+ # setup { get '/' }
18
+ # asserts(:status).equals(200)
19
+ # end
20
+ def app(app=nil, &block)
21
+ setup { @app = (app || block) }
22
+ end
23
+ end
24
+
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: anixe_csv
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Piotr Zolnierek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-03-07 00:00:00 +01:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: as above
18
+ email:
19
+ - pz@anixe.pl
20
+ executables: []
21
+
22
+ extensions: []
23
+
24
+ extra_rdoc_files: []
25
+
26
+ files:
27
+ - .gitignore
28
+ - Gemfile
29
+ - Rakefile
30
+ - anixe_csv.gemspec
31
+ - examples/PDS2_HotelInfo_THF.csv
32
+ - examples/PDS2_HotelInfo_THF2.csv.gz
33
+ - lib/anixe_csv.rb
34
+ - lib/anixe_csv/formatter.rb
35
+ - lib/anixe_csv/gzip_reader.rb
36
+ - lib/anixe_csv/reader.rb
37
+ - lib/anixe_csv/row.rb
38
+ - lib/anixe_csv/version.rb
39
+ - test/formatter_rule_test.rb
40
+ - test/formatter_test.rb
41
+ - test/gzip_reader_test.rb
42
+ - test/reader_test.rb
43
+ - test/row_test.rb
44
+ - test/test.rake
45
+ - test/test_config.rb
46
+ has_rdoc: true
47
+ homepage: ""
48
+ licenses: []
49
+
50
+ post_install_message:
51
+ rdoc_options: []
52
+
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: "0"
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ requirements: []
68
+
69
+ rubyforge_project: anixe_csv
70
+ rubygems_version: 1.5.0
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: Read and write Csv files, easily
74
+ test_files:
75
+ - test/formatter_rule_test.rb
76
+ - test/formatter_test.rb
77
+ - test/gzip_reader_test.rb
78
+ - test/reader_test.rb
79
+ - test/row_test.rb
80
+ - test/test.rake
81
+ - test/test_config.rb