清洗細胞我有一個表如何使用正則表達式SAS
id Attribute Other
1 Written Jan 20 File: 78yt8fgkje ....
2 12/22/2004 File: 3Bsdffsdf85 ....
3 12/17/2004 File: 5Osdfdsf58384 ....
4 Some May File: 0w98ejcj ....
5 10/24/2001 File: 2Ddsfsdfd1429 ....
....................
我需要刪除那張的File:
字後在一切Attribute
變量
我怎麼能做到這一點?
我從互聯網上試過這個解決方案。它不工作,我不明白什麼是32767
data newDataSet;
set oldDataSet;
regex1 = prxparse("/ File:.*? /");
call prxchange(rx1, 32767, Attribute);
run;
標準RegExp(^。*?文件:) - ^表示文本的開始,。*?是一個非貪婪的查找任何字符零次或多次,文件:只是你想要的字符串的末尾。 –
謝謝你的回覆。我想擺脫'文件.......'部分並留下任何前面的內容。你能糾正我的編碼嗎?謝謝 –
32767是進行更改的次數。它顯示沒有很好地閱讀文檔的人,因爲-1會匹配所有人。 – Joe