Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
geotso[_2_] geotso[_2_] is offline
external usenet poster
 
Posts: 47
Default Converet plain text to table

I have a "table" in plain text like this:

1. [name] [surname] 0:36:27
2. [another name] [and surname] 0:46:27
3. [third name] [and surname] 1:03:42
4. [and so one...] 2:04:18

Whe
- After the order number there is an empty space
- Between [name] [surname] there is an empty space
- Between [surname] [time] there are empty spaces and/or tab characters.

Is there a simple way to convert it to a table (I don't know VBA)?

--
Please remove hyphens to contact me
----- --- -- -- -
geotso
----- --- -- -- -
  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Converet plain text to table

Are the names in square brackets?
Are the numbers at the start of each line included?
In the meantime see http://www.gmayor.com/convert_labels...mail_merge.htm

--

Graham Mayor - Word MVP

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




geotso wrote:
I have a "table" in plain text like this:

1. [name] [surname] 0:36:27
2. [another name] [and surname] 0:46:27
3. [third name] [and surname] 1:03:42
4. [and so one...] 2:04:18

Whe
- After the order number there is an empty space
- Between [name] [surname] there is an empty space
- Between [surname] [time] there are empty spaces and/or tab
characters.
Is there a simple way to convert it to a table (I don't know VBA)?



  #3   Report Post  
Posted to microsoft.public.word.newusers
geotso[_2_] geotso[_2_] is offline
external usenet poster
 
Posts: 47
Default Converet plain text to table

then, "Graham Mayor" climbed to the rostrum and said:
Are the names in square brackets?


No. Just in my sample only

Are the numbers at the start of each line included?


Yes

In the meantime see http://www.gmayor.com/convert_labels...mail_merge.htm

I'm going there right now!
  #4   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Converet plain text to table

I would start by using wildcards to replace any number of spaces with a tab,
then use Table | Convert | Table to Text, separating at tabs. If the Replace
operation results in multiple tabs between elements, replace those with a
single tab before converting.

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

"geotso" wrote in message
...
I have a "table" in plain text like this:

1. [name] [surname] 0:36:27
2. [another name] [and surname] 0:46:27
3. [third name] [and surname] 1:03:42
4. [and so one...] 2:04:18

Whe
- After the order number there is an empty space
- Between [name] [surname] there is an empty space
- Between [surname] [time] there are empty spaces and/or tab characters.

Is there a simple way to convert it to a table (I don't know VBA)?

--
Please remove hyphens to contact me
----- --- -- -- -
geotso
----- --- -- -- -



  #5   Report Post  
Posted to microsoft.public.word.newusers
geotso[_2_] geotso[_2_] is offline
external usenet poster
 
Posts: 47
Default Converet plain text to table

then, "Suzanne S. Barnhill" climbed to the rostrum and said:
I would start by using wildcards to replace any number of spaces with a tab,


And what is the expression for this, please?
I've tried " {2,}" (no quotes - starting empty space) and Word (2007) warns
me that the expression is not valid.

then use Table | Convert | Table to Text, separating at tabs. If the Replace
operation results in multiple tabs between elements, replace those with a
single tab before converting.

Once again, what is the expression for "multiple tabs"?
I've tried "^t{2,}" (no quotes) with the same as above results...

Thank you very much


  #6   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Converet plain text to table

This works for me provided I remember to check the "Use wildcards" box.

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

"geotso" wrote in message
...
then, "Suzanne S. Barnhill" climbed to the rostrum and said:
I would start by using wildcards to replace any number of spaces with a
tab,


And what is the expression for this, please?
I've tried " {2,}" (no quotes - starting empty space) and Word (2007)
warns me that the expression is not valid.

then use Table | Convert | Table to Text, separating at tabs. If the
Replace
operation results in multiple tabs between elements, replace those with a
single tab before converting.

Once again, what is the expression for "multiple tabs"?
I've tried "^t{2,}" (no quotes) with the same as above results...

Thank you very much



  #7   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Converet plain text to table

On Sat, 08 Mar 2008 19:23:26 +0200, geotso wrote:

then, "Suzanne S. Barnhill" climbed to the rostrum and said:
I would start by using wildcards to replace any number of spaces with a tab,


And what is the expression for this, please?
I've tried " {2,}" (no quotes - starting empty space) and Word (2007) warns
me that the expression is not valid.


That expression works in my copy of Word 2007, and it should work in yours. If
you can't make it work, then try surrounding the space character (but not the
{2,}) in square brackets:

[ ]{2,}

Also, in your initial post you mentioned that the name and time may be separated
by an assortment of spaces and tabs. You can replace the whole lot in one
wildcard search by using the expression

[ ^9]{2,}

That is, the space is still in the brackets, plus the numeric code for a tab
character (see http://www.gmayor.com/replace_using_wildcards.htm for a list of
codes).


then use Table | Convert | Table to Text, separating at tabs. If the Replace
operation results in multiple tabs between elements, replace those with a
single tab before converting.

Once again, what is the expression for "multiple tabs"?
I've tried "^t{2,}" (no quotes) with the same as above results...

Thank you very much


To search for multiple tabs, use an expression like the one above with the ^9
code, but leave out the space character. As explained in Graham's article, codes
such as ^t and ^p don't work in the Find What box of a wildcard search, only in
the Replace With box (and in both boxes for a non-wildcard search).

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
  #8   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Converet plain text to table

I also tried [ ]{2,} and found it didn't work because I'd forgotten to check
"Use wildcards." When I did check it, the expression worked without the
brackets, and it's all too easy to get so wrapped up in figuring out the
right search term that you forget to check the box; I'm guessing that's the
OP did.

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

"Jay Freedman" wrote in message
news
On Sat, 08 Mar 2008 19:23:26 +0200, geotso wrote:

then, "Suzanne S. Barnhill" climbed to the rostrum and said:
I would start by using wildcards to replace any number of spaces with a
tab,


And what is the expression for this, please?
I've tried " {2,}" (no quotes - starting empty space) and Word (2007)
warns
me that the expression is not valid.


That expression works in my copy of Word 2007, and it should work in
yours. If
you can't make it work, then try surrounding the space character (but not
the
{2,}) in square brackets:

[ ]{2,}

Also, in your initial post you mentioned that the name and time may be
separated
by an assortment of spaces and tabs. You can replace the whole lot in one
wildcard search by using the expression

[ ^9]{2,}

That is, the space is still in the brackets, plus the numeric code for a
tab
character (see http://www.gmayor.com/replace_using_wildcards.htm for a
list of
codes).


then use Table | Convert | Table to Text, separating at tabs. If the
Replace
operation results in multiple tabs between elements, replace those with
a
single tab before converting.

Once again, what is the expression for "multiple tabs"?
I've tried "^t{2,}" (no quotes) with the same as above results...

Thank you very much


To search for multiple tabs, use an expression like the one above with the
^9
code, but leave out the space character. As explained in Graham's article,
codes
such as ^t and ^p don't work in the Find What box of a wildcard search,
only in
the Replace With box (and in both boxes for a non-wildcard search).

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.



  #9   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Converet plain text to table

If you use a wildcard expression but forget to check the "Use wildcards" box, it
simply won't find anything. But if the box is checked and the expression isn't
correctly formed according to the wildcard rules, then you get a message box
saying that the search expression isn't valid. From geotso's post, I gathered
that he saw the message box.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.

On Sat, 8 Mar 2008 13:17:34 -0600, "Suzanne S. Barnhill"
wrote:

I also tried [ ]{2,} and found it didn't work because I'd forgotten to check
"Use wildcards." When I did check it, the expression worked without the
brackets, and it's all too easy to get so wrapped up in figuring out the
right search term that you forget to check the box; I'm guessing that's the
OP did.

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

"Jay Freedman" wrote in message
news
On Sat, 08 Mar 2008 19:23:26 +0200, geotso wrote:

then, "Suzanne S. Barnhill" climbed to the rostrum and said:
I would start by using wildcards to replace any number of spaces with a
tab,

And what is the expression for this, please?
I've tried " {2,}" (no quotes - starting empty space) and Word (2007)
warns
me that the expression is not valid.


That expression works in my copy of Word 2007, and it should work in
yours. If
you can't make it work, then try surrounding the space character (but not
the
{2,}) in square brackets:

[ ]{2,}

Also, in your initial post you mentioned that the name and time may be
separated
by an assortment of spaces and tabs. You can replace the whole lot in one
wildcard search by using the expression

[ ^9]{2,}

That is, the space is still in the brackets, plus the numeric code for a
tab
character (see http://www.gmayor.com/replace_using_wildcards.htm for a
list of
codes).


then use Table | Convert | Table to Text, separating at tabs. If the
Replace
operation results in multiple tabs between elements, replace those with
a
single tab before converting.

Once again, what is the expression for "multiple tabs"?
I've tried "^t{2,}" (no quotes) with the same as above results...

Thank you very much


To search for multiple tabs, use an expression like the one above with the
^9
code, but leave out the space character. As explained in Graham's article,
codes
such as ^t and ^p don't work in the Find What box of a wildcard search,
only in
the Replace With box (and in both boxes for a non-wildcard search).

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.


  #10   Report Post  
Posted to microsoft.public.word.newusers
geotso[_2_] geotso[_2_] is offline
external usenet poster
 
Posts: 47
Default Converet plain text to table


That expression works in my copy of Word 2007, and it should work in yours. If
you can't make it work, then try surrounding the space character (but not the
{2,}) in square brackets:

[ ]{2,}


It definitely doesn't work

I've tried both suggestions, to no avail...
I've also turned on the "Show all formatting marks" just in case I was wrong
about the empty spaces, and they was really there! I counted 13 dot marks
just between the first surname and his time.

I've also tried the ^s character (non-breaking space), just to receive the
same disappointing error message


  #11   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Converet plain text to table

How very odd! Failing wild cards, you can always just search for two spaces
repeatedly until Find returns no results.

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

"geotso" wrote in message
...

That expression works in my copy of Word 2007, and it should work in
yours. If
you can't make it work, then try surrounding the space character (but not
the
{2,}) in square brackets:

[ ]{2,}


It definitely doesn't work

I've tried both suggestions, to no avail...
I've also turned on the "Show all formatting marks" just in case I was
wrong about the empty spaces, and they was really there! I counted 13 dot
marks just between the first surname and his time.

I've also tried the ^s character (non-breaking space), just to receive the
same disappointing error message



  #12   Report Post  
Posted to microsoft.public.word.newusers
Terry Farrell Terry Farrell is offline
external usenet poster
 
Posts: 2,904
Default Converet plain text to table

Just to clarify Suzanne's advice...

After the replace, you will see the list looking like:

[1.] tab [name] tab [surname] tab [0:36:27] return

Then when you select the list and use convert Text to Table choosing the TAB
as the separator, you will have a four column table. If you need the empty
space afterwards, you simply select the column to the right and chose
Insert, Column to the Left (or vice versa).

BTW, if you are ever going to place the table in a spreadsheet, you should
consider changing your order numbering system because it may be confused as
the standard time format (hours:minutes:seconds): it certainly confused me
at first glance.

Terry

"geotso" wrote in message
...
I have a "table" in plain text like this:

1. [name] [surname] 0:36:27
2. [another name] [and surname] 0:46:27
3. [third name] [and surname] 1:03:42
4. [and so one...] 2:04:18

Whe
- After the order number there is an empty space
- Between [name] [surname] there is an empty space
- Between [surname] [time] there are empty spaces and/or tab characters.

Is there a simple way to convert it to a table (I don't know VBA)?

--
Please remove hyphens to contact me
----- --- -- -- -
geotso
----- --- -- -- -


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
insert plain text into pre-existing table madhg Tables 7 April 11th 12 10:49 AM
Auto-Correct - Plain Text or Formatted Text toggle is disabled Rickijayne Microsoft Word Help 1 May 16th 07 05:16 PM
How do I save a file as Text Only versus Plain Text? Jessi Microsoft Word Help 9 July 6th 06 05:47 AM
Convert hyperlinked Table of Contents to plain text Grace L. Judson Tables 1 April 22nd 05 10:29 PM
Print Ltrhd,Plain,Plain,Ltrhd,Plain,Plain Bonnie Microsoft Word Help 0 December 10th 04 08:23 PM


All times are GMT +1. The time now is 01:48 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"