FORUMhow to remove trailing tabs at the end of lines in sync file
Ella Bowles asked 4 months ago



I am wondering if there is an easy way to remove tabs at the ends of lines of sync files? My file looks like the following, but there are trailing tabs at the ends of the lines.
LG1     117     G       10:0:0:17:0:0   15:0:0:17:0:0
LG1     129     T       0:11:17:0:0:0   0:16:20:0:0:0
LG1     192     A       17:0:15:0:0:0   23:0:20:0:0:0
My file is about 6 million lines long. I can use any of R, unix, mobaxterm on PC or windows power shell.

1 Answers
Best Answer
zhibin Staff answered 4 months ago



The following command will remove white space at the end of each line.
sed ‘s/\s*$//’ file

Ella Bowles replied 4 months ago

many thanks!