in reply to One liner asked... :)
Actually, you don't. A tab isn't a certain number of spaces, it's a tab. Various text editors/word processors will represent the tab as a number of spaces. Depending on your settings, they may actually save (X) spaces when you hit tab, rather than save the tab.
Generally you want to convert tabs to spaces or spaces to tabs. My attempt to do what I think you mean is to either:
Or to reverse it:while (<>){ s/\t/ /g; }
Note that reversing it isn't an actual reversal....it replaces all sequences of spaces with tabs, even if they weren't originally a tab.while (<>){ s/ /\t/g; }
|
|---|