Page 1 of 1
Replace Blank
Posted: Tue Nov 30, 2004 7:55 pm
by christian
I'm a absolute beginner and i have the problem to replace Tabs with Blanks. I can find the Tabs ( \t) with search and replace, but i didn't find out how to replace with Blanks. Which sequence is to key in into the replace field.
kind regards
Posted: Tue Nov 30, 2004 8:28 pm
by ben_josephs
You can't do it that way, because different tabs need to be replaced by different numbers of spaces.
Go to Document Properties (Alt+Enter), select the "Tabulation" tab, set "Default tab spacing" to whatever you want, select "Convert existing tabs to spaces when saving files". Than make sure the file needs saving (e.g. by overwriting a space with a space), and save it.
Posted: Tue Nov 30, 2004 9:31 pm
by bveldkamp
AFAIK you can just type in the desired number of spaces in the "Replace" box. Works for me anyway.
Berend
Posted: Tue Nov 30, 2004 9:54 pm
by ben_josephs
bveldkamp wrote:AFAIK you can just type in the desired number of spaces in the "Replace" box.
Doesn't work for tabs preceded by spaces or for interior tabs.
Posted: Tue Nov 30, 2004 10:19 pm
by bveldkamp
Dunno, but all tabs are replaced by spaces. Maybe if you want to preserve indenting you have a problem, but that's not what the OP asked for.
What exactly is an "interior tab"?
Posted: Tue Nov 30, 2004 10:29 pm
by ben_josephs
bveldkamp wrote:What exactly is an "interior tab"?
One with at least one non-white-space character somewhere to the left of it, used, perhaps, to line up a column on the right.
Posted: Wed Dec 01, 2004 11:36 am
by bveldkamp
OK, but I still don't see why you wouldn't be able to replace those by blanks. Or maybe I'm completely missing the point?
Posted: Wed Dec 01, 2004 11:56 am
by ben_josephs
Probably the primary use of tabs is to line text up vertically. If that is their purpose in this case, and if the effect is to be maintained, then the number of spaces required to replace each individual tab character depends on the positions of the tab stops and on the position of that tab. If the tab stops are at columns 1, 9, 17, 25, ... then a tab at column 9 needs to be replaced with 8 space characters, one at 10 with 7,... one at 16 with 1, one at 17 with 8, and so on.
I presumed that the original poster's problem was not merely the inability to type a space in the "Replace with" field. But the original message is ambiguous, and I may be wrong.
Posted: Wed Dec 01, 2004 5:47 pm
by Bob Hansen
Could replace the Tab with one space, then replace multiple spaces with whatever quantity is needed if alignment is an issue. Just means multiple S/R passes vs. one.
Posted: Wed Dec 01, 2004 6:20 pm
by ben_josephs
No. That's not how tabs work. Different instances of tab represent different amounts of white space. That's the point of their existence. Besides, how can changing single tabs to single spaces help as an intermediate step?
Tabs
Posted: Mon Dec 27, 2004 5:34 pm
by charles
Aren't tabs more reference to fixed column rather than "amount of whitespace" ?
As far as tab handling in editing/RegExp, they're treated as a single char ...