Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

parsing text address question find specific word then get that line only

Featured Replies

Hello

I have been trying to parse addresses from the internet. 

When I copy the text from the internet into a field called General, I get varying results of where the "phone number, the email and the website are.

 

But in each case there is not always all three pieces of the listing.

 

So how can I for the following example

 

Phone: 315-678-2546

 

Find the line that begins with "phone"  and put it in the phone field

 

or find the line that begins with "email:" and put that line only in the the email field

or find the line that begins with "website" and put that line only in the website field?

 

 

The variable is that not always are there all three types of information

they are not always on the same line (like line 4) 

But if the address presents a phone it can be on any line but always begins with "phone:"

if the address presents an email it can be on any line but that line always begins with "email:"

if the address includes a website it can be on any line but that line aways begins with "website"

 

I just don't know how to make an insert calculated text calc to do this.

I could really use the help here

Thanks

 

You can look into the Position ( ) function.

 

 

This should get you started. Something like this.

Let ( pos = Position ( YourSearchField; "Email:" ; 1 ; 1 ); 
         GetValue ( Middle ( YourSearchField; pos; Length ( YourSearchField ) - pos + 1 ); 1 ) 
    )
  • Author

Thank you sir

That was a great help

 

The only other problem that I have is getting the name of the contact - It is not in the same format

a name always preceeds this " updated this company profile"

 

IE

 

Eric Bouchard updated this company profile

 

How do I calc getting the name that occurs whenever " updated this company profile" shows up... It isn't in every record but when it shows up I would like to get the name and add it to my contact field.

Thanks again

Parsing text from URL or places where you do not have control over their source, can be tricky. If you can provide us with the URL, or soruce of the data, we might be able to assist you better. You will undoubtedly want more of this data as you start parsing.

It would be something similar. You would still use position to find the text "updated this company profile" then try and grab the text prior to it.

  • Author

here is the url of the page I was working on

 

http://www.manta.com/c/mm0kwmt/affordable-storage-llc

 

What i am now trying to extract from the page is this

 

the top 5 businesses that are similar to go to a field "like biz"

 

The name of the company contacts if there is one or more to go to a field "contact"

 

Essentially it is always different and sometimes they throw in a graphic that is not always present when I copy the page

 

I could figure it out if I could learn how to

 

1.extract all info between  two texts  like TOP   and  MORE DETAILS 

 

2. How to extract all text in a line before a text string on the same line

 

3. How to extract all text in a line after a text string  on the same line

 

Thanks This  helps me

There are several Custom Functions that can help you, start by going to Brian Dunning's site and do a search for some of these key words. Before, After, Between and Middle etc. 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.