extract

Oracle extract values from xmltype

删除回忆录丶 提交于 2019-12-06 05:59:31
This is the code I am currently using: SET serveroutput ON CREATE OR REPLACE PROCEDURE test_proc(i_xml varchar2) IS l_name VARCHAR2(20); l_age NUMBER; l_xml xmltype; BEGIN l_xml := xmltype(i_xml); FOR x IN (SELECT VALUE(p) col_val FROM TABLE(XMLSEQUENCE(EXTRACT(l_xml, '/ROWSET/ROW'))) p ) LOOP IF x.col_val.existSNode('/ROW/name/text()') > 0 THEN l_name:= x.col_val.EXTRACT('/ROW/name/text()').getstringVal(); END IF; IF x.col_val.existSNode('/ROW/age/text()') > 0 THEN l_age := x.col_val.EXTRACT('/ROW/age/text()').getstringVal(); END IF; end loop; end; / BEGIN test_proc('<ROWSET> <ROW> <name>aa<

Extract substring from text in a pandas DataFrame as new column

蓝咒 提交于 2019-12-06 05:19:12
问题 I have a list of 'words' I want to count below word_list = ['one','three'] And I have a column within pandas dataframe with text below. TEXT | -------------------------------------------| "Perhaps she'll be the one for me." | "Is it two or one?" | "Mayhaps it be three afterall..." | "Three times and it's a charm." | "One fish, two fish, red fish, blue fish." | "There's only one cat in the hat." | "One does not simply code into pandas." | "Two nights later..." | "Quoth the Raven... nevermore."

How do I get Facebook page username or facebook page ID from url

你离开我真会死。 提交于 2019-12-06 04:13:22
问题 I've made a website where users can submit their Facebook page and I orginally coded it assuming that they would of set up a vanity URL for their page. E.g. http://www.facebook.com/ myfacebookpage But I forgot that some pages can have urls such as http://www.facebook.com/pages/myfacebookpage/ 54878424154545487 My question is how do I use PHP to grab the part of the url in bold ? Thanks! 回答1: like this: $url='http://www.facebook.com/pages/myfacebookpage/54878424154545487'; // the input $pieces

Iterating through folders and files in batch file?

做~自己de王妃 提交于 2019-12-06 03:55:31
问题 Here's my situation. A project has as objective to migrate some attachments to another system. These attachments will be located to a parent folder, let's say " Folder 0 " (see this question's diagram for better understanding), and they will be zipped/compressed. I want my batch script to be called like so: BatchScript.bat "c:\temp\usd\Folder 0" I'm using 7za.exe as the command line extraction tool. What I want my batch script to do is to iterate through the " Folder 0 "'s subfolders, and

Extract .zip files using PHP [closed]

有些话、适合烂在心里 提交于 2019-12-06 03:26:30
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . How can I extract .zip (100%), using PHP? 回答1: If you have zziplib installed, you can use this code: <?php $zip = new ZipArchive; if ($zip->open('test.zip') === TRUE) { $zip->extractTo('/my/destination/dir/');

read pdf file horizontally with pdfminer

别来无恙 提交于 2019-12-06 02:35:24
I would like to extract a pdf with pdfminer (version 20140328). This is the code to extract the pdf: import sys from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfpage import PDFPage from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter from pdfminer.layout import LAParams from cStringIO import StringIO import urllib2 def pdf_to_string(data): fp = StringIO(data) rsrcmgr = PDFResourceManager() retstr = StringIO() codec = 'utf-8' laparams = LAParams() device = TextConverter(rsrcmgr, retstr, codec=codec, laparams=laparams) # Create a PDF

Is there any easy way to extract h.264 raw stream in annexb format?

萝らか妹 提交于 2019-12-06 02:31:31
问题 When I extract video stream with ffmpeg using command-line: ffmpeg -i {some file} -vcodec copy -an -f {rawvideo|h264|whatever} out.h264 with some media files produced by Adobe Media Encoder, only .m4v (encoded as h.264 blu-ray) files can produce some usable results. Some other format(like .f4v) can produce h.264 stream, but without PPS/SPS, and each slice starts with size instead of 00 00 00 01 sequence. I wish I can extract annexb format raw streams from as many as possible files that

Jquery extract text with regular expression on complete visible text of web page

☆樱花仙子☆ 提交于 2019-12-06 02:30:02
问题 I am aware of the jQuery regex plugin of James Padolsey: http://james.padolsey.com/javascript/regex-selector-for-jquery/ But I need something different: The regular expression should search in the whole visible text of the web page. I want to get the text itself, not the element containing them. The following will match requirement 1, but not 2: $('*').filter(function() { return this.text().match(/\d\d\d/); }); Any idea how i can do this with a good performance? 回答1: This should get you an

how to extract content from <div> tag java

半世苍凉 提交于 2019-12-06 02:22:01
问题 i have a serious problem. i would like to extract the content from tag such as: <div class="main-content"> <div class="sub-content">Sub content here</div> Main content here </div> output i would expect is: Sub content here Main content here i've tried using regex, but the result isn't so impressive. By using: Pattern.compile("<div>(\\S+)</div>"); would return all the strings before the first <*/div> tag so, could anyone help me pls? 回答1: I'd recommend avoiding regex for parsing HTML. You can

Extract data from lines of a text file

一曲冷凌霜 提交于 2019-12-06 02:03:47
问题 I need to extract data from lines of a text file. The data is name and scoring information formatted like this: Shyvana - 12/4/5 - Loss - 2012-11-22 Fizz - 12/4/5 - Win - 2012-11-22 Miss Fortune - 12/4/3 - Win - 2012-11-22 This file is generated by another part of my little python program where I ask the user for the name, lookup the name they enter to ensure it's valid from a list of names, and then ask for kills, deaths, assists, and whether they won or lost. Then I ask for confirmation and