A tab uses a fixed length (8 is very common).
The first entry you use (RSU-1-1) is 7 characters and using a tab after that will only add 1.
The second example (RSU-1-10) has 8 characters and using a tab will add 8:
Code:
$ tr '\n' '\t' < infile
RSU-1-1 15:40 2
$ tr '\n' '\t' < infile2
RSU-1-10 15:40 2
One of the reason I personally do not like tabs.
You can use awk to do this:
Code:
$ awk 'BEGIN { ORS=" " } { print }' infile
RSU-1-1 15:40 2
The above will put 5 spaces between each entry.
You could also set the tab width before executing the tr command:
Code:
$ tabs -11
$ tr '\n' '\t' < infile
RSU-1-1 15:40 2
$ tr '\n' '\t' < infile2
RSU-1-10 15:40 2
In the above example the tabs are set to 11