Re: [R] Regex to remove last character

2011-01-03 Thread Martin Morgan
On 01/03/2011 02:44 PM, David Winsemius wrote: > > On Jan 3, 2011, at 2:24 PM, rivercode wrote: > >> >> Hi, >> >> Have been having trouble trying to figure out the right regex >> parameters to >> remove the last "." in timestamp with the following format: >> >> Convert 09:30:00.377.853 to 09:30:

Re: [R] Regex to remove last character

2011-01-03 Thread Henrique Dallazuanna
Try this: format(strptime("09:30:00.377.853", "%T%OS"), "%H:%M:%OS") On Mon, Jan 3, 2011 at 5:24 PM, rivercode wrote: > > Hi, > > Have been having trouble trying to figure out the right regex parameters to > remove the last "." in timestamp with the following format: > > Convert 09:30:00.377.85

Re: [R] Regex to remove last character

2011-01-03 Thread David Winsemius
On Jan 3, 2011, at 2:24 PM, rivercode wrote: Hi, Have been having trouble trying to figure out the right regex parameters to remove the last "." in timestamp with the following format: Convert 09:30:00.377.853 to 09:30:00.377853 gsub("()(\\.)(.{3}$)", "\\1\\3" , "09:30:00.377.853") [1]

[R] Regex to remove last character

2011-01-03 Thread rivercode
Hi, Have been having trouble trying to figure out the right regex parameters to remove the last "." in timestamp with the following format: Convert 09:30:00.377.853 to 09:30:00.377853 Thanks, Chris -- View this message in context: http://r.789695.n4.nabble.com/Regex-to-remove-last-charact