06-23-2009
awk;sed appending line to previous line....
I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one:
User1NameLast User1NameFirst User1Address
E-Mail:User1email
User2NameLast User2NameFirst User2Address
E-Mail:User2email
User3NameLast User3NameFirst User3Address
E-Mail:User3email
User4NameLast User4NameFirst User4Address
E-Mail:User4email
In English what I am looking for is each line that begins with the word "E-Mail" to be appended to the previous line so that all of the data for each user looks like this:
User1NameLast User1NameFirst User1Address E-Mail:User1email
User2NameLast User2NameFirst User2Address E-Mail:User2email
User3NameLast User3NameFirst User3Address E-Mail:User3email
User4NameLast User4NameFirst User4Address E-Mail:User4email
Thanks -
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
I need to append line or bulk of lines into a file.
For example,I have the following section in opmn.xml file:
<process-type id="OC4J_RTEadmin_NIR" module-id="OC4J">
<module-data>
<category id="start-parameters">
<data... (28 Replies)
Discussion started by: nir_s
28 Replies
2. UNIX for Dummies Questions & Answers
Have another question that has been eluding me all day.
I have data file I'm trying to reformat so that each line is appended with an ID code, but the ID code needs to update as it searches through the file.
I.e.
----Begin Original Datafile-----
Condition = XXX
Header Line 1
Header... (1 Reply)
Discussion started by: selkirk
1 Replies
3. Shell Programming and Scripting
Hi,
I searched the forum for this but couldn't find the answer. Basically I have a line of code I want to insert into a file using sed. The line of code is basically something like "address=1.1.1.1" where 1.1.1.1 is an IP Address that will vary depending on what the user enters. I'll just refer... (4 Replies)
Discussion started by: eltinator
4 Replies
4. Shell Programming and Scripting
Hi all,
I have to append every alternate line after its previous line. For example if my file has following contents
line 1: unix is an OS
line 2: it is open source
line 3: it supports shell programming
line 4: we can write shell scripts
Required output should be
line1: unix is an OS it is... (4 Replies)
Discussion started by: rish_max
4 Replies
5. Shell Programming and Scripting
Hi,
How can I remove the line beak in the following case if the line begin with the special char “;”?
TEXT
Text;text
;text
Text;text;text
I want to convert the text to:
Text;text;text
Text;text;text
I have already tried to use... (31 Replies)
Discussion started by: research3
31 Replies
6. Shell Programming and Scripting
Source File:
abcdefghijklmnop01qrstuvwxyz
abcdefghijklmnop02qrstuvwxyz
abcdefghijklmnop03qrstuvwxyz
abcdefghijklmnop04qrstuvwxyz
abcdefghijklmnop05qrstuvwxyz
Whatever characters are in 17-18 on each line of the file, it should be concatenated to the same line at the character number... (6 Replies)
Discussion started by: tamahomekarasu
6 Replies
7. Shell Programming and Scripting
hi everyone,
a
b in
c
d
e
f in
g
output is:
a
e
so awk search for "in", then print out the matched line's previuos line.
Please advice. (11 Replies)
Discussion started by: jimmy_y
11 Replies
8. Shell Programming and Scripting
I am trying to delete lines in archived Apache httpd logs
Each line has the pattern:
<ip-address> - - <date-time> <document-request-URL> <http-response> <size-of-req'd-doc> <referring-document-URL>
This pattern is shown in the example of 6 lines from the log in the code box below. These 6... (1 Reply)
Discussion started by: Proteomist
1 Replies
9. Shell Programming and Scripting
Hi all,
From a while loop I am reading a sorted file where I want to print only the lines that have $1 match and $2 only when the difference from $2 from the previous line is > 30.
Input would be like ...
AN237 010 193019 0502 1 CSU Amoxycillin
AN237 080 ... (2 Replies)
Discussion started by: gafoleyo73
2 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I need to print the characters in the previous line just before the regular expression match
Please have a look at the input file as attached
I need to match the regular expression ^ with the character of the previous like and also the pin numbers
and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
LEARN ABOUT MOJAVE
mail::spf::v1::record5.18
Mail::SPF::v1::Record(3) User Contributed Perl Documentation Mail::SPF::v1::Record(3)
NAME
Mail::SPF::v1::Record - SPFv1 record class
SYNOPSIS
See Mail::SPF::Record.
DESCRIPTION
An object of class Mail::SPF::v1::Record represents an SPFv1 ("v=spf1") record.
Constructors
The following constructors are provided:
new(%options): returns Mail::SPF::v1::Record
Creates a new SPFv1 record object.
%options is a list of key/value pairs representing any of the following options:
text
terms
global_mods
See "new" in Mail::SPF::Record.
scopes
See "new" in Mail::SPF::Record. Since SPFv1 records always implicitly cover the "helo" and "mfrom" scopes, this option must either
be exactly ['helo', 'mfrom'] (or ['mfrom', 'helo']) or be omitted.
new_from_string($text, %options): returns Mail::SPF::v1::Record; throws Mail::SPF::ENothingToParse, Mail::SPF::EInvalidRecordVersion,
Mail::SPF::ESyntaxError
Creates a new SPFv1 record object by parsing the string and any options given.
Class methods
The following class methods are provided:
version_tag_pattern: returns Regexp
Returns a regular expression that matches a version tag of 'v=spf1'.
default_qualifier
results_by_qualifier
See "Class methods" in Mail::SPF::Record.
Instance methods
The following instance methods are provided:
text
scopes
terms
global_mods
global_mod
stringify
eval
See "Instance methods" in Mail::SPF::Record.
version_tag: returns string
Returns 'v=spf1'.
SEE ALSO
Mail::SPF, Mail::SPF::Record, Mail::SPF::Term, Mail::SPF::Mech, Mail::SPF::Mod
<http://tools.ietf.org/html/rfc4408>
For availability, support, and license information, see the README file included with Mail::SPF.
AUTHORS
Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org>
perl v5.18.2 2017-10-06 Mail::SPF::v1::Record(3)