Hello:
I have the following HTML table:
I would like to add a button with an event to every <td> element with a code, like the following:
Note that I'm not asking how to parse the HTML. Instead, I would like to know how to replace every \t\t\t<td>x</td> line by \t\t\t<td><button onclick="reset(x)">x</button></td>, where x is the code number.
I need to do it with a command-line text editor without input from the user, because I have many files like this one and my idea is to edit all of them using find with the -exec option.
This would be a simple task with ex or ed if I just had to replace the same concurrence. But in this case, I need to keep the code in every replacement. That's what I'm struggling with. I'm afraid I'll need advanced tools like awk and I honestly don't know how to do it.
How can I add the button with the event to the table cells?
Thanks in advance.
Greetings,
I have a file: hostnames.txt which has -
# cat hostnames.txt
machine1
machine2
I need the output to be saved to a variable as:
HOSTNAMELIST=machine1,machine2
Please advise.
Thanks,
Chiru (3 Replies)
Hi,
Is there a way to use cp in such a way that when a file is copied to a destination, the required destination folders are automatically created with the proper permissions, and the resulting copied file has the same attributes as the original. For example if I copied... (1 Reply)
Hi Guys
I need to have a shell script which reads a log file and insert a part of each line into the database. Some sample lines in the file are as below.
20091112091359 MED_RQACK : user_data=60173054304,100232120,20091112091359,;ask_status=0;ask_reason=OK;msg_id=20091112091319... (5 Replies)
Hello,
I'm wondering where I could go to learn how to edit file sections that cross multiple lines. I'm wanting to write scripts that will add Gnome menu entries for all users on a system for scripts I write, etc. I can search an replace simple examples with sed, but this seems more complex.
... (8 Replies)
Hi Forum.
I've tried to search online for a solution but I cannot seem to find one.
Hopefully, someone here can help me out. I would appreciate it.
Input file abc.txt:
$InputFile_Borrower=CMTSLST\EDW_COMMERCIAL_MTGE_BORROWER_dat.lst... (14 Replies)
Greetings,
I am using tcsh to write a script that will replace the numbers in a file with a single number, the caveat is that this file has blank lines which are necessary for another step down the line so I need to preserve the blank lines. I have tried sed and awk but both will collapse the... (1 Reply)
Hi all,
I need to write an automated bash shell script which performs such operations:
1. Grep the header of everyline with the initial of "T" in "FILE_A"
2. Perform a for loop,
Count the numbers of comma in the line of code,
if (no. of comma < 17)
ADD the comma until 17;
... (2 Replies)
Hi,
I lack the utter fundamentals on how to craft an awk script.
I have hundreds of text files that were mangled by .doc format so all the lines are broken up so I need to join all of the lines of text into a single line. Normally I use vim command "ggVGJ" to join all lines but with so many... (3 Replies)
Hi
I have a file with the following structure
"VATTENFALL GLOBAL" "Vattenfall Tray"
"BARCLAYS BANK LONDON" "Capula"
"P1 AGEAS GLOBAL COMPANY" "AAC - Optiver"
The requirement is like this
1) Take 2 input... (16 Replies)
Hi,
I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this:
Name =A
xxxxxx
yyyyyy
zzzzzz
aaaaaa
bbbbbb
Value = 57
This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies
LEARN ABOUT DEBIAN
www::mechanize::formfiller::value::callback
WWW::Mechanize::FormFiller::Value::Callback(3pm) User Contributed Perl Documentation WWW::Mechanize::FormFiller::Value::Callback(3pm)NAME
WWW::Mechanize::FormFiller::Value::Callback - Call Perl code to fill out a HTML form field
SYNOPSIS
use WWW::Mechanize::FormFiller;
use WWW::Mechanize::FormFiller::Value::Callback;
my $f = WWW::Mechanize::FormFiller->new();
# Create a default value for the HTML field "login"
# This will put the current login name into the login field
sub find_login {
getlogin || getpwuid($<) || "Kilroy";
};
my $login = WWW::Mechanize::FormFiller::Value::Callback->new( login => &find_login );
$f->add_value( login => $login );
# Alternatively take the following shorthand, which adds the
# field to the list as well :
# "If there is no password, put a nice number there
my $password = $f->add_filler( password => Callback => sub { int rand(90) + 10 } );
DESCRIPTION
This class provides a way to write a value returned by Perl code into a HTML field.
new NAME, CODE
Creates a new value which will correspond to the HTML field "NAME". The "CODE" is a code reference that will return the value to be
written into the HTML field. The code reference will be called with two parameters, the object and the HTML::Form::Input object.
name [NEWNAME]
Gets and sets the name of the HTML field this value corresponds to.
value FIELD
Returns the value to put into the HTML field.
EXPORT
None by default.
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Copyright (C) 2002,2003 Max Maischein
AUTHOR
Max Maischein, <corion@cpan.org>
Please contact me if you find bugs or otherwise improve the module. More tests are also very welcome !
SEE ALSO
WWW::Mechanize, WWW::Mechanize::Shell, WWW::Mechanize::FormFiller, WWW::Mechanize::FormFiller::Value::Value,
WWW::Mechanize::FormFiller::Value::Default, WWW::Mechanize::FormFiller::Value::Random, WWW::Mechanize::FormFiller::Value::Interactive
perl v5.10.1 2009-04-24 WWW::Mechanize::FormFiller::Value::Callback(3pm)