Skip to content

Instantly share code, notes, and snippets.

@pjspillai
Created May 21, 2019 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjspillai/90edbcb06a4c8dc4b70b7848c3cfa3de to your computer and use it in GitHub Desktop.
Save pjspillai/90edbcb06a4c8dc4b70b7848c3cfa3de to your computer and use it in GitHub Desktop.
Bash , Sed shortcuts
Replace first character in each line with another
(Useful for annotatin label replaceing stuff)
inp_file.txt
1 chrX_73833098_73834098
1 chrX_73889652_73890652
1 chrX_91194501_91195501
1 chrX_92000157_92001157
1 chrX_92106500_92107500
out_file.txt
0 chrX_73833098_73834098
0 chrX_73889652_73890652
0 chrX_91194501_91195501
0 chrX_92000157_92001157
0 chrX_92106500_92107500
b sed 's/1/0/1' file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment