printf "%s\t" HEMES n{1..1600} >file_a
sed -i 's/\t*$//' file_a > file_a
removes a tab which is caused at the end of the line after the first line of the code (where the stuff is printed) .
My problem is now that i would need to remove the tab behind that line (starting with HEMES) in a larger file which has more lines. If I just try the sed line that does not work. The line I want to remove the character from is always the first line of the file .
sed -i 's/\t*$//' file_a > file_a
will wipe out your file. Did you meansed -i 's/\t*$//' file_a
?