Sponsored Content
Top Forums Shell Programming and Scripting Search between two search strings and print the value Post 302792719 by onesuri on Thursday 11th of April 2013 01:34:45 AM
Old 04-11-2013
Hi,

it is working fine but tried to add print options to keep in the same line. but it is not working.

Code:
Output Value:
temp_vul : abcdefghijklmnopqu ~ new_Vul: asdasjdlkajsdlasdlkj
temp_vul : abcdefghijklmnopqu ~ new_Vul: asdasjdlkajsdlasdlkj
temp_vul : abcdefghijklmnopqu ~ new_Vul: asdasjdlkajsdlasdlkj

Thanks
onesuri
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search between strings with an OR

Hi have Input in this way KEY AAAA BBBB END1 KEY AAAA BBBB END2 KEY AAAA BBBB END3 I need to find any thing matching in between KEY And ending with "END1|END2|END3" This didnot work awk '/KEY/,/END1|END2|END3/' (3 Replies)
Discussion started by: pbsrinivas
3 Replies

2. Shell Programming and Scripting

how to search with 2 strings.

Hi, i have a file a.txt like -------------------------------- col1|col2|col3 data1|data2|data3 other1|other2|other3 -------------------------------- i need to search 2 strings(data in a.txt file is case sesnsitive), suppose data1 and data2. If these 2 strings found then only i need... (2 Replies)
Discussion started by: syamkp
2 Replies

3. Shell Programming and Scripting

Search between 2 strings

Guys any pointers on how to search between 2 sets date strings with time in the below file example :- 02-Feb-2010 23:12:09 GMT event_type::event_details_are_like_this 02-Feb-2010 09:10:29 GMT event_type::event_details_are_like_this 03-Feb-2010 11:12:19 GMT... (3 Replies)
Discussion started by: lavascript
3 Replies

4. UNIX for Dummies Questions & Answers

How to search two strings in a file and print the contents in between to a file

I have a file called po.txt. Here is the content of the file: <!DOCTYPE PurchaseOrderMessage (View Source for full doctype...)> - <PurchaseOrder> - <Header> <MessageId>cdb3062b-685b-4cd5-9633-013186750e10</MessageId> <Timestamp>2011-08-01T13:47:23.536-04:00</Timestamp> </Header> -... (4 Replies)
Discussion started by: webbi
4 Replies

5. Shell Programming and Scripting

awk strings search + print next column after match

Hi, I have a file filled with search strings which have a blank in between and look like this: S. g. Ehr. o. Jg. v. d. Chijs g. Ehr. Now i would like to search for the strings and it also shall return the next column after the match. awk -v FILE="search_strings.txt" 'BEGIN {... (10 Replies)
Discussion started by: sdf
10 Replies

6. Shell Programming and Scripting

Perl - use search keywords from array and search a file and print 3rd field when matched

Hi , I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code. my $current_value=12345; my @users=("bob","ben","tom","harry"); open DBLIST,"<","/var/tmp/DBinfo"; my @input = <DBLIST>; foreach (@users) { my... (11 Replies)
Discussion started by: chidori
11 Replies

7. UNIX for Dummies Questions & Answers

Search file and print everything except multiple search terms

I'm trying to find a way to search a range of similar words in a file. I tried using sed but can't get it right:sed 's/\(ca01\)*//'It only removes "ca01" but leaves the rest of the word. I still want the rest of the information on the lines just not these specific words listed below. Any... (3 Replies)
Discussion started by: seekryts15
3 Replies

8. Shell Programming and Scripting

Read in search strings from text file, search for string in second text file and output to CSV

Hi guys, I have a text file named file1.txt that is formatted like this: 001 , ID , 20000 002 , Name , Brandon 003 , Phone_Number , 616-234-1999 004 , SSNumber , 234-23-234 005 , Model , Toyota 007 , Engine ,V8 008 , GPS , OFF and I have file2.txt formatted like this: ... (2 Replies)
Discussion started by: An0mander
2 Replies

9. UNIX for Beginners Questions & Answers

Search strings from a file in files in a directory recursively; then print the string with a status

Hi All, I hope somebody would be able to help me. I would need to search a string coming from a file, example file.txt: dog cat goat horse fish For every string, I would need to know if there are any files inside a directory(recursively) that contains the string regardless of case.... (9 Replies)
Discussion started by: kokoro
9 Replies

10. UNIX for Beginners Questions & Answers

Search for Multiple strings in a given date range and print the Group if they exists

Hi, I am Searching for Multiple strings in a given date range and print the Group if they exists. the below is the format: ------------------------------------------------------------------------------------------------------------------------- ID: FIRST ID MESSAGE: Event Message... (5 Replies)
Discussion started by: linuxuser999
5 Replies
Perldoc::Search(3pm)					User Contributed Perl Documentation				      Perldoc::Search(3pm)

NAME
Perldoc::Search - Index and Search local Perl Documentation SYNOPSIS
####################################### # Command line utility: ####################################### # This is permanent and needs to be performed only once # (or if new documentation gets installed). $ perldig -u # Then, search: $ perldig log AND apache AND connect 1) CGI/Carp.pm 2) CGI/Prototype.pm 3) DBI/Changes.pm 4) DBI/Changes.pm Enter number of choice: ####################################### # API ####################################### use Perldoc::Search; my $searcher = Perldoc::Search->new(); # This is permanent and needs to be performed only once # (or if new documentation gets installed). $searcher->update(); # Then, search: for my $hit ($searcher->search("log AND apache")) { print $hit->path(), " "; } DESCRIPTION
"Perldoc::Search" uses the swish-e engine to index the local Perl documentation. It provides both the command line utility "perldig" and an API to perform searches on the index. It uses "SWISH::API::Common" as the indexing and search engine. Most likely, you will want the command line utility "perldig", please check the documentation that comes with it by calling perldoc perldig In case you're interested in the API, read on. METHODS
"my $searcher = Perldoc::Search-$<gt"new()> Instantiates a searcher object. Usually takes no parameters. If you like to modify the searched directories or want to pass different options to "SWISH::API::Common", go ahead: use Config; my $searcher = Perldoc::Search->new( dirs => [$Config{installsitearch}, $Config{installsitelib}, $Config{installarchlib}, $Config{installprivlib}, ], swish_options => { swish_adm_dir => "$ENV{HOME}/.perldig", } ); "$searcher-"update()> Update the index. This operation might take a couple of minutes. "my @hits = $searcher-"search("log AND apache")> Perform a search on the index with the given query. Returns a list of result objects. # Search documents containing # both "foo" and "bar" for my $hit ($swish->search("foo AND bar")) { print $hit->path(), " "; } LEGALESE
Copyright 2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
2005, Mike Schilli <cpan@perlmeister.com> perl v5.12.4 2011-09-17 Perldoc::Search(3pm)
All times are GMT -4. The time now is 08:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy