This exercise is taken from the K&R, but feel free to use any language you want.
Exercise 1-20. Write a program detab that replaces tabs in the input with the proper number
of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every 4 columns.