Jump to content

Web Viewer or parse copy/paste?


LaRetta

This topic is 2975 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm attempting to pull some data from a webpage here:  http://www.ehso.com/siccodes.php

This is a one-time thing and all I really need are the 4-digit codes and their descriptions as records.   I placed a web viewer thinking this might be faster somehow but I cannot identify how to find the beginning the text.  I also am capable of horsing it and parsing each line from the copied text field but would that be quicker than web viewer?  I tried using a container and Insert From URL but once I have it in the container, I have no idea what to do with it.  

My goal here is to match these 4-digit codes to existing records with those text codes so I can import their descriptions into an existing table.  I just need simplest method.  However, learning it is always worthwhile so I'm game.   I'm willing to do all the work - I just need an idea of the quickest direction and I've never needed this before so I'm a newbie.  :-)

SICCodes.png

BTW, when I copied the data and pasted it, there are spaces before and after every line.

Link to comment
Share on other sites

Well now that was MUCH faster than I would have parsed it.  I would have used FM to loop the rows, stripping and splitting into fields as I went!  YOU ROCK!  Thank you for making my morning much simpler!!  I didn't expect anyone to do it for me so this is pleasant surprise!

Link to comment
Share on other sites

6 minutes ago, LaRetta said:

I didn't expect anyone to do it for me

Well, you know how it goes. You get curious how it could be done - so you try something and if you were right, it's done. So you get your list and I learned something new.

 

Edited by comment
Link to comment
Share on other sites

:beertime:

Lucky me!!

So I can learn a bit more also ... did you paste into text editor, specify to remove spaces somehow and replace with tab?  Just a brief idea might give me clue so I can test it using Sublime Text. This would come in handy to understand!  I obviously need to do more with text editors!

Link to comment
Share on other sites

I used BBEdit.

First, I removed leading whitespaces by selecting all and pressing Command + [.

Then I removed empty lines by replacing \r\r with \r. This wasn't actually necessary, because:

Next, I processed lines containing ^[0-9]{4} and moved them to a new document. The expression ^[0-9]{4} means 4 consecutive digits at the beginning of a line.

Finally, in the new document, I replaced ^([0-9]{4})\s with \1\t. This replaced the 4 digits followed by a space by themselves followed by a tab.

 

Edited by comment
Link to comment
Share on other sites

Oh you are so specific and it completely rocks!  I am going to get BBEdit and become proficient at it!  You have me chuckling on this one.  We don't have a 'thumbs up' emoticon - only ones with folks drinking.  In fact, we don't even have a 'bow' emoticon.  So I'll just have to again say a major thank you!

Link to comment
Share on other sites

I use TextWrangler everyday. I stopped upgrading BBEdit years ago when they released TextWrangler. They both do regular expression using Grep Patterns.

TextWrangler is free, and BBEdit cost 50.00.

Link to comment
Share on other sites

Thanks, Lee!

I use (but obviously not often) Sublime Text which was recommended (or at least used) by Matt Petrowsky when 12 first came out for reviewing/modifying styles in a webinar Inside FileMaker 12 Layouts.  The dozen or so times I've used it, I really like it so I guess I will stick with it.  If I find out it won't handle this type of process, maybe I'll try TextWrangler but I suspect it will handle it just fine.   I appreciate the input.   :-)

Edited by LaRetta
Link to comment
Share on other sites

Hi LaRetta,

3 hours ago, LaRetta said:

I use (but obviously not often) Sublime Text which was recommended (or at least used) by Matt Petrowsky when 12 first came out for reviewing/modifying styles in a webinar Inside FileMaker 12 Layouts.  The dozen or so times I've used it, I really like it so I guess I will stick with it.  If I find out it won't handle this type of process, maybe I'll try TextWrangler but I suspect it will handle it just fine.

I forgot about that app. I only used it a couple of times trying out Matt Petrowsky's presentation on modifying the themes. Something I never did to any of my files, just a few mockups. I just didn’t want to go through any of the possible problems.

Anyway, I just downloaded the latest release of Sublime, and then copy and pasted your link. I’m blown away of how it handles it, It presents in the OmniOutliner look, which was where I was going with this file. 

Is there a different format you want. i.e. FileMaker?

Lee

Link to comment
Share on other sites

Oh that is wonderful, Lee!  Yes, I guess I'd better crack my Sublime Text2 and actually try it!  Yes, I need records in FM and I got that from Michael but, now realizing the power of gathering information, hehehe, you can bet I have a new toy to play with!  Thank you!! :smile3:

Yep, I really liked Sublime Text2 when Matt was using it in his video presentation on new themes in 12.  It was highly intuitive.  I never changed default themes either but I wouldn't be as reluctant to mess with custom themes or styles in 14/15 - just haven't had the need or time.

The thing about NOT asking questions?   Every time I ask a question, I learn many new things or different perspectives I hadn't thought of (and I've studies this business full-time for over 12 years now).  Every time I just figure out what *I* think is best way or the ways I've always done it, I learn nothing I didn't already know.  The former process keeps me stimulated and on a growth curve while the latter leaves me bored and stagnant. :blink:

I'm excited with new toys and tools!

You mean I can paste the LINK and it just gives me ... well shoot ... now I'm cancelling my plans tonight and I'm playing with it!  

Oh. Well.  It didn't work just to paste the link.  There must be more to it than that but this is fun stuff anyway!!

Oh!  It splits the data into columns!  Nice!

Link to comment
Share on other sites

1 hour ago, LaRetta said:

You mean I can paste the LINK and it just gives me

I didn’t try that, that would be cool, however all I did was to copy SIC codes, and paste them into Sublime. (The site allowed me select just the SIC codes only).

After pasting it into Sublime, the editor made it look like an OmniOutliner.  

You are not the only one that has a new toy to play with. LOL

Link to comment
Share on other sites

This topic is 2975 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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