Sponsored Content
Top Forums Shell Programming and Scripting awk to print string if tag is specific value Post 302982212 by RudiC on Monday 26th of September 2016 02:33:52 PM
Old 09-26-2016
No surprise your output is empty, as your compound if condition won't ever be true with either of your input files. When a field $i == "expName", there's no "planExecuted" nor "true" anywhere nearby. Please reconsider/refine your condition.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search a word and print specific string using awk

Hi, I have list of directory paths in a variable and i want to delete those dirs and if dir does not exist then search that string and get the correct path from xml file after that delete the correct directory. i tried to use grep and it prints the entire line from the search.once i get the entire... (7 Replies)
Discussion started by: dragon.1431
7 Replies

2. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

3. Shell Programming and Scripting

Need awk help to print specific columns with as string in a header

awk experts, I have a big file of 4000 columns with header. Would like to print the columns with string value of "Commands" in header. File has "," separator. This file is on ESX host with Bash. Thanks, Arv (21 Replies)
Discussion started by: arv_cds
21 Replies

4. UNIX for Dummies Questions & Answers

How to Detect Specific Pattern and Print the Specific String after It?

I'm still beginner and maybe someone can help me. I have this input: the great warrior a, b, c and what i want to know is, with awk, how can i detect the string with 'warrior' string on it and print the a, b, and c seperately, become like this : Warrior Type a b c Im still very... (3 Replies)
Discussion started by: radynaraya
3 Replies

5. Shell Programming and Scripting

Print String Every Specific Line

Dear All, I have input file like this, 001 059 079 996 758 079 069 059 079 ... ... Desired output: AA 001 BB 059 (4 Replies)
Discussion started by: attila
4 Replies

6. Shell Programming and Scripting

Search for a html tag and print the entire tag

I want to print from <fruits> to </fruits> tag which have <fruit> as mango. Also i want both <fruits> and </fruits> in output. Please help eg. <fruits> <fruit id="111">mango<fruit> . another 20 lines . </fruits> (3 Replies)
Discussion started by: Ashik409
3 Replies

7. Shell Programming and Scripting

How to print with awk specific field different from specific character?

Hello, i need help with awk. I have this file: cat number DirB port 67 er_enc_out 0 er_bad_os 0 DirB port 71 er_enc_out 56 er_bad_os 0 DirB port 74 er_enc_out 0 er_bad_os 0 DirB port 75 ... (4 Replies)
Discussion started by: elilmal
4 Replies

8. Shell Programming and Scripting

awk - how to print specific field if a string is matched

hi gurus, I would like to be able to use awk to process 1 file as such: abc 1 2 3 4 5 6 7 8 9 10 flags 1 2 4 flags 1 2 5 abc 2 3 4 5 6 7 8 9 10 11 flags 1 2 3 abc 4 5 6 7 8 9 6 7 78 89 flags 1 2 3 flags 1 2 4 flags 1 2 3 4 I would like to be able to print field 1 and 5 when the... (4 Replies)
Discussion started by: revaroo
4 Replies

9. Shell Programming and Scripting

Return path of specific tag using awk

The below awk is used with the attached index.html and matches the specific user id in the sub portion with path of /rundb/api/v1/plugin/49/. The command does run but the output is blank. Something changed in the file structure as it used to work. So using the first line in the output: ... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

awk to match file1 and extract specific tag values

File2 is tab-delimeted and I am trying to use $2 in file1 (space delimeted) as a search term in file2. If it is found then the AF= in and the FDP= values from file2 are extracted and printed next to the file1 line. I commented the awk before I added the lines in bold the current output resulted. I... (7 Replies)
Discussion started by: cmccabe
7 Replies
HTML::FormHandler::Manual::Errors(3pm)			User Contributed Perl Documentation		    HTML::FormHandler::Manual::Errors(3pm)

NAME
HTML::FormHandler::Manual::Errors - FormHandler error methods VERSION
version 0.40013 SYNOPSIS
Manual Index Errors and error messages for HTML::FormHandler. DESCRIPTION
Errors are added to field or form objects by the field 'add_error' method or the form 'add_form_error' method. FormHandler will perform the 'add_error' for you for built-in validation or 'apply' actions. When performing your own validation in a validation method, you must do the 'add_error' yourself. Errors, along with 'input' and 'value' attributes, are collected in the FormHandler 'result' objects. A number of error retrieving methods are delegated to the field and form classes. The existence (or not) of errors determines whether or not the form has been 'validated'. Form methods errors Returns an array of localized error strings (both field and form errors): my @errors = $form->errors; has_errors Both 'form' errors and errors from the tree of subfields if( $form->has_errors ) { <do something> } form_errors, all_form_errors Returns an arrayref / array of error strings on the form (not including field errors). foreach my $err ( $self->all_form_errors ) { $output .= "<span class="error">$err</span>"; } has_form_errors Does the form have form_errors? add_form_error Add an error to the form which is not associated with a specific field. sub validate { my $self = shift; unless( <some condition> ) { $self->add_form_error('....'); } } push_form_errors Add a non-localized error to the form. Field methods The most common error method is probably 'add_error', which you use in the validation process. sub validate_foo { my ( $self, $field ) = @_; unless ( <some_condition> ) { $field->add_error('Error condition'); } } errors Returns an array of error strings. has_errors Does the field have errors? Note that a compound field that contains subfields with errors will not return true for this method. If you want to know if there are errors in the subfields, do 'has_error_fields'. num_errors add_error Add an error to the field. Localization is performed. push_errors Add an error without localization. error_fields In a compound field (and its subclasses, like 'Repeatable'), the list of fields with errors. Result methods The input, value, and error attributes are actually stored in the result objects. Although most of the methods are delegated to the form and field classes, there are times, such as when rendering (because you might be rendering a result that's been peeled off of the form object), that you may need to use result methods. These are the main methods that you might need to use. has_errors errors error_results The results with errors; 'error_fields' is a wrapper around this. Messages The base field class and the field subclasses have some 'built-in' error messages. These can be modified by setting the 'messages' hashref in the form or the individual fields. When a message is retrieved in a field with "$field->get_message('upload_file_')" for example, the 'get_message' method will look first in user-set field specific messages, then in user-supplied form messages, finally in messages provided by the field classes. package MyApp::Form; use HTML::FormHandler::Moose; extends 'HTML::FormHandler'; sub build_messages { return { required => '....', my_message => '....' }; } ... my $form = MyApp::Form->new( messages => { required => '...', ...} ); ... has_field 'my_field' => ( messages => { required => 'Please provide a my_field' }, required => 1 ); AUTHOR
FormHandler Contributors - see HTML::FormHandler COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Gerda Shank. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-25 HTML::FormHandler::Manual::Errors(3pm)
All times are GMT -4. The time now is 03:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy