SLIDE 1
Resources for Computational Linguists seminar ss07 unix tools - - PowerPoint PPT Presentation
Resources for Computational Linguists seminar ss07 unix tools - - PowerPoint PPT Presentation
Resources for Computational Linguists seminar ss07 unix tools Michaela Regneri Magdalena wolska 30 April 2007 SS07 Res4CompLingsts unix /30 cat file btw, man command less / more file head [-n] / tail [-n] file | cat file | less wc
SLIDE 2
SLIDE 3
30 April 2007 SS07 – Res4CompLingsts – unix /30
grep pattern file grep „a” testtext.txt grep „^a” testtext.txt grep „^A” testtext.txt grep „c$” testtext.txt grep „a.*d” testtext.txt grep –i „a” testtext.txt grep „[Aa]” testtext.txt grep –v „[Aa]” testtext.txt
SLIDE 4
30 April 2007 SS07 – Res4CompLingsts – unix /30
sort file sort testtext.txt sort –r testtext.txt sort testnums.txt sort –n testnums.txt sort –rn testnums.txt uniq file uniq testtext.txt sort testtext.txt | uniq sort testtext.txt | uniq -c
SLIDE 5
30 April 2007 SS07 – Res4CompLingsts – unix /30
tr – translate or delete chars tr ‘a-z’ ‘A-Z’ < example.txt tr –c ‘0-9a-zA-Z’ ‘\n’ < example.txt tr –c ‘[:alpha:]’ ‘\n’ < example.txt tr –d ‘\15\32’ < example.txt tr ‘\r\n’ ‘ ‘ < example.txt tr –s ‘[:alpha:]’ < testtext.txt
SLIDE 6
30 April 2007 SS07 – Res4CompLingsts – unix /30
sed – stream editor sed G example.txt sed 3q example.txt sed –n ‘/regexp/p’ example.txt sed s/New\ York/Saarbruecken/ example.txt http://www.student.northpark.edu/pemente/sed/sed1line.txt
SLIDE 7