Expand tabs

G

Guest

I have a document created from an Excel spreadsheet. When I convert table to
text, I delimit with tabs, then save as a text file. I now want to upload to
a mainframe, but first I need to expand the tabs to the requisite number of
spaces. This is done in many editors, but I don't have any of them! Does
anyone have a macro to do this in Word?
 
J

Jay Freedman

Numfric said:
I have a document created from an Excel spreadsheet. When I convert
table to text, I delimit with tabs, then save as a text file. I now
want to upload to a mainframe, but first I need to expand the tabs to
the requisite number of spaces. This is done in many editors, but I
don't have any of them! Does anyone have a macro to do this in Word?

Just use Edit > Replace. In the Find What box, enter ^t which is the code
for a tab. In the Replace With box, press the spacebar as many times as you
want to have spaces for each tab. Click the Replace All button.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

The number of spaces depends on the length of the preceding string. I need a
variable number of tabs so that the next column lines up on each row e.g.
Lou Reed Singer
Elvis Presley Singer
so on the first line, the first tab converts to 5 spaces, on the second
line, it converts to 3 spces, and so on.
 
J

Jay Freedman

Short of programming a fancy macro, I don't think Word can do that. If
it's a one-time job, download the trial version of UltraEdit
(http://www.ultraedit.com/), which can do it. You may like it enough
to buy it. :)

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
G

Guest

Thanks Jay. That looks like a good product, and pretty cheap for what it
does. I really miss SPF/PC (I'm a mainframe programmer, but I do a lot of
analysis on the PC), but they ruined it when they ported it to Windows. This
may be a good substitute, and the price is certainly right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top