02-11-2011
sed to insert a separator
Merci ctsgnb
Thanks M D
Working fine now !
Sorry for the delay in getting back to you : illness & vacation
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how can i modify a file using sed when searching
for a pattern and insert newline after the pattern?
pattern example: $ ...(any characters)...$
$ may082001.../tmp/msg.001,,$ REPT CLEAR ALARMS ON UNIT 1
$ may082001.../tmp/msg.002,,$ UNIT 1 IN SERVICE
into:
$... (1 Reply)
Discussion started by: apalex
1 Replies
2. UNIX for Dummies Questions & Answers
Hello. Trying to insert text at line 1 and after last line of file. I have searched posts but nothing seems to work. I keep getting extra characters error or nothing gets inserted into the file.
#!/bin/sh
touch textfile.txt
sed 'i\
Add this line before every line with WORD' textfile.txt
... (5 Replies)
Discussion started by: steveramsey
5 Replies
3. Shell Programming and Scripting
Hi,
I'm using the following to insert lines into file:
sed ${rowNr}i'\
first row\
second row\
third row\
' file.txt
How can I add tab in front of each added line? "\t" or actual TAB does not seem to work?
Thanks! (2 Replies)
Discussion started by: Juha
2 Replies
4. Shell Programming and Scripting
Hi there
I am trying to convert some date seperators in a large newline delimited file. each line i am interested in has a date in the format 27/05/2009 all I want is to convert the slashes to tildes(~) I have come up with the following code but it does nothing.
sed... (5 Replies)
Discussion started by: RadRod
5 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I have the following data in a korn shell variable:
a="FirstValue|SecondValue|ThirdValue"
The value between "FirstValue", "SecondValue" and "ThirdValue" can change, in this case is a comma: "," and I need to print it only once. I need to know what is the separator value.
I... (3 Replies)
Discussion started by: felipe.vinturin
3 Replies
6. Shell Programming and Scripting
Hi All
I'm trying to insert a pattern if a pattern is found in a file.
This is my sample file
"PDA"|"Celvin"|"PRJ_NA"|"Completion_Units"|25
"PDA"|"Celvin"|"PRJ_AB"|"Completion_Units"|250
I would like to output as
"PDA"|"Celvin"|"PRJ_NA"|"Completion_Units"|"Done"|25... (3 Replies)
Discussion started by: Celvin VK
3 Replies
7. Shell Programming and Scripting
I have done this sed command to insert one line after a specific string is found:
sed '/patternstring/ a\
new line string' file1
But how do I insert two lines? This is not possible:
sed '/patternstring/ a\
new line string \a
new line string 2' file1 (2 Replies)
Discussion started by: locoroco
2 Replies
8. Shell Programming and Scripting
sed 's/$/TEST/g' will insert TEST at the end of each line. i want to insert TEST at column 64 (7 Replies)
Discussion started by: lawsongeek
7 Replies
9. Shell Programming and Scripting
Hi all,
I have a file like this
Q8N302
21-84
Q8N157
15-45
Q99996
167-201
202-251
269-318
I want to insert a character or space if the line starts with a number and I used the command
sed 's/^/#/'
But in the output file, when it inserts this character, first digit in the number is... (2 Replies)
Discussion started by: kaav06
2 Replies
10. Shell Programming and Scripting
Hi Seders,
i am new to this forum, but i think it's quite the best place to post.
So, here is my pb :
I have a csv file, with comma separator and text enclosed by ".
First pb is with text in " ......... ", wich sometimes includes lines break, and commas
And to complicate a little more,... (4 Replies)
Discussion started by: yogeek
4 Replies
LEARN ABOUT DEBIAN
mail::verp
Verp(3pm) User Contributed Perl Documentation Verp(3pm)
NAME
Mail::Verp - encodes and decodes Variable Envelope Return Paths (VERP) addresses.
SYNOPSIS
use Mail::Verp;
#Using class methods
#Change separator to something else
Mail::Verp->separator('+');
#Create a VERP envelope sender of an email to recipient@example.net.
my $verp_email = Mail::Verp->encode('sender@example.com', 'recipient@example.net');
#If a bounce comes back, decode $verp_email to figure out
#the original recipient of the bounced mail.
my ($sender, $recipient) = Mail::Verp->decode($verp_email);
#Using instance methods
my $verp = Mail::Verp->new(separator => '+');
#Create a VERP envelope sender of an email to recipient@example.net.
my $verp_email = $verp->encode('sender@example.com', 'recipient@example.net');
#Decode a bounce
my ($sender, $recipient) = $verp->decode($verp_email);
ABSTRACT
Mail::Verp encodes and decodes Variable Envelope Return Paths (VERP) email addresses.
DESCRIPTION
Mail::Verp encodes the address of an email recipient into the envelope sender address so that a bounce can be more easily handled even if
the original recipient is forwarding their mail to another address and the remote Mail Transport Agents send back unhelpful bounce
messages. The module can also be used to decode bounce recipient addresses.
FUNCTIONS
new()
Primarily useful to save typing. So instead of typing "Mail::Verp" you can say my $x = Mail::Verp->new; then use $x whereever
"Mail::Verp" is usually required.
Accepts an optional "separator" argument for changing the separator, which defaults to hyphen '-'. The value can also be changed using
the "separator" accessor.
my $x = Mail::Verp->new(separator => '+');
encode(LOCAL-ADDRESS, REMOTE-ADDRESS)
Encodes LOCAL-ADDRESS, REMOTE-ADDRESS into a verped address suitable for use as an envelope return address. It may also be useful to
use the same address in Errors-To and Reply-To headers to compensate for broken Mail Transport Agents.
Uses current separator value.
decode(VERPED-ADDRESS)
Decodes VERPED-ADDRESS into its constituent parts. Returns LOCAL-ADDRESS and REMOTE-ADDRESS in list context, REMOTE-ADDRESS in scalar
context. Returns VERPED-ADDRESS if the decoding fails.
Uses current separator value.
separator
Returns current value of the VERP "separator"
separator(SEPARATOR)
Sets new value for VERP "separator" and returns the previous value.
EXPORT
None.
SEE ALSO
DJ Bernstein details verps here: http://cr.yp.to/proto/verp.txt.
Sam Varshavchik proposes an encoding here: http://www.courier-mta.org/draft-varshavchik-verp-smtpext.txt.
AUTHOR
Gyepi Sam <gyepi@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2007 by Gyepi Sam
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2008-05-26 Verp(3pm)