data-extraction

Python - parse IPv4 addresses from string (even when censored)

a 夏天 提交于 2019-12-19 08:14:35
问题 Objective: Write Python 2.7 code to extract IPv4 addresses from string. String content example: The following are IP addresses: 192.168.1.1, 8.8.8.8, 101.099.098.000. These can also appear as 192.168.1[.]1 or 192.168.1(.)1 or 192.168.1[dot]1 or 192.168.1(dot)1 or 192 .168 .1 .1 or 192. 168. 1. 1. and these censorship methods could apply to any of the dots (Ex: 192[.]168[.]1[.]1). As you can see from the above, I am struggling to find a way to parse through a txt file that may contain IPs

PostgreSQL Query to Excel Sheet

限于喜欢 提交于 2019-12-18 11:45:01
问题 I need to export some data from PostgreSQL to Excel (quick customer wish), and the last time Excel had serious problems opening or importing my COPYd csv files (line endings, utf-8 encoding, etc), and it took me an hour at best. Does someone know a quick, elegant solution that generates a real Excel file? Like a small shell script or the like? I want this to be done either on my Linux box (Debian 5.0 Lenny) or on Windows (XP or higher). 回答1: You could install the PostgreSQL ODBC driver on the

Creating a VBA Macro to Extract Data for matches

爷,独闯天下 提交于 2019-12-13 12:51:52
问题 I am looking for guidance on how to build a VBA Macro in Excel (I have never created one before) that would look for a unique identifier match in two separate excel files and then would extract the accompanying row data for the match. Put more plainly: I have two separate excel files, they each have a column present in them for a unique identifier. I want the VBA Macro to find the matches in one of the files where the unique identifier is the same as it is in the other file. Once a match is

Extract and store a specific position from multiple matrices in an array in R

余生长醉 提交于 2019-12-13 00:55:38
问题 Sorry, newbie... I've got an array object called "y" of 500 matrices of 6x6, like this: , , 1 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.0000 0.3627 0.4132 0.4231 0.3795 0.5444 [2,] 0.3627 0.0000 0.2084 0.3523 0.2310 0.5377 [3,] 0.4132 0.2084 0.0000 0.1984 0.2920 0.4774 [4,] 0.4231 0.3523 0.1984 0.0000 0.2787 0.4363 [5,] 0.3795 0.2310 0.2920 0.2787 0.0000 0.5129 [6,] 0.5444 0.5377 0.4774 0.4363 0.5129 0.0000 [...] , , 500 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.0000 0.3755 0.3568 0.3835 0.3582 0.5065

Is there a library for extracting data from an HTML page? [closed]

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:53:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I would like to extract information from a web page. Unfortunately, the website (4chan) doesn't have a public API, for as far as I know. What is a good library to extract specific data from an HTML document? I prefer a free software library that works on UNIX systems. Edit: basically I want to get posts and

PHP Data Extraction From External Website, Then Write to Database [duplicate]

被刻印的时光 ゝ 提交于 2019-12-11 19:14:24
问题 This question already has answers here : How do you parse and process HTML/XML in PHP? (30 answers) Closed 6 years ago . Just wondering how this would be done. Let's say there's a simple HTML table on an external website, and you have a database with the same structure as that HTML table. I understand that you can use file_get_contents to grab that entire web page. From there, I would assume that you would remove everything from your file_get_contents except for the stuff between the <table><

Extracting name as first name last name in python

可紊 提交于 2019-12-11 15:15:13
问题 I have a text file with lines as: Acosta, Christina, M.D. is a heart doctor Alissa Russo, M.D. is a heart doctor is there a way to convert below line: Acosta, Christina, M.D. is a heart doctor to Christina Acosta, M.D. is a heart doctor Expected Output: Christina Acosta, M.D. is a heart doctor Alissa Russo, M.D. is a heart doctor 回答1: You can use the follow regex to group the first and last names and substitute them in reverse order without the comma: import re data = '''Acosta, Christina, M

VBA Script pull data from website

给你一囗甜甜゛ 提交于 2019-12-11 10:41:23
问题 I want to pull the data from http://www.buyshedsdirect.co.uk/ to get the most recent prices of specific items. I have an excel spreadsheet with the following: |A | B 1 |Item |Price 2 |bfd/garden-structures/arches/premier-arches-pergola and the VBA script: Dim ie As New InternetExplorer Dim item As String item = Sheet1.Range("A2").Value Dim doc As HTMLDocument ie.Visible = True ie.navigate "http://www.buyshedsdirect.co.uk/" & item Do DoEvents Loop Until ie.readyState = READYSTATE_COMPLETE Set

Natural language processing with elastic search

雨燕双飞 提交于 2019-12-11 07:30:04
问题 I wanted to integrate search functionality in my website. I am using elastic search for it, If user searches "Maruti suzkuki under 2 lac" then it has to search cars having brand name "Maruti Suzuki" and price under 2 lac. How can I achieve this? Types of searches maruti suzuki under 2 lac maruti suzuki 20000km driven cars 2015 year model etc. ES version 5.4 来源: https://stackoverflow.com/questions/44187481/natural-language-processing-with-elastic-search

JQ: Nested JSON transformation

强颜欢笑 提交于 2019-12-11 06:06:44
问题 I actually looking for a software to transform json files (i am a complete json noobie) that i got from a web api, for a better load to my SQL database. Some hours Google Research later i found jq, that hit my needs nearly to 100%. I though i found the necessary filter Operation on jq for my needs but runs now in a "little" Problem. My source json is heavly nested and i Need to extract several data (from objects/Arrays) from different layer in the jsons paths. I built following filter on