Thank you all for your help, this has solved my problem. My main
problem with using gsubfn was that i was getting confused by the
square brackets in
[^]]+[^]
but I now have a much better understanding of what this means.
Cheers!
Tony Breyal
On 6 May, 19:38, Gabor Grothendieck wrote:
> This is
This is very similar to the solution in Jim's post
except the regular expressions can be made
slightly simpler due to the use of strapply and a
few of the regular expressions have been made a
bit different even apart from that. Its not
always clear what the general case is based on example
so the
Try this:
> cat(c("[ID: 001 ] [Writer: Steven Moffat ] [Rating: 8.9 ] Doctor Who",
+ "[ID: 002 ] [Writer: Joss Whedon ] [Rating: 8.8 ] Buffy",
+ "[ID: 003 ] [Writer: J. Michael Straczynski ] [Rating: 7.4
]Babylon"),
+ sep = "\n", file = "tmp.txt")
>
> # read in the data and parse
Hi Tony,
On Thu, May 6, 2010 at 9:58 AM, Tony B wrote:
> Dear all
>
> Lets say I have a plain text file as follows:
>
>> cat(c("[ID: 001 ] [Writer: Steven Moffat ] [Rating: 8.9 ] Doctor Who",
> + "[ID: 002 ] [Writer: Joss Whedon ] [Rating: 8.8 ] Buffy",
> + "[ID: 003 ] [Writer: J. Mic
Dear all
Lets say I have a plain text file as follows:
> cat(c("[ID: 001 ] [Writer: Steven Moffat ] [Rating: 8.9 ] Doctor Who",
+ "[ID: 002 ] [Writer: Joss Whedon ] [Rating: 8.8 ] Buffy",
+ "[ID: 003 ] [Writer: J. Michael Straczynski ] [Rating: 7.4 ]
Babylon [5]"),
+ sep = "\n",
5 matches
Mail list logo