Sponsored Content
Top Forums Shell Programming and Scripting to search a string and redirect according to output Post 302294480 by ripat on Thursday 5th of March 2009 09:49:25 AM
Old 03-05-2009
Exactly the same but with block conditions:
Code:
 awk '/TestCase.+IS PASSED/ {print > "passed"} /TestCase.+IS FAILED/ {print > "failed"}' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search and find the string and output to a new file.

Hi I want to search the following in the entire file and put them in a diff file. file 1 contains : Non error probabilities are not decreasing in curve 1GEORGE_SGD_SUB Mid Point RESCAP_SGD_SNU curve have errors Non default probabilities are not decreasing in curve ABF_JPY_SUB Mid Point... (3 Replies)
Discussion started by: szchmaltz
3 Replies

2. Shell Programming and Scripting

redirect an awk string output to a script input with pipes

Hi, I have a function in a bash script that returns a string after some operations using awk. The following code returns 555 $VARIABLE="EXAMPLE" get_number $VARIABLE this value I'd like to pass it as a second argument of another script with the following usage myscript.sh <param1>... (7 Replies)
Discussion started by: rid
7 Replies

3. Shell Programming and Scripting

awk search an output string between two strings

I would like to search for strings stored in searchstringfile.txt in inputfiles. searchstringfile.txt J./F. Gls. Wal F. Towerinput1.txt What is needed is J./F. 12 var Gls. Wal 16 interp. Tower 12 input2.txt Awk shall search for F. 16 pt. J./F. 22 output.txt input1.txt J./F. = 12 var... (3 Replies)
Discussion started by: sdf
3 Replies

4. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

5. Shell Programming and Scripting

Search several string and convert into a single line for each search string using awk command AIX?.

I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios. Cat test Nov 10, 2012 5:17:53 AM INFO: Request Type Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies

6. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

7. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

8. Shell Programming and Scripting

Redirect the output of the file based on String

Hi, I need to redirect the output of the file until the first instance of a string is found. So in the filename output.txt i was to redirect everything from the start to where i find this string "BEA-000377" is found to a new file called output_new.txt Sample output.txt the controller... (1 Reply)
Discussion started by: mohtashims
1 Replies

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

10. Shell Programming and Scripting

Search for Pattern as output between the matched String

Hello, I have a file which has the below contents : VG_name LV_name LV_size in MB LV_option LV_mountpoint owner group y testdg rahul2lv 10 "-A y -L" /home/abc2 ... (6 Replies)
Discussion started by: rahul2662
6 Replies
Plucene::TestCase(3pm)					User Contributed Perl Documentation				    Plucene::TestCase(3pm)

NAME
Plucene::TestCase - Handy functions when testing Plucene SYNOPSIS
use Test::More tests => 10; use Plucene::TestCase; new_index { add_document( foo => "bar" ); }; re_index { add_document( foo => "baz" ); } with_reader { $READER->whatever; } my $hits = search("foo:ba*"); EXPORTS
$DIR A directory which is created for the purposes of this test, in which the index will be placed. It will normally be cleaned up at the end of the test, unless $Plucene::TestCase::DEBUG is set to allow you to peruse the entrails. $WRITER A variable holding the current "Index::Writer" object, if there is one. $READER A variable holding the current "Index::Reader" object, if there is one. $ANALYZER A variable holding the class name of the desired "Analysis::Analyzer" class. new_index BLOCK (Analyzer) Create a new index, and do the following stuff in the block before closing the index writer. $WRITER is set for the duration of the block. The optional parameter should be the class name of the analyzer to use; if not specified, the value from $ANALYZER, which in turn defaults to "Plucene::Analysis::SimpleAnalyzer", will be used. re_index BLOCK (Analyzer) Same as "new_index", but doesn't create a new index, rather re-uses an old one. add_document( field1 => value1, ...) Add a new document to the index, with the given fields and values with_reader BLOCK Opens an index reader in $READER and runs the block. search Searches for the query given. If any fields are not specified, they will be assumed to be the default "text". Returns a "Plucene::Search::Hits" object. The value of $ANALYZER will be used to construct an analyzer for the query string. perl v5.12.4 2011-08-14 Plucene::TestCase(3pm)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy