Tried this:
And i get the ' invalid reference \1 on `s' command's RHS' error.
There's no \(...\) expression for the \1 backreference to refer to.
Appending a string to the pattern space does not require backreferences:
Instead of s/\(.*\)/\1 string/, use s/.*/& string/
If you want to append something to the line following the line that begins with "Subject:":
Regards,
Alister
---------- Post updated at 02:37 PM ---------- Previous update was at 02:00 PM ----------
Quote:
Originally Posted by twisterbr
But.... now I have another problem. When the subject has only 1 line, like this:
The String gets written in the end of the 'Date:' line
How can I get both regex working (with 1 and 2 lines) on the same sed command?
Test whether the pattern space contains \nDate: then insert the string appropriately (either before the newline if there's a match or at the end of the pattern space if there isn't).
Hi,
I have file which has the following content...
GOOD MORNING
**********WARNING**********
when it kicks from the kickstart, sshd daemon should start at last.
(WHEN KICKING ITSELF, NOT AFTER KICKING).
/etc/rc3.d/S55sshd ( run level specification for sshd is 55, now I would want to... (4 Replies)
Hi friends,
Could you please help me to resolve the below issue.
Input file :-
<Node>
<username>abc</username>
<password>ABC</password>
<Node>
<Node>
<username>xyz</username>
<password>XYZ</password>
<Node>
<Node>
<username>mnp</username>
... (3 Replies)
Hi.
I have the following text file (more precisely a Matlab script):
dummy1 = 5; varx = 'false'; dummy2 = 6;
% ... some general commands
% ...
dummy3 = 7; vary = 'option1'; dummy4 = 8;
Using sed I want to do the following action:
IF varx = 'false' vary='NEW_VALUE_1'... (11 Replies)
How can I write a script that takes a cisco config file and outputs every occurrence of two, or more, pattern matches through the whole config file?
For example, out of a config file, i want to print out every line with interface, description and ip address through the whole file, and disregard... (3 Replies)
Hey everyone, I'm new to sed and I need to create a script for inserting one line of code at the beginning of every method in a Xcode project (over 6,000 methods). Each method Structure is
(+ or -) (Various declarations-- could span multiple lines) ({)
I've tried for days, any guidance would be... (2 Replies)
Hi guys,
I am fairly comfortable with using the sed command if the string to be replaced is all on a single line.
I was wondering is it possible to use sed command in a multiline way ?
Say for example I have the below string on 2 different lines:
{
"key": "brandNameA",
... (3 Replies)
Dear all,
I try to replace a string of characters in a file (MyFile.txt) by a multiline value of the variable "Myvar":
$ cat MyFile.txt
DESCRIPTION '@TargetTable SCHEMA'
(
@InputFlowDef
);
$
The content of Myvar:
$ echo "$Myvar"
col1
, col2
, col3
$ (4 Replies)
I'm trying to replicate the sed output on p.108 of Sed&Awk,by Doughery & Robbins, 2nd edition.
I'm on a Windows 10 Surface Pro, running Cygwin for 64-bit versions of Windows.
Input text saved in text file called data_p108.txt:
Consult Section 3.1 in the Owner and Operator
Guide for a... (9 Replies)
I have a file conatining the below:
---
10.9.16.116:
/tmp/5835113081224811756.jar:
hash: e6df90d38fa86f0e289f73d79cd2cfd2a29954eb
/tmp/4603745991442278706.jar:
hash: e6df90d38fa86f0e289f73d79cd2cfd2a29954eb
10.9.14.126:
/tmp/conf/extra/httpd-ssl.conf:
hash:... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT DEBIAN
www::topica::mail
WWW::Topica::Mail(3pm) User Contributed Perl Documentation WWW::Topica::Mail(3pm)NAME
WWW::Topica::Mail - parse a single Topica mailing list mail
SYNOPSIS
my $index = WWW::Topic::Index->new($index_html);
foreach my $mess_id ($index->message_ids) {
# the mail has some information and also provides a link to the reply ...
my $mail = WWW::Topica::Mail->new($topica->fetch_mail($mess_id), $mess_id);
# which has other information (like the un-htmled mail and the email address) ...
my $reply = WWW::Topica::Reply->new($topica->fetch_reply($mail->id, $mail->eto), $mail->id, $mail->eto);
}
print "Next offset is ".$index->next."
";
print "Previous offset is ".$index->prev."
";
DESCRIPTION
Used to parse a single message page from Topica.com's mailing list indexes.
Message pages have the subject and the date and time of the mail being sent as well as a full name of each sender.
METHODS
new <page html> <id>
Takes the page html and the message-id and parses the html.
parse <html>
Parse the html to get message ids and next & prev offsets.
id
Get the id of this mail
eto
Get the eto of the next reply we need to get
date
Get the date of this mail
subject
The subject of the mail
from
Get the name of the person it was from
body
Get the body of the mail.
AUTHOR
Simon Wistow <simon@thegestalt.org>
COPYRIGHT
Copyright (c) 2004, Simon Wistow
perl v5.10.1 2006-01-03 WWW::Topica::Mail(3pm)