A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Convert text to table with SPACES separator



 
 
Thread Tools Display Modes
  #1  
Old August 3rd, 2008, 10:14 PM posted to microsoft.public.word.tables
paper
external usenet poster
 
Posts: 2
Default Convert text to table with SPACES separator

I am tring to covert text to table while the text is sparated by mutiple
spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I can covert
the above text to table easily in my office, using the table-convert text to
table in Word 2003. In that version, I can see the "Separate text at"
"Spaces". And the WORD will recognize multiple spaces as only one, and
separate the text correctly. However, in my laptop, which uses Word 2007,
there is no obvious "Spaces" as an option under "Separate text at", so I have
to input the space in the "Option" area. Unfortunately, after doing that, the
multiple spaces in the text will also create several columns, which I don't
want to see.

Any solutions?

Thanks
  #2  
Old August 4th, 2008, 06:17 AM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Convert text to table with SPACES separator

I don't see that option in either Word 2003 or 2007, however the following
macro should do the trick

With Selection
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[ ]{1,}"
.Replacement.Text = ", "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
.WholeStory
.ConvertToTable Separator:=wdSeparateByCommas
End With

If you want to break the text where there are two spaces or more change the
{1,} to {2,}
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



paper wrote:
I am trying to covert text to table while the text is separated by
multiple spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I can
covert the above text to table easily in my office, using the
table-convert text to table in Word 2003. In that version, I can see
the "Separate text at" "Spaces". And the WORD will recognize multiple
spaces as only one, and separate the text correctly. However, in my
laptop, which uses Word 2007, there is no obvious "Spaces" as an
option under "Separate text at", so I have to input the space in the
"Option" area. Unfortunately, after doing that, the multiple spaces
in the text will also create several columns, which I don't want to
see.

Any solutions?

Thanks



  #3  
Old August 14th, 2008, 07:50 PM posted to microsoft.public.word.tables
Microsmith
external usenet poster
 
Posts: 9
Default Convert text to table with SPACES separator

I have a solution though it is somewhat convoluted.

1. Copy entire text range to excel (paste values) starting at cell A1
2. In a column next to the pasted text, type the following formula, then
copy it down however many rows needed:

=TRIM(SUBSTITUTE(A1,CHAR(160),CHAR(32)))

The formula will convert the text to something like:
1 a c d
2 c b c


3. Copy the range containing the formulas back to Word 2007.
4. Use Word 2007's "Convert Text To Table" and in the
"separate text at" section choose "Other" and type in a space using
your spacebar in the box to the right.
5. Click OK.

Works great for me.






"paper" wrote:

I am tring to covert text to table while the text is sparated by mutiple
spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I can covert
the above text to table easily in my office, using the table-convert text to
table in Word 2003. In that version, I can see the "Separate text at"
"Spaces". And the WORD will recognize multiple spaces as only one, and
separate the text correctly. However, in my laptop, which uses Word 2007,
there is no obvious "Spaces" as an option under "Separate text at", so I have
to input the space in the "Option" area. Unfortunately, after doing that, the
multiple spaces in the text will also create several columns, which I don't
want to see.

Any solutions?

Thanks

  #4  
Old August 20th, 2008, 10:06 PM posted to microsoft.public.word.tables
paper
external usenet poster
 
Posts: 2
Default Convert text to table with SPACES separator

Hi Graham,

I just checked the version used in my office. It is WORD professional
edition 2003 (11.8227.8202) SP3. And there is an option "Space" under the
"Separate text at" in the "Table--Covert---Text to table". It is suprising
because there are only 4 options under the "Separate text at" in WORD 2007
and other version of WORD 2003 I used before. However, the one in my office
has 5 options. That is, one additional option "Space" there.

I don't know if there is any way that I can put "Space" as an option under
the "Separate text at".

Thanks

"Graham Mayor" wrote:

I don't see that option in either Word 2003 or 2007, however the following
macro should do the trick

With Selection
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[ ]{1,}"
.Replacement.Text = ", "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
.WholeStory
.ConvertToTable Separator:=wdSeparateByCommas
End With

If you want to break the text where there are two spaces or more change the
{1,} to {2,}
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



paper wrote:
I am trying to covert text to table while the text is separated by
multiple spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I can
covert the above text to table easily in my office, using the
table-convert text to table in Word 2003. In that version, I can see
the "Separate text at" "Spaces". And the WORD will recognize multiple
spaces as only one, and separate the text correctly. However, in my
laptop, which uses Word 2007, there is no obvious "Spaces" as an
option under "Separate text at", so I have to input the space in the
"Option" area. Unfortunately, after doing that, the multiple spaces
in the text will also create several columns, which I don't want to
see.

Any solutions?

Thanks




  #5  
Old August 20th, 2008, 11:20 PM posted to microsoft.public.word.tables
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
Default Convert text to table with SPACES separator

You can type a space into the Other box.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"paper" wrote in message
news
Hi Graham,

I just checked the version used in my office. It is WORD professional
edition 2003 (11.8227.8202) SP3. And there is an option "Space" under the
"Separate text at" in the "Table--Covert---Text to table". It is suprising
because there are only 4 options under the "Separate text at" in WORD 2007
and other version of WORD 2003 I used before. However, the one in my
office
has 5 options. That is, one additional option "Space" there.

