Sponsored Content
Full Discussion: Extract text from string
Top Forums Shell Programming and Scripting Extract text from string Post 302696641 by zaxxon on Wednesday 5th of September 2012 08:11:40 AM
Old 09-05-2012
Code:
# INFO="$(sed '/INFO/ {s/^ *//}' info.tmp)"
# echo "FIELD1; FIELD2; $INFO; FIELD4"
FIELD1; FIELD2; INFO : ABCDEFG; FIELD4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to extract text from string using regular expressions

Hi, I'm trying to use sed to extract some text and assign it to a variable. Can anyone provide me with some help? it would be much appreciated! I"m looking to extract for example: filename=/output/R34/2005_13_R34_C1042S_T83_CRFTXT_20081015.txt I'm trying to extract the 1042... (9 Replies)
Discussion started by: jtung
9 Replies

2. Programming

c program to extract text between two delimiters from some text file

needa c program to extract text between two delimiters from some text file. and then storing them in to diffrent variables ? text file like 0: abc.txt ========= aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Discussion started by: kukretiabhi13
7 Replies

3. Shell Programming and Scripting

Search for string in a file and extract another string to a variable

Hi, guys. I have one question: I need to search for a string in a file, and then extract another string from the file and assign it to a variable. For example: the contents of the file (group) is below: ... ftp:x:23: mail:x:34 ... testing:x:2001 sales:x:2002 development:x:2003 ...... (6 Replies)
Discussion started by: daikeyang
6 Replies

4. Shell Programming and Scripting

how to extract a paticular string from the text file with awk.

hello forum members I have txt file which consists the following information. Server: abababa.xyz.ap.mxmx.com Address: 111.143.211.202 Name: rmxd.ipc.ap.mxmx.com Address: 144.111.99.9 from the abovefile i have to extract only string "rmxd.ipc.ap.mxmx.com" through awk command.... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

5. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

6. Shell Programming and Scripting

Extract a string between 2 ref string from a file

Hi, May i ask if someone share some command for extracting a string between 2 ref string in a txt file My objective: i had a file with multiple lines and wants only to extract the string "watch?v=IbkAXOmEHpY" or "watch?v=<11 random character>", when i used "grep 'watch?=*' i got a results per... (4 Replies)
Discussion started by: jao_madn
4 Replies

7. Shell Programming and Scripting

How to extract text from STRING to end of line?

Hi I have a very large data file with several hundred columns and millions of lines. The important data is in the last set of columns with variable numbers of tab delimited fields in front of it on each line. Im currently trying sed to get the data out - I want anything beetween :RES and... (4 Replies)
Discussion started by: Manchesterpaul
4 Replies

8. Shell Programming and Scripting

Search String and extract few lines under the searched string

Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed Bold letters are the stations . The whole file has multiple stations . Below example i wanted to search... (4 Replies)
Discussion started by: ajayram_arya
4 Replies

9. Shell Programming and Scripting

To Search for a string and to extract the string from the text

Hi Team I have an huge xml where i need to search for a ceratin numbers. For example 2014-05-06 15:15:41,498 INFO WebContainer : 10 CommonServicesLogs - CleansingTriggerService.invokeCleansingService Entered PUBSUB NOTIFY MESSAGE () - <?xml version="1.0" encoding="UTF-8"... (5 Replies)
Discussion started by: Kannannair
5 Replies

10. Shell Programming and Scripting

Extract all text between the same matching string from a given column

Hello All, I have an input sample data like below (In actual I have many columns and few million rows). Column1,Column2 4,2 1,5 Hello,4 1,4 Hello,2 3,5 Hello,8 4,5 Need the output (using awk and/or sed preferably) like below. Here I need all the lines between 2 matching... (1 Reply)
Discussion started by: ks_reddy
1 Replies
Jifty::Test::WWW::Mechanize(3pm)			User Contributed Perl Documentation			  Jifty::Test::WWW::Mechanize(3pm)

