extract

SAS: creating multiples files from multiple data sets

落花浮王杯 提交于 2020-01-16 00:54:08
问题 I have 24 datasets that are structured in the same way. By that I mean the same column headers (time, date, price, stock symbol), data set structure etc. I don't wish to append all 24 files since one data set is to big to handle. I named all my data sets with the name "file1 file2 file3 file4....up to file24". What I want to do is the following: For example change the date format in all of my 24 files at once; Be able to extract from each file# a specific stock symbol like 'Dell' and append

Python: Extracting lines from a file using another file as key

依然范特西╮ 提交于 2020-01-15 03:07:10
问题 I have a 'key' file that looks like this (MyKeyFile): afdasdfa ghjdfghd wrtwertwt asdf (these are in a column, but I never figured out the formatting, sorry) I call these keys and they are identical to the first word of the lines that I want to extract from a 'source' file. So the source file (MySourceFile) would look something like this (again, bad formatting, but 1st column = the key, following columns = data): afdasdfa (several tab delimited columns) . . ghjdfghd ( several tab delimited

php - extract array into global variables

时光毁灭记忆、已成空白 提交于 2020-01-13 18:12:07
问题 The manual on "extract" shows you can extract an array like: extract(array('one'=>1,'two'=>2)); into $one,$two... But the extract function doesn't return the variables. Is there a way to 'globalize' these variables? Maybe not using extract, but a foreach loop? EDIT: (explanation about what I'm trying to achieve) I have an array containing hundreds of output messages which I want to have accessible as variables efficiently. What I mean is that whenever I want to output a message, say:

Extract Directory Inside Zip

只愿长相守 提交于 2020-01-13 18:10:57
问题 I'm writing a script to extract files from a zip archive into the directory that the script is located. Here's my code: $zip = new ZipArchive; if ($zip->open('latest.zip') === TRUE) { $zip->extractTo('.'); $zip->close(); unlink('installer.php'); echo 'it works!'; } else { echo 'failed'; } This works fine, but there's one problem. The zip contains an extra layer. (zip/directory/files) which extracts like this directory/files rather then just the files. Is there a way to remove this extra layer

How to extract 7z zip file in Python 2.7.3 version

笑着哭i 提交于 2020-01-13 11:34:07
问题 How to extract 7z zip file in python .Please some one let me know is there any library for that. I have install libarchive library in python 2.7.3 version . But i am not able to use that library. 回答1: You can use PyLZMA and py7zlib libraries to extract 7z file or try executing shell scripts to extract zip file using python subprocess module. 回答2: I use command like C:\Program Files\7-Zip\7z.exe x <filename> in my C++ project. You can run it in Python like so: import subprocess subprocess.call

Extract text from PDF in respect to formatting (font size, type etc)

陌路散爱 提交于 2020-01-13 06:58:21
问题 Is possible to extract text from PDF file in respect to specific font/font size/font color etc.? I prefer perl, python or *nix command line utilities. My goal is to extract all headlines from PDF file so I will have nice index of articles contained in single PDF. 回答1: Text and /font/font size/position (no color, as I checked) you can get from Ghostscript's txtwrite device (try -dTextFormat=0 | 1 options), as well as from mudraw's (MuPDF) with -tt option. Then parse XML-like output with e.g.

extract title tag from html

走远了吗. 提交于 2020-01-13 06:12:44
问题 I want to extract contents of title tag from html string. I have done some search but so far i am not able to find such code in VB/C# or PHP. Also this should work with both upper and lower case tags e.g. should work with both <title></title> and < TITLE></TITLE> . Thank you. 回答1: You can use regular expressions for this but it's not completely error-proof. It'll do if you just want something simple though (in PHP): function get_title($html) { return preg_match('!<title>(.*?)</title>!i',

Extract a particular table from multi-table html file using perl [closed]

余生长醉 提交于 2020-01-11 14:46:14
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I have a html file with three tables. But I want to extract only one table of the three. How do I do this? 回答1: A good module for extracting parts of a HTML document is HTML::Query. It provides a jQuery-like interface for selecting what part of a document to extract. 回答2: You can do this using

Extract a particular table from multi-table html file using perl [closed]

十年热恋 提交于 2020-01-11 14:45:13
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I have a html file with three tables. But I want to extract only one table of the three. How do I do this? 回答1: A good module for extracting parts of a HTML document is HTML::Query. It provides a jQuery-like interface for selecting what part of a document to extract. 回答2: You can do this using

PHP Upload and Extract Zip

前提是你 提交于 2020-01-07 07:28:40
问题 I'm trying to run a script that allows the upload of a .zip and extracts the contents. I grabbed a sample code online that is supposed to work and added a class at the beginning b/c my ISP doesn't have the zip functionality compiled in correctly. I've left a big comment in the middle where I'm getting stuck. Not sure if this has anything to do with it running on IIS? The .zip file gets uploaded where I'd expect it to, and I'm manually able to ftp it back and extract the files. I'm looking to