unexpand - it is used to convert blanks in each FILE to tabs, writing to standard output 

syntax
$ unexpand [OPTION] [FILE]

To convert blanks in a file to tabs and write the output to stdout
$ unexpand sample.txt

To write the output to a file
$ unexpand sample.txt > unexpand_output.txt

To convert blanks to tabs, reading from standard output
$ unexpand

To convert all blanks, instead of just initial blanks
$ unexpand -a sample.txt

To convert only leading sequences of blanks
$ unexpand --first-only sample.txt

To have tabs a certain number of characters apart
$ unexpand -t 4 sample.txt

To mention multiple tab positions 
$ unexpand -t 5,10,15 sample.txt



regards,
T.Dhanasekar