Sponsored Content
Top Forums Shell Programming and Scripting Create shell script to extract unique information from one file to a new file. Post 302545635 by ravi san on Tuesday 9th of August 2011 03:17:29 AM
Old 08-09-2011
create shell script to extract unique information from one file to a new file

Quote:
Originally Posted by ravi san
Dear Mr 47,

Please try this simple code for retrieving unique information.

Code:
 
gzip -d http.log.20110808.gz ;cut -d " " -f9  http.log.20110808 |uniq > http.log.20110808_updated

This User Gave Thanks to ravi san For This Post:
 

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
mailutil(1)						      General Commands Manual						       mailutil(1)

NAME
mailutil - mail utility program SYNTAX
mailutil command [switches] [arguments] All commands accept the -d, -v, and -u switches in addition to any command-specific switches. mailutil check [MAILBOX] mailutil create MAILBOX mailutil delete MAILBOX mailutil rename SOURCE DESTINATION mailutil copy [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil move [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil append [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil appenddelete [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil prune MAILBOX CRITERIA mailutil transfer [-m mode] [-rw] [-kw] [-ig] SOURCE DESTINATION DESCRIPTION
mailutil replaces the old chkmail, imapcopy, imapmove, imapxfer, mbxcopy, mbxcreat, and mbxcvt programs. mailutil check determines whether new mail exists in the given mailbox (the default is INBOX). The number of new messages is defined as the number of messages that have "Recent" status set. If the mailbox contains no new messages, mailutil check will indicate that no new mail is present; otherwise, it will report the number of new messages. In either case, it will also indicate the canonical form of the name of the mailbox. mailutil create creates a new mailbox with the given name. The mailbox name must not already exist. A mailbox can be created in a particular format by prefixing the name with #driver. followed by the format name and a / character. For example, the command mailutil create #driver.mbx/junkmail will create a new mailbox named "junkmail" in mbx format. mailutil delete deletes an existing mailbox with the given name. mailutil rename renames an existing mailbox to a new name (which must not already exist). This only works if the old and new names are in the same mail store. A more general means to rename a mailbox is to do a mailutil copy of the old name to the new name, followed by a mailutil delete of the old name. mailutil copy creates a new mailbox and copies messages from the old mailbox to the new mailbox. As in mailutil create a mailbox format can be specified with the new mailbox. For example, the command mailutil copy INBOX #driver.mbx/INBOX will copy messages from your existing INBOX to an mbx-format INBOX. mailutil move is similar to mailutil copy but in addition will also remove (delete and expunge) the messages from the old mailbox after copying them to the new mailbox. mailutil append and mailutil appenddelete are similar to mailutil copy and mailutil move respectively except that they do not create the destination mailbox. mailutil prune prunes the mailbox of messages which match certain criteria, which are in the form of IMAP2 (RFC 1176) SEARCH arguments. For example, the command. mailutil prune INBOX "before 1-jan-2004" will delete and expunge all messages written before January 1, 2004. Note that mailutil implements pruning by deleting the matching messages, and then expunging the mailbox. Consequently, mailutil will also expunge any messages which were deleted at the time of the pruning. mailutil transfer copies an entire hierarchy of mailboxes from the named source to the named destination. Mailboxes are created on the destination as needed. Any error in copying messages will cause the transfer to stop. Normally, any error in creation will cause the transfer to stop. However, if -m MODE or -merge MODE is specified, a merging transfer is performed. The MODE argument indicats the type of merge: -m[erge] prompt indicates that the user should be asked for an alternative name to create. If creating the new name fails, the user will be asked again. -m[erge] append indicates that it's alright to copy the messages into an existing mailbox with that name. If the mailbox does not exist, the user will be prompted for an alternative name. -m[erge] suffix=XXXX where XXXX is any string, indicates that an alternative name should be built by appending the given suffix to the name. It that alternative name can't be created, then the user will be prompted for an alternative name. The source hierarchy consists of all mailboxes which start with the given source name. With the exception of a remote system specification (within "{}" braces), the source name is used as the name of the destination. The destination hierarchy is a prefix applied to any new names being created. For example, mailutil transfer foo bar will copy all mailboxes with names beginning with "foo" to names beginning with "bar" (hence "foobar" will be copied to "barfoobar"). Similarly, mailutil transfer "{imap.foo.com}" "{imap.bar.com}old/" will copy all mailboxes from the imap.foo.com IMAP server to equivalent names starting with "old/" on the imap.bar.com IMAP server. FLAGS
The -d or -debug flag prints full debugging telemetry including protocol operations. The -v or -verbose flag prints verbose (non-error) telemetry. The -u USERID or -user USERID switch attempts to become the indicated user. This is for the benefit of system administrators who want to do mailutil operations on a userid that does not normally have shell access. The -rw or -rwcopy flag causes the source mailbox to be open in readwrite mode rather than readonly mode. Normally, mailutil tries to use readonly mode to avoid altering any flags in the source mailbox, but some mailbox types, e.g. POP3, can't be open in readonly mode. The -kw or -kwcopy flag causes the keywords of the source mailbox to be created in the destination mailbox. Normally, mailutil does not create keywords in the destination mailbox so only those keywords that are already defined in the destination mailbox will be preserved. Note that some IMAP servers may automatically create keywords, so this flag may not be necessary. The -ig or -ignore flag causes the keywords of the source mailbox to be ignored completely and no attempt is made to copy them to the destination mailbox. The -ig[nore] and -kw[copy] flags are mutually exclusive. ARGUMENTS
The arguments are standard c-client mailbox names. A variety of mailbox name formats and types of mailboxes are supported by c-client; examples of the most common forms of names are: Name Meaning INBOX primary incoming mail folder on the local system archive/tx-project mail folder named "tx-project" in "archive" subdirectory of local filesystem home directory {imapserver.foo.com}INBOX primary incoming mail folder on IMAP server system "imapserver.foo.com" {imapserver.foo.com}archive/tx-project mail folder named "tx-project" in "archive" subdirectory on IMAP server system "imapserver.foo.com" #news.comp.mail.misc newsgroup "comp.mail.misc" on local filesystem {newserver.foo.com/nntp}comp.mail.misc newsgroup "comp.mail.misc" on NNTP server system "newserver.foo.com" {popserver.foo.com/pop3} mail folder on POP3 server system "popserver.foo.com" See your system manager for more information about the types of mailboxes which are available on your system. RESTRICTIONS
You must surround a {host}mailbox argument with quotation marks if you run mailutil from csh(1) or another shell for which braces have special meaning. You must surround a #driver.format/mailbox argument with quotation marks if you run mailutil from a shell in which "#" is the comment character. AUTHOR
Mark Crispin, MRC@Washington.EDU March 3, 2008 mailutil(1)
All times are GMT -4. The time now is 04:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy