0
當我使用命令下面的grep我的目標串px
grep的字符串
x <- grep('px', readLines("file.txt"))
[]an$px
[1] 2 12 # x returns 2 and 12th line
但是,當我想用grep字符串作爲[1]$px
x <- grep('[1]$px', readLines("file.txt"))
x
回報integer(0)
我的問題是,我怎樣才能得到2
和12
,而不是integer(0)
如果我的目標字符串是[1]$px
?
請剪切並粘貼文件(或其中的一部分)的文本,而不是發佈圖片鏈接! – Spacedman