From: Nathan Thickett-menghini Date: 2007-09-19T01:36:50+09:00 Subject: Re: errors, trying to edit and write some text files Many thanks - you're helping me hugely. I've gone through the script and made the changes you suggested and it has worked in the most part. The part of the script that parses the lines is now as follows: today = `curl -s "#{URL}"?due=0`.split("\n").select{|line| line =~ /\s+/} tomorrow = `curl -s "#{URL}"?due=1`.split("\n").select{|line| line =~ /\s+/} this_week = `curl -s "#{URL}"?due=6`.split("\n").select{|line| line =~ /\s+/} later = `curl -s "#{URL}"?due=365`.split("\n").select{|line| line =~ /\s+/} I'm sure this is not perfect but it seems to do the trick of including the lines that begin with blank space. Let me show you the feed as you requested. HOME: [18/09/2007] Parcelforce coming after 1pm [19/09/2007] be a bender [21/09/2007] Sort important documents etc WORK: [24/09/2007] Learn NATS Stuff CAR: [30/09/2007] nob So you see there are lines that begin with letters (these are the contexts, Home, Work, etc) lines with a small gap followed by events, and lines that are entirely blank. You'll have noticed that part of the script deletes duplicate lines - so that you don't get an event that is on today's feed repeated on the weekly feed. This works mostly but it also deletes repeated CONTEXTS, i.e. the context 'HOME:' will appear on today's feed but not on any others. I've tried to get round this by totally abandoning all contexts, i.e. changing the part that parses the lines to NOT INCLUDE lines that begin with word characters. This works, but it now still includes the totally empty lines, which puts gaps in my text files. Could you add a tiny part to the following line to show me how to NOT include empty lines? Is this possible? I know it seems like a lot of effort for a small problem, but I'd really appreciate it, it will make me more productive to see my events neatly on my desktop. today = `curl -s "#{URL}"?due=0`.split("\n").select{|line| line =~ /\s+/} -- Posted via http://www.ruby-forum.com/.