Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 247367

Manipulation or examining of text by programs, scripts, etc.

3
votes
Try to use awk: awk '$2 !~ /^22696$/' file This command checks second field ($2; spaces as delimeter by default) for exact matching (/22696/) from start position (^) to end position ($) and invert …
answered Jan 26 '18 by Egor Vasilyev
0
votes
Except grep you could try to use sed: sed 's/\([0-9]*\.\)\{3,3\}.*$//' With input from echo: echo "sgdgfhfh-ZZZZZZ-ZZZ-2.0.12.ZZ" | sed 's/\([0-9]*\.\)\{3,3\}.*$//' In bash script: First, crea …
answered Sep 25 '17 by Egor Vasilyev
1
vote
You could try this: sed 's/~.*~//' file > file_new Output will: 478|14395189_p0.jpg 479|44836628_p0.jpg 480|Miku_Collab_2_by_Luciaraio.jpg
answered Sep 7 '17 by Egor Vasilyev
1
vote
You could use simple s/// pattern: echo "<john></john>" | sed 's/<john><\/john>/<john>hello<\/john>/' Output will be: <john>hello</john> To replace certain line in file use this command: sed '1 …
answered Nov 20 '17 by Egor Vasilyev
1
vote
Use cut: cut -d, -f 1-6 file Or awk: awk -F, '{OFS=","; print $1,$2,$3,$4,$5,$6}' file In both cases the output will be: "AERH1","505549_AdelaideCBDWest_3@505549_AdelaideCBDWest_3",BTS3900,16,1 …
answered Oct 5 '17 by Egor Vasilyev
0
votes
Try this: grep "is the" file | sed 's/.*blah://;s/;.*//' | sort -u Explanation: grep gets all lines with "is the" (in any part of the line) sed remove all before ":" and after ";" (you could use …
answered Sep 26 '17 by Egor Vasilyev
3
votes
Or other approach with smallest difference of your example: #!/bin/bash while read -r column1 column2 column3; do if [ -z "$column2" ] ; then printf '%s\n' "Only first column …
answered Oct 29 '17 by Egor Vasilyev
1
vote
Or with grep: grep -v "_" file -v, --invert-match Invert the sense of matching, to select non-matching lines. To delete line if only "_" in the first column: grep -v "^chr[0-9]_" file
answered Sep 28 '17 by Egor Vasilyev