LaRetta Posted February 3, 2016 Share Posted February 3, 2016 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. :-) BTW, when I copied the data and pasted it, there are spaces before and after every line. Link to comment Share on other sites More sharing options...
comment Posted February 3, 2016 Share Posted February 3, 2016 17 minutes ago, LaRetta said: 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 believe so. This took just a minute or two in a text editor (and would have taken less if I were more proficient in regex). 4-digitCodes.tab 1 Link to comment Share on other sites More sharing options...
LaRetta Posted February 3, 2016 Author Share Posted February 3, 2016 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 More sharing options...
comment Posted February 3, 2016 Share Posted February 3, 2016 (edited) 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 February 3, 2016 by comment Link to comment Share on other sites More sharing options...
LaRetta Posted February 3, 2016 Author Share Posted February 3, 2016 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 More sharing options...
comment Posted February 3, 2016 Share Posted February 3, 2016 (edited) 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 February 3, 2016 by comment Link to comment Share on other sites More sharing options...
LaRetta Posted February 3, 2016 Author Share Posted February 3, 2016 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 More sharing options...
comment Posted February 3, 2016 Share Posted February 3, 2016 (edited) 5 minutes ago, LaRetta said: I am going to get BBEdit Well, I am sure you can do the same in any decent text editor - just the steps might be a bit different. Edited February 3, 2016 by comment Link to comment Share on other sites More sharing options...
LaRetta Posted February 3, 2016 Author Share Posted February 3, 2016 Nah, it's like in When Harry Met Sally ... "I want what he's having!!" Link to comment Share on other sites More sharing options...
Lee Smith Posted February 3, 2016 Share Posted February 3, 2016 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 More sharing options...
comment Posted February 3, 2016 Share Posted February 3, 2016 Right. I use (an old version of) BBEdit because of its Clippings feature - but that wouldn't be required here. Link to comment Share on other sites More sharing options...
LaRetta Posted February 4, 2016 Author Share Posted February 4, 2016 (edited) 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 February 4, 2016 by LaRetta Link to comment Share on other sites More sharing options...
Lee Smith Posted February 4, 2016 Share Posted February 4, 2016 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 More sharing options...
LaRetta Posted February 4, 2016 Author Share Posted February 4, 2016 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!! 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. 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 More sharing options...
Lee Smith Posted February 4, 2016 Share Posted February 4, 2016 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 More sharing options...
Recommended Posts
This topic is 3132 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 accountSign in
Already have an account? Sign in here.
Sign In Now