NAME
Jifty::Test::WWW::Mechanize - Subclass of Test::WWW::Mechanize with extra Jifty features METHODS
new Overrides Test::WWW::Mechanize's "new" to automatically give the bot a cookie jar. request We override WWW::Mechanize's default request method so accept-encoding is not set to gzip by default. moniker_for ACTION, FIELD1 => VALUE1, FIELD2 => VALUE2 Finds the moniker of the first action of type ACTION whose "constructor" field FIELD1 is VALUE1, and so on. my $mon = $mech->moniker_for('MyApp::Action::UpdateInfo'); If there is only one action of type ACTION, be sure not to pass any more arguments to this method, or the method will return undef. NOTE that if you're using this in a series of different pages or forms, you'll need to run it again for each new form: $mech->fill_in_action_ok($mech->moniker_for('MyApp::Action::UpdateInfo'), owner_id => 'someone'); $mech->submit_html_ok(); is($mech->action_field_value($mech->moniker_for("MyApp::Action::UpdateInfo"), 'owner_id'), 'someone', "Owner was reassigned properly to owner 'someone'"); fill_in_action MONIKER, FIELD1 => VALUE1, FIELD2 => VALUE2, ... Finds the fields on the current page with the names FIELD1, FIELD2, etc in the MONIKER action, and fills them in. Returns the HTML::Form object of the form that the action is in, or undef if it can't find all the fields. fill_in_action_ok MONIKER, FIELD1 => VALUE1, FIELD2 => VALUE2, ... Finds the fields on the current page with the names FIELD1, FIELD2, etc in the MONIKER action, and fills them in. Returns the HTML::Form object of the form that the action is in, or undef if it can't find all the fields. Also, passes if it finds all of the fields and fails if any of the fields are missing. action_form MONIKER [ARGUMENTNAMES] Returns the form (as an HTML::Form object) corresponding to the given moniker (which also contains inputs for the given argumentnames), and also selects it as the current form. Returns undef if it can't be found. action_field_input MONIKER, FIELD Finds the field on the current page with the names FIELD in the action MONIKER, and returns its HTML::Form::Input, or undef if it can't be found. action_field_value MONIKER, FIELD Finds the field on the current page with the names FIELD in the action MONIKER, and returns its value, or undef if it can't be found. send_action CLASS ARGUMENT => VALUE, [ ... ] Sends a request to the server via the webservices API, and returns the Jifty::Result of the action. "CLASS" specifies the class of the action, and all parameters thereafter supply argument keys and values. The URI of the page is unchanged after this; this is accomplished by using the "back button" after making the webservice request. fragment_request PATH ARGUMENT => VALUE, [ ... ] Makes a request for the fragment at PATH, using the webservices API, and returns the string of the result. field_error_text MONIKER, FIELD Finds the error span on the current page for the name FIELD in the action MONIKER, and returns the text (tags stripped) from it. (If the field can't be found, return undef). uri WWW::Mechanize has a bug where it returns the wrong value for "uri" after redirect. This fixes that. See http://rt.cpan.org/NoAuth/Bug.html?id=9059 get_html_ok URL Calls "get" URL, followed by testing the HTML using Test::HTML::Lint. html_ok [STRING] Tests the current "content" using Test::HTML::Lint. If passed a string, tests against that instead of the current content. submit_html_ok Calls "submit", followed by testing the HTML using Test::HTML::Lint. follow_link_ok Calls "follow_link", followed by testing the HTML using Test::HTML::Lint. Warns if it cannot find the specified link (you should use "ok" on "find_link" first to check its existence). warnings_like WARNING, [REASON] Tests that the warnings generated by the server (since the last such check) match the given "WARNING", which should be a regular expression. If an array reference of regular expressions is passed as "WARNING", checks that one warning per element was received. no_warnings_ok [REASON] Checks that no warnings were generated by the server (since the last such check). session Returns the server-side Jifty::Web::Session object associated with this Mechanize object. continuation [ID] Returns the current continuation of the Mechanize object, if any. Or, given an ID, returns the continuation with that ID. current_user Returns the Jifty::CurrentUser object or descendant, if any. perl v5.14.2 2011-04-14 Jifty::Test::WWW::Mechanize(3pm)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy