Skip to content
Prev 353579 / 398503 Next

String Matching

Hey everyone,?

? I have been having an issue trying to find a specific string of text in a log of system messages. ?I have tried to use pmatch, match, and some regular expressions but all to no avail. ?

I have a matrix / data.frame (either one, the file outputs a tens of thousands of rows with a single column) of strings in the following format with different items after INFO:
?"09:11:57.259 - Assay File Processing Thread - INFO - SolenoidCycleMessage: Addr = 0x03 "

as an example I would like to match "SolenoidCycleMessage"
searchString<-"SolenoidCycleMessage"
matchString<-"09:11:57.259 - Assay File Processing Thread - INFO - SolenoidCycleMessage: Addr = 0x03"
[1] NA
[1] NA
[1] NA
[1] 1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?c(matchString, string1, string2)
1 09:11:57.259 - Assay File Processing Thread - INFO - SolenoidCycleMessage: Addr = 0x03?
2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?23:12:43.22 - Test
3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?test
integer(0)
[1] 1

Doe anyone have some input that could help?

Thanks,?
Kevin