in reply to Tab Stop Converter
First idsfa's golfed to 85 keystrokes:
perl -pi -e 'split/\t/;map{$_.=q/ /x4;substr$_,0,4*int length($_)/4}@_ +' filename.txt
And atcroft's golfed to 78 keystrokes:
perl -pi -e 'while(/\t/g){$d=(4-pos%4)%4+1;$x=q/ /x$d;s/\t/$x/}' filen +ame.txt
...both in convenient one line form for your tab-conversion-pleasure. ;)
Fun exercise. Thanks for the snippets idsfa and atcroft. You guys had working versions while I was still working out the logic on mine (which never saw the light of day).
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
|
|---|