Search Results

Search found 3241 results on 130 pages for 'extract'.

Page 9/130 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How do I use grep to extract a specific field value from lines

    - by Stormshadow
    I have lines in a file which look like the following ....... DisplayName="john" .......... where .... represents variable number of other fields. Using the following grep command, I am able to extract all the lines which have a valid 'DisplayName' field grep DisplayName="[0-9A-Za-z[:space:]]*" e:\test However, I wish to extract just the name (ie "john") from each line instead of the whole line which is returned by grep. I tried pipelining the output to the cut command but it does not accept string delimiters.

    Read the article

  • Extract object (*.o) files from an iPhone static library

    - by Brett
    I have a set of iPhone static libraries (a *.a file) in which I only call a few of the classes from. I have used AR in the past (with linux libraries) to extract the object files from the static library, remove the unwanted object files and rearchive. However, when I try this with an iPhone compliled static library, I get the following error: ar: CustomiPhoneLib.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) ar: CustomiPhoneLib.a: Inappropriate file type or format Does anyone know how to extract the object files from an iphone compiled static library? Doing thie could potentially reduce the final file size.

    Read the article

  • Extract domain from url (including the hard ones)

    - by karl
    I'm trying to write (or just find an existing) PHP method that can take a link and extract the url. The trick is, it needs to hold under the weight of strange looking domains like: www.champa.kku.ac.th Looking at this one myself with human eyes, I still guessed it incorrectly: thought the domain would be kku.ac.th but that gives a dns error when visiting. So anyone knows of a good way to reliably extract the domain from url: http://site.com/hello.php http://site.com.uk/hello.php http://subdomain.site.com/hello.php http://subdomain.site.com.uk/hello.php http://www.champa.kku.ac.th/hello.php // and even the one I couldn't tell

    Read the article

  • python regular expressions, how to extract longest of overlapping groups

    - by xulochavez
    Hi How can I extract the longest of groups which start the same way For example, from a given string, I want to extract the longest match to either CS or CSI. I tried this "(CS|CSI).*" and it it will return CS rather than CSI even if CSI is available. If I do "(CSI|CS).*" then I do get CSI if it's a match, so I gues the solution is to always place the shorter of the overlaping groups after the longer one. Is there a clearer way to express this with re's? somehow it feels confusing that the result depends on the order you link the groups.

    Read the article

  • Extract and replace named group regex

    - by user557670
    I was able to extract href value of anchors in an html string. Now, what I want to achieve is extract the href value and replace this value with a new GUID. I need to return both the replaced html string and list of extracted href value and it's corresponding GUID. Thanks in advance. My existing code is like: Dim sPattern As String = "<a[^>]*href\s*=\s*((\""(?<URL>[^\""]*)\"")|(\'(?<URL>[^\']*)\')|(?<URL>[^\s]* ))" Dim matches As MatchCollection = Regex.Matches(html, sPattern, RegexOptions.IgnoreCase Or RegexOptions.IgnorePatternWhitespace) If Not IsNothing(matches) AndAlso matches.Count > 0 Then Dim urls As List(Of String) = New List(Of String) For Each m As Match In matches urls.Add(m.Groups("URL").Value) Next End If Sample HTML string: <html><body><a title="http://www.google.com" href="http://www.google.com">http://www.google.com</a><br /><a href="http://www.yahoo.com">http://www.yahoo.com</a><br /><a title="http://www.apple.com" href="http://www.apple.com">Apple</a></body></html>

    Read the article

  • Extract elements from list based on object property type

    - by Dustin Digmann
    Often, I have a list of objects. Each object has properties. I want to extract a subset of the list where a specific property has a predefined value. Example: I have a list of User objects. A User has a homeTown. I want to extract all users from my list with "Springfield" as their homeTown. I normally see this accomplished as follows: List users = getTheUsers(); List returnList = new ArrayList(); for (User user: users) { if ("springfield".equalsIgnoreCase(user.getHomeTown()) returnList.add(user); } I am not particularly satisfied with this solution. Yes, it works, but it seems so slow. There must be a non-linear solution. Suggestions?

    Read the article

  • PHP: extract email and name from data file

    - by pi-2r
    I need to extract the name and the e-mail from one data file. the file contains more than 500 lines and I want to extract this two informations almost all the data. I would like to use preg_match_all, but my function doesn't work ... $chaine = " ----------------- 11/21/12 16:06:54 tcp static-qvn-qvt-127041 MAIL [email protected] NAME tata1 ----------------- 11/21/12 16:06:54 tcp static-qvn-qvt-127041 MAIL [email protected] NAME tata2 * ----------------- 11/21/12 16:06:54 tcp static-qvn-qvt-127041 MAIL [email protected] NAME tata3 "; //$chaine =" #76:50#89:1#86:50#49:1#84:22"; $motif="/MAIL([a-z]{2,4}+)NAME([a-z]{2,4}+)/"; preg_match_all($motif,$chaine,$out); $nb=count($out[0]); for($i=0;$i<$nb;$i++) { echo $out[0][$i].'<br/>'; }

    Read the article

  • Extract substructure from a text file using bash or python

    - by Werner
    Hi, I have a huge text file, which follows the structure: SET TAG1 ... ... SET ... SET TAG2 ... ... SET ... ... I would like to extract for a specific TAG, (i.e. TAG54) its individual "substructure", which would be SET TAG54 ... ... SET Each substructure, for a given TAG_i contains always: first line:SET second line:TAG_i (in this case TAG54) an arbitrary number of lines last line:SET I wonder what would be the best way to do this, whether in bash or python, so for a given TAG, one can "extract" this substructure. Thanks

    Read the article

  • Using arrays with other arrays in Python.

    - by Scott
    Trying to find an efficient way to extract all instances of items in an array out of another. For example array1 = ["abc", "def", "ghi", "jkl"] array2 = ["abc", "ghi", "456", "789"] Array 1 is an array of items that need to be extracted out of array 2. Thus, array 2 should be modified to ["456", "789"] I know how to do this, but no in an efficient manner.

    Read the article

  • How restore data from pcap file?

    - by dscTobi
    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 ))

    Read the article

  • Use RegEx in Java to extract parameters in between parentheses

    - by lars_bx
    I'm writing a utility to extract the names of header files from JSPs. I have no problem reading the JSPs line by line and finding the lines I need. I am having a problem extracting the specific text needed using regex. After looking at many similar questions I'm hitting a brick wall. An example of the String I'll be matching from within is: <jsp:include page="<%=Pages.getString(\"MY_HEADER\")%>" flush="true"></jsp:include> All I need is MY_HEADER for this example. Any time I have this tag: <%=Pages.getString I need what comes between this: <%=Pages.getString(\" and this: )%> Here is what I have currently (which is not working, I might add) : String currentLine; while ((currentLine = fileReader.readLine()) != null) { Pattern pattern = Pattern.compile("<%=Pages\\.getString\\(\\\\\"([^\\\\]*)"); Matcher matcher = pattern.matcher(currentLine); while(matcher.find()) { System.out.println(matcher.group(1).toString()); }} I need to be able to use the Java RegEx API and regex to extract those header names. Any help on this issue is greatly appreciated. Thanks! EDIT: Resolved this issue, thankfully. The tricky part was, after being given the right regex, it had to be taken into account that the String I was feeding to the regex was always going to have two " / " characters ( (/"MY_HEADER"/) ) that needed to be escaped in the pattern. Here is what worked (thanks to the help ;-)): Pattern pattern = Pattern.compile("<%=Pages\\.getString\\(\\\\\"([^\\\\\"]*)");

    Read the article

  • How to extract paragaph and selected lines with Perl

    - by neversaint
    I have a text that looks like this. What I want to do is to extract the whole paragraph under the section "Aceview summary" until the line that starts with "Please quote". extract the line that starts with "The closest human gene". And store them into array with two elements. However I am stuck with the following script logic. What's the right way to achieve that? #!/usr/bin/perl -w my $INFILE_file_name = $file; # input file name open ( INFILE, '<', $INFILE_file_name ) or croak "$0 : failed to open input file $INFILE_file_name : $!\n"; my @allsum; while ( <INFILE> ) { chomp; my $line = $_; my @temp1 = (); if ( $line =~ /^ AceView summary/ ) { print "$line\n"; push @temp1, $line; } elsif( $line =~ /Please quote/) { push @allsum, [@temp1]; @temp1 = (); } } close ( INFILE ); # close input file

    Read the article

  • Extract string between matching braces in Perl

    - by Srilesh
    My input file is as below : HEADER {ABC|*|DEF {GHI 0 1 0} {{Points {}}}} {ABC|*|DEF {GHI 0 2 0} {{Points {}}}} {ABC|*|XYZ:abc:def {GHI 0 22 0} {{Points {{F1 1.1} {F2 1.2} {F3 1.3} {F4 1.4}}}}} {ABC|*|XYZ:ghi:jkl {JKL 0 372 0} {{Points {}}}} {ABC|*|XYZ:mno:pqr {GHI 0 34 0} {{Points {}}}} { ABC|*|XYZ:abc:pqr {GHI 0 68 0} {{Points {{F1 11.11} {F2 12.10} {F3 14.11} {F4 16.23}}}} } TRAILER I want to extract the file into an array as below : $array[0] = "{ABC|*|DEF {GHI 0 1 0} {{Points {}}}}" $array[1] = "{ABC|*|DEF {GHI 0 2 0} {{Points {}}}}" $array[2] = "{ABC|*|XYZ:abc:def {GHI 0 22 0} {{Points {{F1 1.1} {F2 1.2} {F3 1.3} {F4 1.4}}}}}" .. .. $array[5] = "{ ABC|*|XYZ:abc:pqr {GHI 0 68 0} {{Points {{F1 11.11} {F2 12.10} {F3 14.11} {F4 16.23}}}} }" Which means, I need to match the first opening curly brace with its closing curly brace and extract the string in between. I have checked the below link, but this doesnt apply to my question. http://stackoverflow.com/questions/413071/regex-to-get-string-between-curly-braces-i-want-whats-between-the-curly-braces I am trying but would really help if someone can assist me with their expertise ... Thanks Sri ...

    Read the article

  • Extract attributes from NSManagedObject array.

    - by Pavel Peroutka
    NSFetchRequest *req = [NSFetchRequest init]; NSEntityDescription *descr = [NSEntityDescription entityForName:@"City" inManagedObjectContext:context]; [req setEntity:descr]; NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"streetName" ascending:YES]; [req setSortDescriptors:[NSArray arrayWithObject:sort]]; [sort release]; //fetch NSError *error; NSArray *result = [context executeFetchRequest:req error:&error]; //extract names NSMutableArray *streets = [[NSMutableArray alloc] init]; for () { ??? = [array objectAtIndex:i]; [streets addObject:name]; } I expected Core Data to be little more intuitive. I am new in it and I could use some help. I fetched all objects(rows) from the entity (table) City. Now I have an array of objects. From the array I need to extract the attribute “streetName” to an array which will feed the picker. I figured I need to do it in the loop but I could not figure out the way to do it. Please help. I have a background with SQL but Core Data is still a big mystery to me. Is there any publication which would take a SQL statement and show comparable Core Data syntax? Thanks.

    Read the article

  • How to extract the Sql Command from a Complied Linq Query

    - by Harry
    In normal (not compiled) Linq to Sql queries you can extract the SQLCommand from the IQueryable via the following code: SqlCommand cmd = (SqlCommand)table.Context.GetCommand(query); Is it possible to do the same for a compiled query? The following code provides me with a delegate to a compiled query: private static readonly Func<Data.DAL.Context, string, IQueryable<Word>> Query_Get = CompiledQuery.Compile<Data.DAL.Context, string, IQueryable<Word>>( (context, name) => from r in context.GetTable<Word>() where r.Name == name select r); When i use this to generate the IQueryable and attempt to extract the SqlCommand it doesn't seem to work. When debugging the code I can see that the SqlCommand returned has the 'very' useful CommandText of 'SELECT NULL AS [EMPTY]' using (var db = new Data.DAL.Context()) { IQueryable<Word> query = Query_Get(db, "word"); SqlCommand cmd = (SqlCommand)db.GetCommand(query); Console.WriteLine(cmd != null ? cmd.CommandText : "Command Not Found"); } I can't find anything in google about this particular scenario, as no doubt it is not a common thing to attempt... So.... Any thoughts?

    Read the article

  • How to extract byte-array from one xml and store it in another in Java

    - by grobartn
    So I am using DocumentBuilderFactory and DocumentBuilder to parse an xml. So it is DOM parser. But what I am trying to do is extract byte-array data (its an image encoded in base64) Store it in one object and later in code write it out to another xml encoded in base64. What is the best way to store this in btw. Store it as string? or as ByteArray? How can I extract byte array data in best way and write it out. I am not experienced with this so wanted to get opinion from the group. UPDATE: I am given XML I do not have control of incoming XML that comes in binary64 encoded < byte-array > ... base64 encoded image ... < /byte-array > Using parser I have I need to store this node and question is should that be byte or string and then writing it out to another node in new xml. again in base64 encoding. thanks

    Read the article

  • How do I extract specific data with preg_match?

    - by paulswansea
    I'm looking to extract values from a whole load of html (i've just trimmed down to the relevant data), there are multiple 'select' elements, and only want to extract those who's 'name' element matches the name 'aMembers'. So the resulting values I would like to retrieve are 5,10,25 and 30 (see below) how can I achieve this with preg_match? <DIV id="searchM" class="search"><select name="aMembers" id="aMembers" tabIndex="2"> <option selected="selected" value="">Data 3</option> <option value="5">A name</option> <option value="10">Another name</option> </select> </DIV> <DIV id="searchM" class="search"><select name="bMembers" id="bMembers" tabIndex="2"> <option selected="selected" value="">Data 2</option> <option value="15">A name</option> <option value="20">Another name</option> </select> </DIV> <DIV id="searchM" class="search"><select name="aMembers" id="Members" tabIndex="2"> <option selected="selected" value="">Data 1</option> <option value="25">A name</option> <option value="30">Another name</option> </select> </DIV>

    Read the article

  • reading job requirements

    - by Kaiynat Naz
    Hi Frins, I'd like to read an advertisement for the job through my program. Initially i am working on the templates provided by the microsoft word as "Job Description". Basically I have to extract the requirements of jobs like required education, skills or any development tools etc. I'd store these requirements in the database and then further use these in my application. Simply I dont know how to do this efficiently as I'd like to ignore articles, pronouns and so on... I am developing my application in VC#. Kindly help me... :'( Regards Kaiynat Naz

    Read the article

  • How to diff two regions of the same file in Eclipse

    - by Thomas Nilsson
    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 was a possibility to mark two regions and get Eclipse (or some other tool) to mark the differences. With this information it would be much simpler to iteratively move the regions closer until they are the same and then activate the Extract Method refactoring. It can be done in Emacs of course, but I'd like to have this readily available from Eclipse. Any pointers?

    Read the article

  • Using 'ref code' related to the spinner option chosen

    - by user1508541
    I am trying to add a spinner function in a trial app which compares the frequency charts of earphones. I am trying to extract the info from " http://www.headphone.com/learning-center/build-a-graph.php " website. what I want to do is make the spinner work like the drop down list in the mentioned website. On further inspection what I found was that every dropdown element is provided with a unique code that is called when the particular element is selected. I need help in replicating the same in an android spinner.

    Read the article

  • Extract Key and Certificate from Kemp Loadmaster?

    - by Matt Simmons
    I'm trying very hard to get away from a set of Kemp Loadmasters that I bought years ago to provide HA access to our website. Part of that process is going to be putting the key and certificate in the new solution (HAproxy with nginx doing SSL). Unfortunately, I've come up against a problem... The Kemp has built-in certificate management, and it generates CSR's at the touch of a button. It also supported importing of signed certificates, however it does not, so far as I can tell, allow any kind of export of the key itself. There is a "backup key and certificates" ability, however here's the text from the manual: LoadMaster supports exporting of ALL certificate information. This includes private key, host and intermediate certificates. The export file is designed to be used for import into another LoadMaster and is encrypted. Export and import can be completed using the WUI at Certificates -> Backup/Restore Certs. Please make sure to note the pass phrase used to create the export, it will be required to complete the import. You can selectively resort only Virtual Service certificates including private keys, intermediate certificates or both. Well, that is great, but as for actually DEALING with the certs, I'm apparently out of luck. Of course, I'm not going to give up that easily. I ran "file" on the saved cert bundle and got this: $ file client1.certs.backup client1.certs.backup: gzip compressed data, from Unix Well, awesome, I thought. Maybe it's just a .tar.gz, so I unzipped it, and that went fine, but my attempts to untar it didn't work, and running "file" on it now just gives this: $ file client1.certs.backup client1.certs.backup: data So that's where I'm stuck. Anyone have experience with these?

    Read the article

  • Extract tar with multiple tars inside?

    - by Andrew Fashion
    Is there a way to untar a file with multiple tars inside? It's suppose to just untar everything inside including untarring the tars inside the tar... With windows it does it, quite annoying I can't figure it out on linux... Here is what I am doing: # tar -xvf socialengine4.0.5p1.tar core-base-4.0.5.tar core-install-4.0.7.tar external-autocompleter-4.0.0.tar external-calendar-4.0.1.tar external-chootools-4.0.3.tar external-fancyupload-4.0.1.tar external-firebug-4.0.0.tar external-flowplayer-4.0.0.tar external-moocomet-4.0.0.tar external-moocrop-4.0.0.tar external-moolasso-4.0.0.tar external-mootools-4.0.2.tar external-mootree-4.0.0.tar external-open-flash-chart-4.0.0.tar external-smoothbox-4.0.0.tar external-swfobject-4.0.0.tar external-tagger-4.0.2.tar external-tinymce-4.0.2.tar library-engine-4.0.5.tar library-facebook-4.0.0.tar library-ofc-4.0.0.tar library-pear-4.0.1.tar library-scaffold-4.0.3.tar module-activity-4.0.5p1.tar module-announcement-4.0.3.tar module-authorization-4.0.5.tar module-core-4.0.5.tar module-fields-4.0.5p1.tar module-invite-4.0.3.tar module-messages-4.0.5.tar module-network-4.0.5p1.tar module-storage-4.0.4.tar module-user-4.0.5.tar widget-rss-4.0.2.tar widget-weather-4.0.0.tar changelog.html [root@D18634 se4]# ls -l total 36980 -rw-r--r-- 1 1000 1000 27188 Oct 8 15:39 changelog.html -rw-r--r-- 1 1000 1000 359424 Oct 8 16:13 core-base-4.0.5.tar -rw-r--r-- 1 1000 1000 1122304 Oct 8 16:13 core-install-4.0.7.tar -rw-r--r-- 1 1000 1000 38400 Oct 8 16:13 external-autocompleter-4.0.0.tar -rw-r--r-- 1 1000 1000 100352 Oct 8 16:13 external-calendar-4.0.1.tar -rw-r--r-- 1 1000 1000 31232 Oct 8 16:13 external-chootools-4.0.3.tar -rw-r--r-- 1 1000 1000 66560 Oct 8 16:13 external-fancyupload-4.0.1.tar -rw-r--r-- 1 1000 1000 85504 Oct 8 16:13 external-firebug-4.0.0.tar -rw-r--r-- 1 1000 1000 216576 Oct 8 16:13 external-flowplayer-4.0.0.tar -rw-r--r-- 1 1000 1000 11776 Oct 8 16:13 external-moocomet-4.0.0.tar -rw-r--r-- 1 1000 1000 16384 Oct 8 16:13 external-moocrop-4.0.0.tar -rw-r--r-- 1 1000 1000 27648 Oct 8 16:13 external-moolasso-4.0.0.tar -rw-r--r-- 1 1000 1000 1445376 Oct 8 16:13 external-mootools-4.0.2.tar -rw-r--r-- 1 1000 1000 45568 Oct 8 16:13 external-mootree-4.0.0.tar -rw-r--r-- 1 1000 1000 330240 Oct 8 16:13 external-open-flash-chart-4.0.0.tar -rw-r--r-- 1 1000 1000 43008 Oct 8 16:13 external-smoothbox-4.0.0.tar -rw-r--r-- 1 1000 1000 18432 Oct 8 16:13 external-swfobject-4.0.0.tar -rw-r--r-- 1 1000 1000 19968 Oct 8 16:13 external-tagger-4.0.2.tar -rw-r--r-- 1 1000 1000 5711360 Oct 8 16:13 external-tinymce-4.0.2.tar -rw-r--r-- 1 1000 1000 1230848 Oct 8 16:13 library-engine-4.0.5.tar -rw-r--r-- 1 1000 1000 28672 Oct 8 16:13 library-facebook-4.0.0.tar -rw-r--r-- 1 1000 1000 125952 Oct 8 16:13 library-ofc-4.0.0.tar -rw-r--r-- 1 1000 1000 1715200 Oct 8 16:13 library-pear-4.0.1.tar -rw-r--r-- 1 1000 1000 340480 Oct 8 16:13 library-scaffold-4.0.3.tar -rw-r--r-- 1 1000 1000 354304 Oct 8 16:13 module-activity-4.0.5p1.tar -rw-r--r-- 1 root root 327680 Jan 8 02:37 module-albums-4.0.5.tar -rw-r--r-- 1 1000 1000 80896 Oct 8 16:13 module-announcement-4.0.3.tar -rw-r--r-- 1 1000 1000 147456 Oct 8 16:13 module-authorization-4.0.5.tar -rw-r--r-- 1 1000 1000 2643968 Oct 8 16:13 module-core-4.0.5.tar -rw-r--r-- 1 root root 665600 Jan 8 02:37 module-events-4.0.5.tar -rw-r--r-- 1 1000 1000 377344 Oct 8 16:13 module-fields-4.0.5p1.tar -rw-r--r-- 1 root root 501760 Jan 8 02:37 module-forum-4.0.5p1.tar -rw-r--r-- 1 1000 1000 81408 Oct 8 16:14 module-invite-4.0.3.tar -rw-r--r-- 1 1000 1000 147968 Oct 8 16:14 module-messages-4.0.5.tar -rw-r--r-- 1 1000 1000 111616 Oct 8 16:14 module-network-4.0.5p1.tar -rw-r--r-- 1 1000 1000 99840 Oct 8 16:14 module-storage-4.0.4.tar -rw-r--r-- 1 1000 1000 844288 Oct 8 16:14 module-user-4.0.5.tar -rw-r--r-- 1 root root 18094080 Jan 8 02:40 socialengine4.0.5p1.tar -rw-r--r-- 1 1000 1000 12288 Oct 8 16:14 widget-rss-4.0.2.tar -rw-r--r-- 1 1000 1000 13824 Oct 8 16:14 widget-weather-4.0.0.tar

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >