extract

PHP: Extract direct sub directory from path string

I need to extract the name of the direct sub directory from a full path string. For example, say we have: $str = "dir1/dir2/dir3/dir4/filename.ext"; $dir = "dir1/dir2"; Then the name of the sub-directory in the $str path relative to $dir would be "dir3". Note that $dir never has '/' at the ends. So the function should be: $subdir ...

extract a specific part from a html document , php cURL , php, preg_match

Hello ! I'm trying to extract some information from a webpage using php cURL+preg_match or any other function but for some reasons it doesn't work at all . For example from this page http://www.foxtons.co.uk/search?location_ids=1001-29&property_id=712128&search_form=map&search_type=LL&submit_type=search I want to extra...

How to extract images from flash viewers?

This deals with the (diverse) flash viewers that let you zoom in on images on websites. I’m trying to extract the large, zoomed-in image rendered by the viewer. In many cases the images seem to be dynamically called by the viewer, or are created only for the part of the image you are zooming on at that point. Ideally, the approach here...

How to extract nested tar.gz files easily?

Hi, I need to extract tar.gz a file. It's about 950mb. It has another 23 tar.gz files in it. Each of those 23 tar.gz files has one tar file in them. My questions is how I can easily extract all of them? Is there a commandline tool that I can use? The structure is like the following: foo.tar.gz ├───bar1.tar.gz │ ├───foobar1.tar ├─...

Batch extract a folder of .mp4 files to just audio in the original audio format using ffmpeg

I have a folder of .mp4 files. How can I batch extract the audio from every file, in the original audio format, preferably using ffmpeg? (On 64bit WinVista) ...

MYSQL extract day number from day

Is it possible to extertract and integer value from "Mon", Tue", "Wed" etc with an SQL statment? For example Mon = 1 Tue = 2 Wed = 3 etcv ...

How to diff two regions of the same file in Eclipse

I'm a TDDer and often have a need to refactor out common or similar code. If it is exactly the same there is no big problem, Eclipse can almost always do that by itself. But to get there I'm finding myself often looking at similar, but not identical, code fragments in the same, or even different, files. It would be very handy if there w...

How do I extract HTML content using Regex in PHP

I know, i know... regex is not the best way to extract HTML text. But I need to extract article text from a lot of pages, I can store regexes in the database for each website. I'm not sure how XML parsers would work with multiple websites. You'd need a separate function for each website. In any case, I don't know much about regexes, so ...

How to extract files inside a directory from a tar file in terminal?

Hello, I want to extract only the files inside a folder of a tar file Example: Contents of tar file: /home/parent_dir/child_dir/ I want to extract only the files inside child_dir to another directory Thanks, SB ...

Extract http://www.website.com from http://www.website.com/08/2010/super-cool-article

I suck at regex, I only managed to get so far preg_match("/http:\/\//", $url). I need this for a php script ...

Is it bad for performance to extract variables from an array?

Hi everyone, I have found out about the great extract function in PHP and I think that it is really handy. However I have learn that most things that are nice in PHP also affects performance, so my question is which affect using the extract can have, seen in a performance perspective? Is it a no-no to use for big applications to extrac...

Extract some data from a lot of xml files

I have cricket player profiles saved in the form of .xml files in a folder. each file has these tags in it <playerid>547</playerid> <majorteam>England</majorteam> <playername>Don</playername> the playerid is same as in .xml (each file is of different size,1kb to 5kb). These are about 500 files. What i need is to extract the playern...

Compare two associative arrays and create a new array with the matched arrays, PHP

I have this two arrays: $arr1=array( array("id" => 8, "name" => "test1"), array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); $arr2=array( array("id" => 3), array("id" => 4) ); How can i "extract" arrays from $arr1, where id have same val...

Grep and Extract Data in Perl

I have HTML content stored in a variable. How do I extract data that is found between a set of common tags in the page? For example, I am interested in the data (represented by DATA kept between a set of tags which one line after the other: ... <td class="jumlah">*DATA_1*</td> <td class="ud"><a href="">*DATA_2*</a></td> ... And then I...

parse my proprietary string format

How can we get the numbers 7 and 4 and 5 from the following string: MODULE potmtpMAIN main <info: "Enterprise Optimizer 7.4 for COR Technology 5.5 -- Advanced Solver Edition", url:"http://EO.riverlogic.com", url_menu:"EO Online...", app_id:"EOAS",app_name:"Enterprise Optimizer AS", app_major:7, app_minor:4,app_micro:5,app_copyr...

Extracting a .app from a zip file in Python, using ZipFile

I'm trying to extract new revisions of Chromium.app from their snapshots, and I can download the file fine, but when it comes to extracting it, ZipFile either extracts the chrome-mac folder within as a file, says that directories don't exist, etc. I am very new to python, so these errors make little sense to me. Here is what I have so fa...

What risks are there in using extracted PHP superglobals?

Hola usando estas funciones, que riesgo corro en tener problemas de seguridad, es necesesario usar extract() o hay alguna manera mejor de convertir las variables superglobales (array) en trozos de variables. Good, there is some risk in using the function extract in the superglobal variables as $_POS and $_GET, I work of the following ...

Extracting note onset from Polyphonic MIDI using jMusic API

Hi May I know whether it's possible to extract note onset and other musical details (e.g. pitch, note duration) form polyphonic MIDI(i.e. either multiples notes played from treble and bass voices, or chords) using the jMusic API? It has a method to extract note onset - but it returns zero each time for a given note. However extracting...

How restore data from pcap file?

Hi ppl =) I have following file: test_network.pcap: tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length 65535) I know that in this file are few video streams and i need to extract them. How can i do this? The biggest problem is that size of file ~180 GB )) ...

Iterating through folders and files in batch file?

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\...