Sponsored Content
Full Discussion: Search and replace field?
Top Forums Shell Programming and Scripting Search and replace field? Post 302664123 by krsnadasa on Friday 29th of June 2012 03:01:24 AM
Old 06-29-2012
Search and replace field?

Hi Elixir,

Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk search and replace field

I am writing a c++ program that has many calls of pow(input,2). I now realize that this is slowing down the program and these all should be input * input for greater speed. There should be a simple way of doing this replacement throughout my file with awk, but I am not very familiar with awk.... (2 Replies)
Discussion started by: bluejayek
2 Replies

2. Shell Programming and Scripting

Perl - search and replace a particular field

Hi, I have a file having around 30 records. Each record has 5 fields delimited by PIPE. Few records in the file having Junk characters in the field2 and field4. I found the junk charcter and I tested it and replace the junk with space with the command below perl -i -p -e "s/\x00/ /g"... (1 Reply)
Discussion started by: ramkrix
1 Replies

3. Shell Programming and Scripting

Search duplicate field and replace one of them with new value

Dear All, I have file with 4 columns: 1 AA 0 21 2 BB 0 31 3 AA 0 21 4 CC 0 41 I would like to find the duplicate record based on column 2 and replace the 4th column of the duplicate by a new value. So, the output will be: 1 AA 0 21 2 BB 0 31 3 AA 0 -21 4 CC 0 41 Any suggestions... (3 Replies)
Discussion started by: ezhil01
3 Replies

4. Shell Programming and Scripting

Search a string,get line and replace with second field

Hi, I need to search for source path in file2 , as per file1 and if found get the next line and take the field value and put it in URL value of file1. In file1, NF is not same for all the lines. file1: <type source="/home/USER/Desktop" Dest="/home/USER/DIR1/Desktop" URL="ssh/path"/> <type... (8 Replies)
Discussion started by: greet_sed
8 Replies

5. Shell Programming and Scripting

awk search and replace in a targeted field instead of $0

Hi I would like to apply this gawk command: gawk '{$0=gensub(/\y+\y/,"","g"); print}' file not to the whole $0 but just to the part of $0 that is between: (a number)"> and </mrk> Is it possible? thanks for your help. (4 Replies)
Discussion started by: louisJ
4 Replies

6. UNIX for Dummies Questions & Answers

Shell script for search and replace by field

Hi, I have an input file with below data and rules file to apply search and replace by each field in the input based on exact value or pattern. Could you please help me with unix script to read input file and rules file and then create the output and reject files based on the rules file. Input... (13 Replies)
Discussion started by: chandrath
13 Replies

7. Shell Programming and Scripting

Search field in text file and replace value

Hi there, First of all this is my first post here. Thank you in advance for your help. What I am trying to do is the following. I have a text file where each field of each row is separated by a tabulator. Looks like this: ATOM 1 N HSE A 26 3.033 -10.429 -2.262 1.00 17.07 ... (8 Replies)
Discussion started by: doom4
8 Replies

8. Shell Programming and Scripting

Search for a value and replace other field in the same set

Hello friends, I have huge file with many sets where each "set" has few lines and each set always begins with "Set" in Sq brackets as shown above. # cat file1 (2 Replies)
Discussion started by: magnus29
2 Replies

9. UNIX for Dummies Questions & Answers

Search and replace the last field

Hi All, Seeking for your assistance on how to search and replace the last field/column. please see sample below: inputfile1.csv ="8923523434",="543623534"="afd23535623",="100"="200" ="8923523431",="543623536"="afd23535626",="101"="201"... (3 Replies)
Discussion started by: poginiks
3 Replies

10. Shell Programming and Scripting

Search term in nth field and replace kth column

Hi, I have a text file which looks like this a.txt A,12,Apple,Red B,33,Banana,Yellow C,66,Sky,Blue I need to search for a particular field(s) in particular column(s) and for that matching line need to replace the nth column. Sample scenario 1: Search for 66 in second field and Sky in... (5 Replies)
Discussion started by: wahi80
5 Replies
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)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy