Hi, with sed you can try:
You can add the leading tabs if you need them, but in the sample there were none so I left them out...
The part in red is a subexpression in escaped parentheses plus the back references to it in the replacement part...
This is exactly what I needed, Scrutinizer. Thank you very much! The tabs don't seem to be altered with the command you provided, so I don't think I'll need to add them.
One last question. I'm using GNU sed. Can I safely use the -i option with the replacement command you wrote to do in-place editing?
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
html::auto
HTML::Auto(3pm) User Contributed Perl Documentation HTML::Auto(3pm)NAME
HTML::Auto - automatic write HTML for common elements
VERSION
Version 0.04
SYNOPSIS
Simple example:
use HTML::Auto qw/matrix h v/;
my @cols = qw/c1 c2 c3 c4 c5/;
my @lines = qw/l1 l2 l3 l4 l5/;
my $data =
[ [1,2,3,4,5],
[6,7,8,9,0],
[1,1,1,1,1],
[2,2,2,2,2],
[3,3,3,3,3] ];
my $m = matrix(@cols,@lines,$data);
print v(
h($m,$m,$m),
h($m,$m),
);
Using attributes:
use HTML::Auto qw/matrix h v/;
my @cols = qw/c1 c2/;
my @lines = qw/l1 l2/;
my $data =
[
[
{v => 1, a => { style => 'background: green'}},
2
],
[
{v => 3, a => {class => 'foo'}},
{v => 4, a => {style => 'color: red'}}
]
];
my $m = matrix(@cols,@lines,$data);
print v(
h($m)
);
With mouse-over span:
use HTML::Auto qw/matrix h v/;
my @cols = qw/c1 c2/;
my @lines = qw/l1 l2/;
my $data =
[[1,2],
[3,
{ v=> 4,
more_info => "This is a pop-up!"
}]
];
my $m = matrix(@cols,@lines,$data);
print v(
h($m)
);
Passing additional CSS:
use HTML::Auto qw/matrix h v/;
my @cols = qw/c1 c2/;
my @lines = qw/l1 l2/;
my $data =
[
[
{v => 1, a => { class => 'warn'}},
2
],
[3,4]
];
my $options = { css => '.warn { background-color: yellow !important; }' };
my $m = matrix(@cols,@lines,$data,$options);
print v(
h($m)
);
SUBROUTINES /METHODS
matrix
h
A function to allow horizontal composition.
v
A function to allow vertical composition.
AUTHOR
Nuno Carvalho, "<smash at cpan.org>" Andre Santos, "<andrefs at cpan.org>"
BUGS
Please report any bugs or feature requests to "bug-html-auto at rt.cpan.org", or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Auto <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Auto>. I will be notified,
and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc HTML::Auto
You can also look for information at:
o RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-Auto <http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-Auto>
o AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/HTML-Auto <http://annocpan.org/dist/HTML-Auto>
o CPAN Ratings
http://cpanratings.perl.org/d/HTML-Auto <http://cpanratings.perl.org/d/HTML-Auto>
o Search CPAN
http://search.cpan.org/dist/HTML-Auto/ <http://search.cpan.org/dist/HTML-Auto/>
ACKNOWLEDGEMENTS LICENSE AND COPYRIGHT
Copyright 2012 Project Natura.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as
published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
perl v5.14.2 2012-06-05 HTML::Auto(3pm)