More help with search and replace in tables...

J

Julie

Okay, I got my first question answered regarding searching and stuff in tables and now I need/want to get a little more in depth

I have to similar but different situations that I want to take care of the same way. I have a table that has any number of customers in a cell. I want to get rid of certain customers, but leave all the other ones there. I created the table in Word by exporting an RTF document from a non-Microsoft database (DOORS) and my two situations appear as thus

+-----------------------------
|Customer
+-----------------------------
|Customer A^n
|Customer B^n
|Customer C^n
|end-of-cell marker
+-----------------------------

O

+-----------------------------------
|Customer
+-----------------------------------
|Customer A^n
|Customer B^n
|Customer Cend-of-cell marker
+-----------------------------------

How would I get rid of Customer A and Customer C which would also include getting rid of the end-of-line character after Customer B

Thanks
Julie
 
K

Klaus Linke

Hi Julie,

Since this is likely unformatted text, you could use Split on
..cell.range.text, with ^n as the delimiter, then set .cell.range.text to the
second item in the resulting array.

Greetings,
Klaus
 
K

Klaus Linke

Yes that might work with some of the situations,
but wouldn't work for Customer C in the second
table example and that's the one I'm really struggling with.


Why wouldn't it work? After using Split, you'd have an array containing

Customer A
Customer B
Customer C
and an empty element

in the first example, and just the three customers in the second example.
The second element would be "Customer B" in both cases.

Regards,
Klaus
 
R

Ruby Tuesday

I have similar probs/issues e.g:

+-----------------------------------+
|Customer Info |
+-----------------------------------+
|Customer A info ^n |
| continuation fo Cust A info |
+-----------------------------------+
|Customer B info ^n |
| continuation fo Cust B info |
+-----------------------------------+
|Customer C info ^n |
| continuation of Cust C info^n |
| another line of info |
+-----------------------------------+

How can I import this to any database or excel? If I cut and past it to an
excel table, the (newline) screw everything up. It create another row. So,
instead of 3 rows(cells) of data, I have 6rows(cells) of data.

How do I cheat by escaping or replacing those cariage-return/newline
character so excel will understand that it should be in a cell.

Help

Julie said:
Okay, I got my first question answered regarding searching and stuff in
tables and now I need/want to get a little more in depth.
I have to similar but different situations that I want to take care of the
same way. I have a table that has any number of customers in a cell. I
want to get rid of certain customers, but leave all the other ones there. I
created the table in Word by exporting an RTF document from a non-Microsoft
database (DOORS) and my two situations appear as thus:
+-----------------------------+
|Customer |
+-----------------------------+
|Customer A^n |
|Customer B^n |
|Customer C^n |
|end-of-cell marker |
+-----------------------------+

OR

+-----------------------------------+
|Customer |
+-----------------------------------+
|Customer A^n |
|Customer B^n |
|Customer Cend-of-cell marker |
+-----------------------------------+

How would I get rid of Customer A and Customer C which would also include
getting rid of the end-of-line character after Customer B?
 

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