I don't know if there is any way that I can put "Space" as an option under
the "Separate text at".

Thanks

"Graham Mayor" wrote:

I don't see that option in either Word 2003 or 2007, however the
following
macro should do the trick

With Selection
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[ ]{1,}"
.Replacement.Text = ", "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
.WholeStory
.ConvertToTable Separator:=wdSeparateByCommas
End With

If you want to break the text where there are two spaces or more change
the
{1,} to {2,}
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



paper wrote:
I am trying to covert text to table while the text is separated by
multiple spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I can
covert the above text to table easily in my office, using the
table-convert text to table in Word 2003. In that version, I can see
the "Separate text at" "Spaces". And the WORD will recognize multiple
spaces as only one, and separate the text correctly. However, in my
laptop, which uses Word 2007, there is no obvious "Spaces" as an
option under "Separate text at", so I have to input the space in the
"Option" area. Unfortunately, after doing that, the multiple spaces
in the text will also create several columns, which I don't want to
see.

Any solutions?

Thanks






  #6  
Old August 21st, 2008, 07:51 AM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Convert text to table with SPACES separator

You can, but it splits text at *every* space.
I have the same Word version as the OP and mine does not have an option for
Spaces?
The macro I posted earlier will do it.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Suzanne S. Barnhill wrote:
You can type a space into the Other box.


"paper" wrote in message
news
Hi Graham,

I just checked the version used in my office. It is WORD professional
edition 2003 (11.8227.8202) SP3. And there is an option "Space"
under the "Separate text at" in the "Table--Covert---Text to table".
It is suprising because there are only 4 options under the "Separate
text at" in WORD 2007 and other version of WORD 2003 I used before.
However, the one in my office
has 5 options. That is, one additional option "Space" there.

I don't know if there is any way that I can put "Space" as an option
under the "Separate text at".

Thanks

"Graham Mayor" wrote:

I don't see that option in either Word 2003 or 2007, however the
following
macro should do the trick

With Selection
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[ ]{1,}"
.Replacement.Text = ", "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
.WholeStory
.ConvertToTable Separator:=wdSeparateByCommas
End With

If you want to break the text where there are two spaces or more
change the
{1,} to {2,}
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



paper wrote:
I am trying to covert text to table while the text is separated by
multiple spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I
can covert the above text to table easily in my office, using the
table-convert text to table in Word 2003. In that version, I can
see the "Separate text at" "Spaces". And the WORD will recognize
multiple spaces as only one, and separate the text correctly.
However, in my laptop, which uses Word 2007, there is no obvious
"Spaces" as an option under "Separate text at", so I have to input
the space in the "Option" area. Unfortunately, after doing that,
the multiple spaces in the text will also create several columns,
which I don't want to see.

Any solutions?

Thanks



  #7  
Old August 21st, 2008, 02:08 PM posted to microsoft.public.word.tables
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
Default Convert text to table with SPACES separator

I don't have an option for spaces, either, which makes me wonder if the OP
might be using WordPerfect or something else. Also, IIRC, you can't enter
more than a single character in the Other box, so you couldn't enter two
spaces. I jumped into the middle of the thread and didn't see that that was
what was wanted.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Graham Mayor" wrote in message
...
You can, but it splits text at *every* space.
I have the same Word version as the OP and mine does not have an option
for Spaces?
The macro I posted earlier will do it.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Suzanne S. Barnhill wrote:
You can type a space into the Other box.


"paper" wrote in message
news
Hi Graham,

I just checked the version used in my office. It is WORD professional
edition 2003 (11.8227.8202) SP3. And there is an option "Space"
under the "Separate text at" in the "Table--Covert---Text to table".
It is suprising because there are only 4 options under the "Separate
text at" in WORD 2007 and other version of WORD 2003 I used before.
However, the one in my office
has 5 options. That is, one additional option "Space" there.

I don't know if there is any way that I can put "Space" as an option
under the "Separate text at".

Thanks

"Graham Mayor" wrote:

I don't see that option in either Word 2003 or 2007, however the
following
macro should do the trick

With Selection
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[ ]{1,}"
.Replacement.Text = ", "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
.WholeStory
.ConvertToTable Separator:=wdSeparateByCommas
End With

If you want to break the text where there are two spaces or more
change the
{1,} to {2,}
http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



paper wrote:
I am trying to covert text to table while the text is separated by
multiple spaces, like following:

1 a c d
2 c b c

Obvious, the nuber of spaces between different columns varies. I
can covert the above text to table easily in my office, using the
table-convert text to table in Word 2003. In that version, I can
see the "Separate text at" "Spaces". And the WORD will recognize
multiple spaces as only one, and separate the text correctly.
However, in my laptop, which uses Word 2007, there is no obvious
"Spaces" as an option under "Separate text at", so I have to input
the space in the "Option" area. Unfortunately, after doing that,
the multiple spaces in the text will also create several columns,
which I don't want to see.

Any solutions?

Thanks





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.