Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 8, 2008, 06:33 AM   #1
iphonejudy
macrumors 6502
 
Join Date: Sep 2008
Parsing Text file

Hi,

I want to parse a text file.

I used the below code for parsing .xml file.


http://theappleblog.com/2008/08/04/t...er-for-iphone/

In this code i cannot parse .txt file.

Can anybody please give me the code?

Regards
judy
iphonejudy is offline   0 Reply With Quote
Old Dec 8, 2008, 10:45 AM   #2
jnic
macrumors 6502a
 
Join Date: Oct 2008
Location: Cambridge
You're going to tell us what format the file you're trying to parse is in.
jnic is offline   0 Reply With Quote
Old Dec 9, 2008, 10:52 PM   #3
iphonejudy
Thread Starter
macrumors 6502
 
Join Date: Sep 2008
Quote:
Originally Posted by jnic View Post
You're going to tell us what format the file you're trying to parse is in.


I want to display a .txt file from the http connection.

Like http://myweb.com/file.txt.


judy
iphonejudy is offline   0 Reply With Quote
Old Dec 10, 2008, 11:31 AM   #4
xsmasher
macrumors regular
 
Join Date: Jul 2008
You want [NSData dataWithContentsOfURL:myURL]; Then you can get the [NSData bytes] , and move through the bytes as though they were an array of chars.

Or you could do [NSString stringWithContentsOfURL:encoding:error:] and use string methods to split it up further.
xsmasher is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Append Text to Text File in Applescript BobRon Mac Programming 2 Mar 23, 2014 02:52 PM
TxtPub - Text file reader app by converting text to ePub automatically. Ralph Kim iPad Apps 0 Apr 26, 2013 09:13 PM
Trying to Convert nvAlt text file to MS Word .doc file thelucas Mac Applications and Mac App Store 2 Apr 8, 2013 07:59 PM
parsing text similar to markdown mraheel iPhone/iPad Programming 11 Jan 30, 2013 08:47 AM
Parsing text/html MKNetworkKit nashyo iPhone/iPad Programming 2 Jun 30, 2012 04:21 AM

Forum Jump

All times are GMT -5. The time now is 09:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC