Sponsored Content
Top Forums Shell Programming and Scripting Create shell script to extract unique information from one file to a new file. Post 302547552 by Mr_47 on Tuesday 16th of August 2011 05:18:46 AM
Old 08-16-2011
my god, you guys are pro. it work now, every one of it. thx guys

---------- Post updated at 05:18 PM ---------- Previous update was at 03:44 PM ----------

another question, I generated this file a2.out, however how can I generate another file from it with only unique email listed?

Code:
more a2.out
116borrul@bx.com
133fird@b.com
147aedzra@.com
152najib@bx.com
154rshakir@bluehyppo.com
154zadzli@bc.com
155buddin@bx.com
Access to this service for 116borrul@bx.com
Access to this service for 133fird@b.com
Access to this service for 147aedzra@b.com
Access to this service for 152najib@bx.com
Access to this service for 154rshakir@b.com
Access to this service for 154zadzli@bc.com
Access to this service for 155buddin@bx.com

should be like this,
Code:
more uniqueemail.out
116borrul@bx.com
133fird@b.com
147aedzra@.com
152najib@bx.com
154rshakir@bluehyppo.com
154zadzli@bc.com
155buddin@bx.com

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Urgent: selecting unique specific content of a file using shell script

Hi, I have a file whose content and format at places is as given below. print coloumn .... coloumn .... coloumn .... skip 1 line print coloumn ... skip 1 line I need to select the following : print coloumn .... coloumn .... coloumn... (2 Replies)
Discussion started by: jisha
2 Replies

2. UNIX for Dummies Questions & Answers

Extract Unique Values from file

Hello all, I have a file with following sample data 2009-08-26 05:32:01.65 spid5 Process ID 86:214 owns resources that are blocking processes on Scheduler 0. 2009-08-26 05:32:01.65 spid5 Process ID 86:214 owns resources that are blocking processes on Scheduler 0. 2009-08-26... (5 Replies)
Discussion started by: simonsimon
5 Replies

3. Shell Programming and Scripting

shell script to sort information in one file

Hi to all, anyway to create shell script to sort informations from one file and create new file with the sorted values? from file 30days.out -bash-3.00# more 30days.out user/str4@kl.com/INBOX user/tg1@johor.com/INBOX user/tg2@kedah.com/INBOX user/tg3@titangroup.com/INBOX... (3 Replies)
Discussion started by: Mr_47
3 Replies

4. Shell Programming and Scripting

Extract UNIque records from File

Hi, I have a file with 20GB Pipe Delimited file where i have too many duplicate records. I need an awk script to extract the unique records from the file and put it into another file. Kindly help. Thanks, Arun (1 Reply)
Discussion started by: Arun Mishra
1 Replies

5. Shell Programming and Scripting

Shell Script to Dynamically Extract file content based on Parameters from a pdf file

Hi Guru's, I am new to shell scripting. I have a unique requirement: The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this: Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies

6. Shell Programming and Scripting

Help with shell script to extract certain information

Hi, I have a file which I need to programmatically split into two files. All the information in the file before pattern "STOP HERE" is to be stripped and output into one file while everything after "STOP HERE" is to be output into a separate file. I would appreciate help on how to do... (8 Replies)
Discussion started by: PTL
8 Replies

7. Shell Programming and Scripting

Generate 10000 unique audio file of 2MB each using shell script.

Hi, I want 10000+ unique Audio file of approx 2MB each. How can i generate numerous audio files using shell script. Any tool, command or suggestions are welcome. If i give one audio seed file then can we create numerous unique files with same seed file? Any help is highly appreciable.... (11 Replies)
Discussion started by: sushil.kumar
11 Replies

8. Shell Programming and Scripting

How to create file and file content based existing information?

Hi Gurus, I am SQL developer and new unix user. I need to create some file and file content based on information in two files. I have one file contains basic information below file1 and another exception file file2. the rule is if "zone' and "cd" in file1 exists in file2, then file name is... (13 Replies)
Discussion started by: Torhong
13 Replies

9. UNIX for Beginners Questions & Answers

TCL script to extract the file name and then create two independent list

I am having one problem as stated below Problem Description I am having some "sv" extension files , I am using "glob" to extract the matching files , Now in these matching files , I need to split them and extract the elements and create different lists. For example set files This... (1 Reply)
Discussion started by: kshitij
1 Replies

10. UNIX for Beginners Questions & Answers

awk script to extract transcript information from gff3 file

I need help to extract transcript information from gff3 file. Here is the input Chr01 JGI gene 82773 86941 . - . ID=Potri.001G000900;Name=Potri.001G000900 Chr01 JGI mRNA 82793 86530 . - . ID=PAC:27047814;Name=Potri.001G000900.1;pacid=27047814;longest=1;Parent=Potri.001G000900... (6 Replies)
Discussion started by: Maduranga
6 Replies
DMAIL(1)						      General Commands Manual							  DMAIL(1)

NAME
dmail - procmail Mail Delivery Module SYNOPSIS
dmail [-D] [-f from_name] [-s] [-k keyword_list] [user][+folder] DESCRIPTION
dmail delivers mail to a user's INBOX or a designated folder. dmail may be configured as a drop-in replacement for binmail(1), mail.local(1) for use with a mail delivery filter such as procmail(1). Because of security considerations (see below) dmail is not intended to be used for direct delivery by the mailer daemon; tmail(1) is the preferred tool for this purpose. If dmail is used for mailer daemon delivery, the mailer daemon must invoke dmail with the dmail process' user id set to the recipient's user id. When dmail exits, it returns exit status values to enable procmail(1) to determine whether a message was delivered successfully or had a temporary (requeue for later delivery) or permanent (return to sender) failure. If the user name is present, it must be the same as the logged-in user name. If the +folder extension is included in the user argument (or appears by itself if there is no user argument), dmail will attempt to deliver to the designated folder. If the folder does not exist or the extension is not included, the message is delivered to the user's INBOX. If delivery is to INBOX and no INBOX currently exists, dmail will create a new INBOX. dmail recognizes the format of an existing INBOX or folder, and appends the new message in that format. The -D flag specifies debugging; this enables additional message telemetry. The -f or -r flag is used to specify a Return-Path. The header Return-Path: <from_name> is prepended to the message before delivery. The -s flag specifies that the message will be flagged as being "seen". The -k flag is used to specify delivery keywords, which are set on the message at delivery time if and only if the keywords are already defined in the mailbox. Multiple keywords can be specified by using a quoted string, e.g., dmail -k "$Junk Discard" +junkbox RESTRICTIONS
Absolute pathnames and ~user specifications are not permitted in +folder extensions. SECURITY CONSIDERATIONS
Unlike tmail you can use dmail to deliver to IMAP4 namespace names via +folder extensions. This means that it is possible to deliver to mh(1) format mailboxes. However, this can also include such namespaces as #shared, #public, and #ftp. In most cases, it is undesirable to allow anybody sending mail to the user to deliver to these namespaces. Consequently, there needs to be a rule in place in the configuration of either sendmail(8) or procmail(1) to prevent such abuse. AUTHOR
Mark Crispin, MRC@CAC.Washington.EDU SEE ALSO
binmail(1) procmail(1) June 18, 2007 DMAIL(1)
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy