AnsweredAssumed Answered

Copying text between two text strings

Question asked by happyez on May 13, 2011
Latest reply on May 13, 2011 by LaRetta_1

Title

Copying text between two text strings

Post

Hello everyone

Dipping in and finally contributing to the forum I have been lurking around in for some time. At least asking questions...

I want to be able to automatically find a specific string of text (eg "h4" from source code, or "Business Name" from a directory), find the end point (eg "/h4" from source code, or "Location" from a directory), and cut out/copy/set var any text inbetween.

This means I will be able, through loads of source code text, find the lines I need, and then paste them into other fields.

This really doesn't sound too difficult - but I cannot find any info on the net or these forums. I tried a Brian Dunning one, but that went nowhere for me. And I tried...

So I thought I'd ask anyone here.

This is how I thought it could happen. I would go:

1) go to  the <Data> field where the full set of text is kept.

2) Replace/Find for eg 'h4" within <Data>.

3) In a calc field, ask the end point to be "/h4". Now I have the bookends. I would program these two into the calc field myself.

4) Copy/Set Var whatever is between these "h4"'s, and Set Field into a new field, called, say, <between> ...

Possibly an easier way would be to find eg <h5> text and just ask it to copy 100 characters ahead, but that could become messy, and some lines may be cut short.

Would love someone's help in this problem. It seems SO easy in theory, but a bugger to do for me in practice...

Outcomes