-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmfa_fix_scripts_extras.txt
More file actions
27 lines (17 loc) · 928 Bytes
/
xmfa_fix_scripts_extras.txt
File metadata and controls
27 lines (17 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sed 's/find/replace/' 6.eliz.core_alignment.xmfa
To remove everything except the 1st n characters in every line:
sed -r 's/^>[." e*"]//' Test-to-remove-headers.txt
sed -r 's/^>..* -*/>/' Test-to-remove-headers.txt
NOTES:
You can remove one of the periods with no effect:
sed -r 's/^>.* -*/>/' Test-to-remove-headers.txt
If you escape the + and add a . you can remove only the headers with positive strands
sed -r 's/^>.* \+.*/>/' Test-to-remove-headers.txt > tested.txt
If you escape the - and add a . you can remove only the headers with positive strands
sed -r 's/^>.* \-.*/>/' Test-to-remove-headers.txt > tested.txt
You can escape the space with no effect:
sed -r 's/^>.*\ -*/>/' Test-to-remove-headers.txt > tested.txt
Can use +- or -+ also
sed -r 's/^>.* -+*/>/' Test-to-remove-headers.txt > tested.txt
sed -r 's/^>.* +-*/>/' Test-to-remove-headers.txt > tested.txt
sed -r 's/.* />/' Also works (Thanks Dana!)