objective c - CHCSVParsing an unusual csv file -


i'm having difficulties how should parse kind of csv file.

for example:

06:16 pm,7,299,http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0026_heavy_rain_showers_night.png,moderate rain @ times,14,22,180,s,3.1,81,10,993,75 2014-01-31,9,48,3,38,22,35,176,s,119,http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0003_white_cloud.png,cloudy,6.0 2014-02-01,7,45,3,37,19,30,220,sw,113,http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0001_sunny.png,sunny,2.2 2014-02-02,9,47,3,37,17,27,236,sw,113,http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0001_sunny.png,sunny,0.0 2014-02-03,8,46,3,37,21,34,152,sse,116,http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png,partly cloudy,1.8 2014-02-04,9,48,3,38,20,32,191,ssw,263,http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0009_light_rain_showers.png,patchy light drizzle,1.4 "london","united kingdom","city of london, greater london",51.517,-0.106,7421228,http://www.worldweatheronline.com/london-weather/city-of-london-greater-london/gb.aspx 

for example, need first 2 values on first line, values on 2nd 6th line, , first value of 7th line.

i have model class properties values need get.

i'm not sure how in situation. far, know how parse csv (if didn't need first 2 values on 1st line, , first value of 7th line)

what logic parse in situation? hope guys can give me idea how it.

thanks

split string lines (busing scanner or array method depending on how big string is). once have lines, takes special ones , pass appropriate methods extract required values. likewise main lines.

you can use parser on each line individually or use scanner or array method if that's easier depending on content need extract , is.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -