I'm trying to clean a file from description, special characters and get only the ID column and the count column without the backslash. I was able to remove the description, but I want to remove the backslash, I used:
sed '/^{/d' GSM2580320_counts.txt | tr '\\' ' ' | grep -vE '^__' GSM2580320_counts.txt> GSM2580320_counts01.txt
cat GSM2580320_counts01.txt | head
This is the output:
ID Count
ENSG00000005075 459\
ENSG00000005100 1766\
ENSG00000005102 10\
ENSG00000005108 14517\
ENSG00000005156 3101\
ENSG00000005175 867\
ENSG00000005187 6\
ENSG00000005189 307\
ENSG00000005194 1368\
ENSG00000005206 2429\
I tried:
sed 's/\\//g'
Also:
sed 's/\\/ /g'
But not luck!
tail of data:
ENSG00000285991 2\
ENSG00000285992 0\
ENSG00000285993 0\
ENSG00000285994 20\
__no_feature 7388512\
__ambiguous 1016493\
__too_low_aQual 0\
__not_aligned 2087327\
__alignment_not_unique 5970495\
}
head of data:
ENSG00000005075 459\
ENSG00000005100 1766\
ENSG00000005102 10\
ENSG00000005108 14517\
ENSG00000005156 3101\
ENSG00000005175 867\
ENSG00000005187 6\
ENSG00000005189 307\
ENSG00000005194 1368\
ENSG00000005206 2429\
You might want to roll everything into a single sed
script.
sed -e '/^{/d' -e '/^__/d' -e 's/\\//g' GSM2580320_counts.txt > GSM2580320_counts01.txt
If you only want to remove backslash at end of line, use s/\\$//
For anything more complicated, probably replace sed
with Awk.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments