#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

	NSString *path, *text;
	NSError *error;
	
	path =[[@"~" stringByExpandingTildeInPath]
		   stringByAppendingString:@"/sample2.txt"];
	text =[NSString stringWithContentsOfFile:path
									encoding:NSUTF8StringEncoding
									   error:&error];
	
	NSArray *lines;
	lines = [text componentsSeparatedByString:@"\n"];
	
	NSString *line;
	for (int i = 0; i < [lines count]; i++) {
		line = [lines objectAtIndex:i];
		if ([[line stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length] !=0) {
			 NSLog(@"%d: %@", i, line);
		}
	}
	

    [pool drain];
    return 0;
}
