Sponsored Content
Top Forums Shell Programming and Scripting awk - print file contents except regex Post 302222833 by rmsagar on Thursday 7th of August 2008 03:20:18 PM
Old 08-07-2008
There are other lines which I would like to print/list

If the File contains

First Name: Test
Last Name: User1
Email: testuser1
Email: testuser1@test.com

after running awk I would that to be print as

First Name: Test
Last Name: User1
Email: testuser1@test.com
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using first word and print their contents using awk

suppose u hava a file G1354R tGGC-CGC D1361N cGAC-AAC I1424T ATC-ACC R768W gCGG-TGG Q1382R CAG-CGG Q178E gCAG-GAG Y181C TAC-TGC .........cont. So the question is By searching for first word i.e.character say R output shud be R768W gCGG-TGG R182P CGG-CCG R189W ... (6 Replies)
Discussion started by: cdfd123
6 Replies

2. UNIX for Advanced & Expert Users

print contents of file2 for matching pattern in file1 - AWK

File1 row is same as column 2 in file 2. Also file 2 will either start with A, B or C. And 3rd column in file 2 is always F2. When column 2 of file 2 matches file1 column, print all those rows into a separate file. Here is an example. file 1: 100 103 104 108 file 2: ... (6 Replies)
Discussion started by: i.scientist
6 Replies

3. Shell Programming and Scripting

Read contents of the file and print

AT ---------- 0 Elapsed: 00:00:00.02 SO ---------- 0 Elapsed: 00:00:00.01 SE ---------- 0 Elapsed: 00:00:00.01 CR ---------- (4 Replies)
Discussion started by: sandy1028
4 Replies

4. Shell Programming and Scripting

need to grep contents of a file within specific time span. regex i am using is not working

Hi , I am trying to extract contents of a file between specified time stamp. but it does not seem to work. i am trying to extract output of /var/adm/messages between 15:00:00 to 15:23:59 . i have tried two regex the first one seems to kind of work. it displays some output. the second one is... (13 Replies)
Discussion started by: chidori
13 Replies

5. Shell Programming and Scripting

awk: compose regex in variable and then use its contents like $0 ~ var

A question to the awk pundits: I was thinking about composing a regex in a variable and then use its contents like $0 ~ var instead of $0 ~ /r/. Sort of indirection. Did someone run into this? Is it possible at all? (3 Replies)
Discussion started by: RudiC
3 Replies

6. UNIX for Dummies Questions & Answers

read regex from ID file, print regex and line below from source file

I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header. In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

7. Shell Programming and Scripting

To print lines between 2 timestamps using awk|sed and regex

Hi, I am using the following code to fetch lines that are generated in last 1 hr . Hence, I am using date function to calculate -last 1 hr & the current hr and then somehow use awk (or sed-if someone could guide me better) with some regex pattern. dt_1=`date +%h" "%d", "%Y\ %l -d "1 hour... (10 Replies)
Discussion started by: sarah-alikhan31
10 Replies

8. Shell Programming and Scripting

For loop inside awk to read and print contents of files

Hello, I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
Discussion started by: jaldo0805
5 Replies

9. UNIX for Advanced & Expert Users

awk print all fields except matching regex

grep -v will exclude matching lines, but I want something that will print all lines but exclude a matching field. The pattern that I want excluded is '/mnt/svn' If there is a better solution than awk I am happy to hear about it, but I would like to see this done in awk as well. I know I can... (11 Replies)
Discussion started by: glev2005
11 Replies

10. Shell Programming and Scripting

(n)awk: print regex search output lines in one line

Hello. I have been looking high and low for the solution for this. I seems there should be a simple answer, but alas. I have a big xml file, and I need to extract certain information from specific items. The information I need can be found between a specific set of tags. let's call them... (2 Replies)
Discussion started by: Tobias-Reiper
2 Replies
Email::MessageID(3pm)					User Contributed Perl Documentation				     Email::MessageID(3pm)

NAME
Email::MessageID - Generate world unique message-ids. SYNOPSIS
use Email::MessageID; my $mid = Email::MessageID->new->in_brackets; print "Message-ID: $midx0Ax0D"; DESCRIPTION
Message-ids are optional, but highly recommended, headers that identify a message uniquely. This software generates a unique message-id. METHODS
new my $mid = Email::MessageID->new; my $new_mid = Email::MessageID->new( host => $myhost ); This class method constructs an Email::Address object containing a unique message-id. You may specify custom "host" and "user" parameters. By default, the "host" is generated from "Sys::Hostname::hostname". By default, the "user" is generated using "Time::HiRes"'s "gettimeofday" and the process ID. Using these values we have the ability to ensure world uniqueness down to a specific process running on a specific host, and the exact time down to six digits of microsecond precision. create_host my $domain_part = Email::MessageID->create_host; This method returns the domain part of the message-id. create_user my $local_part = Email::MessageID->create_user; This method returns a unique local part for the message-id. It includes some random data and some predictable data. in_brackets When using Email::MessageID directly to populate the "Message-ID" field, be sure to use "in_brackets" to get the string inside angle brackets: header => [ ... 'Message-Id' => Email::MessageID->new->in_brackets, ], Don't make this common mistake: header => [ ... 'Message-Id' => Email::MessageID->new->as_string, # WRONG! ], SEE ALSO
Email::Address, Time::HiRes, Sys::Hostname, perl. PERL EMAIL PROJECT
This module is maintained by the Perl Email Project. <http://emailproject.perl.org/wiki/Email::MessageID> AUTHOR
Casey West, <casey@geeknest.com>. COPYRIGHT
Copyright (c) 2004 Casey West. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-07-15 Email::MessageID(3pm)
All times are GMT -4. The time now is 04:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy