I have a file (tsm) as below :
V1 V2
Library Name: abc
DriveName: 123
Device Type: xyz
WWN: 567
Library Name: feg
DriveName: 124
Device Type: wef
WWN: 312
I want to get an output with only the drive name followed by wwn.
I have tried , but I get a <0 rows> (or 0-length row.names) message.
> tsm[grep("DriveName | WWN",tsm$V1,fixed = TRUE) , ] [1] V1 V2 <0 rows> (or 0-length row.names)
grep("^(DriveName|WWN)", tsm$V1)"DriveName | WWN"or the argumentfixed = TRUE?