First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hi,
I appreciate all who have been very helpful to me in providing valuable suggestions and replies.
I want to write a script to look up a file and match the contents. Let me go through the scenario. Lets say i have two files
Content file:
abc, bcd, adh|bcdf|adh|wed
bcf, cdf,... (2 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Hi All,
I don't know how to fast do this field replace that need lookup from another file to form the update result:confused:
I want to do it by general shell script
Can anyone help to solve it ? Thanks for your kindly reply in advance.
CK (0 Replies)
Hi,
I have two questions which I would massively appreciate help with.
1.
I am trying to insert a field into a file similar to the vlookup function in excel. In column 2 is a gene id for which i would like to insert the full name in the adjacent column. I have a map file (map.file) which... (1 Reply)
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
If $1 in file1 matches $2 in file2. Then the value in $2 of file2 is updated to $1"."$2 of file2. The awk seems to only match the two files but not update. Thank you :).
awk
awk 'NR==FNR{A ; next} $1 in A { $2 = a }1' file1 file2
file1
name version
NM_000593 5
NM_001257406... (3 Replies)
The below awk uses $3 and $4 in search as the min and max, then takes each $2 value in lookup and compares it. If the value in lookupfalls within the range in searchthen it prints the entire line in lookup/ICODE]. What I can't seem to figure out is how to print the matching $5 from search on that... (4 Replies)
I am trying to use awk to match two files that are tab-delimited. When a match is found between file1 $1 and file2 $4, $4 in file2 is updated using the $2 value in file1. If no match is found then the next line is processed. Thank you :).
file1
uc001bwr.3 ADC
uc001bws.3 ADC... (4 Replies)
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies
LEARN ABOUT DEBIAN
cgi::formbuilder::template::fast
CGI::FormBuilder::Template::Fast(3pm) User Contributed Perl Documentation CGI::FormBuilder::Template::Fast(3pm)NAME
CGI::FormBuilder::Template::Fast - FormBuilder interface to CGI::FastTemplate
SYNOPSIS
my $form = CGI::FormBuilder->new(
fields => @whatever,
template => {
type => 'Fast',
root => '/path/to/templates',
# use external files
define => {
form => 'form.txt',
field => 'field.txt',
invalid_field => 'invalid_field.txt',
},
# or define inline
define_nofile => {
form => '<html><head></head><body>$START_FORM
<table>$FIELDS</table>$SUBMIT $END_FORM</body></html>',
# etc.
},
},
);
DESCRIPTION
This engine adapts FormBuilder to use "CGI::FastTemplate". Please read these docs carefully, as the usage differs from other template
adapters in several important ways.
You will need to define three templates: "form", "field", and "invalid_field". You can use "define" to point to external files (which is
the recommended "CGI::FastTemplate" style), or "define_nofile"/ "define_raw" to define them inline. The templates in "define_nofile" take
precedence over "define_raw", and both of these take precedence over "define".
my $form = CGI::FormBuilder->new(
# ...
template => {
type => 'FastTemplate',
root => '/path/to/templates',
define => {
form => 'form.txt',
field => 'field.txt',
invalid_field => 'invalid_field.txt',
},
# or, you can define templates directly
define_nofile => {
form => '<html><head></head><body>$START_FORM<table>'
'$FIELDS</table>$SUBMIT $END_FORM</body></html>',
# etc.
},
},
# ...
);
If you use "define" with external templates, you will probably also want to define your template root directory with the "root" parameter.
Within each of the field templates, the following variables are available:
$NAME # $field->name
$FIELD # $field->tag (HTML input tag)
$VALUE # $field->value (first value only!)
$LABEL # $field->label
$COMMENT # $field->comment
$ERROR # $field->error
$REQUIRED # $field->required ? 'required' : 'optional'
All the fields are processed in sequence; valid fields use the "field" template, and invalid fields the "invalid_field" template. The
result from each of these is appended into the $FIELDS variable, which you should use in your "form" template. In the "form" template, you
also have access to these variables:
$TITLE # title of the form
$START_FORM # opening form tag
$SUBMIT # the submit button
$RESET # the reset button
$END_FORM # closing form tag
$JS_HEAD # validation JavaScript
Note that since "CGI::FastTemplate" doesn't use anything other than simple scalar variables, there are no variables corrosponding to the
lists that other engines have (e.g. "fields" or "options" lists in "TT2" or "Text::Template").
SEE ALSO
CGI::FormBuilder, CGI::FormBuilder::Template, CGI::FastTemplate
AUTHOR
Copyright (c) 2005-2006 Peter Eichman <peichman@cpan.org>. All Rights Reserved.
Maintained as part of "CGI::FormBuilder" by Nate Wiger <nate@wiger.org>.
This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which
should have accompanied your Perl kit.
perl v5.14.2 2011-09-16 CGI::FormBuilder::Template::Fast(3pm)