Sponsored Content
Top Forums Shell Programming and Scripting awk - fetch multiple data from huge dump Post 302884137 by MadeInGermany on Friday 17th of January 2014 03:16:02 PM
Old 01-17-2014
Some RE implementations are slow in certain locales.
Then it helps to switch to C locale:
Code:
export LC_ALL=C

In your case it can also help to switch from egrep to fgrep.
Further, your example exactly matches one field, then maybe this awk script is faster (an improvement of the previous post):
Code:
awk -F"|" 'FNR==NR {A[$1]; next} {for (i=1;i<=NF;i++) if ($i in A) {print; next}}' pattern dump

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fetch selected data from webpage

Hi All, Can anybody tell me the command used for extracting some selected lines from a web-page. I guess we'll have to do this using wget or Curl to achieve this.... If anbody has any idea abt it, kindly post your reply ASAP. Thanks. (1 Reply)
Discussion started by: sunnydynamic15
1 Replies

2. Shell Programming and Scripting

fetch data between two timestamp using script

Hi Guys, I have the data in below format. 25 Dec 2011 03:00:01 : aaaaaaaaaaaaaaa 25 Dec 2011 04:23:23 : bbbbbbbbbbbbbbb 25 Dec 2011 16:12:45 : ccccccccccccccc 26 Dec 2011 04:45:34 : ddddddddddddddd 26 Dec 2011 17:01:22 : eeeeeeeeeeeeeee 27 Dec 2011 12:33:45 : ffffffffffffffffffffffff 28... (13 Replies)
Discussion started by: jaituteja
13 Replies

3. Shell Programming and Scripting

Awk to Count Multiple patterns in a huge file

Hi, I have a file that is 430K lines long. It has records like below |site1|MAP |site2|MAP |site1|MODAL |site2|MAP |site2|MODAL |site2|LINK |site1|LINK My task is to count the number of time MAP, MODAL, LINK occurs for a single site and write new records like below to a new file ... (5 Replies)
Discussion started by: reach.sree@gmai
5 Replies

4. Shell Programming and Scripting

Fetch data from a particular location

I want to fetch value from a particular location from a file but in each line in the file it appears at a different position so i tried using variable with cut command but it is not working properly. The code i have written is #!/bin/sh cat Sri1.log | while read d2 do grep -w... (9 Replies)
Discussion started by: Prachi Gupta
9 Replies

5. UNIX for Dummies Questions & Answers

how to fetch data in unix

Hi All, I have a file with the below data as shown. A|2|20120430 B|EMP|NAME|DEPT C|12|SARC|01 C|23||ASDD|02 D|END OF FILE I want to fetch only the records that contains C|, what is unix command to fetch this data. Thanks (5 Replies)
Discussion started by: halpavan2
5 Replies

6. Shell Programming and Scripting

Help Need to fetch the required data

Hi Guys, Am in need of your help one more time on my real data. I have a file which contains more than thousand lines of data Live data shown for 4 iterations. We have more than thousand lines of data:- -------------------------------------------------------------------------- ... (4 Replies)
Discussion started by: rocky2013
4 Replies

7. Shell Programming and Scripting

awk does not work well with huge data?

Dear all , I found that if we work with thousands line of data, awk does not work perfectly. It will cut hundreds line (others are deleted) and works only on the remain data. I used this command : awk '$1==1{$1="Si"}{print>FILENAME}' coba.xyz to change value of first column whose value is 1... (4 Replies)
Discussion started by: ariesto
4 Replies

8. Shell Programming and Scripting

Need to fetch only selected data in CSV

Hi Team, I m getting my script commands output like given below GETA-TILL-INF; U-UU-YRYT-NOD-6002 2015-05-14 THU 19:44:10 C2221 RETRIEVE TILL INFORMATION : COMPLD ---------------------------------------------------------------------- CONNECT_CARD_ID ... (9 Replies)
Discussion started by: Ganesh Mankar
9 Replies

9. Shell Programming and Scripting

Fetch data from file

Hi, I am new to scripting. I have a log file and need to fetch specific logs and copy to another file. A copy of the log is like this: =============================================================== = JOB : server123#jobs1.jobstream1 = USER : andyc = Tue 08/01/17... (3 Replies)
Discussion started by: Prngp
3 Replies

10. UNIX for Advanced & Expert Users

Need Optimization shell/awk script to aggreagte (sum) for all the columns of Huge data file

Optimization shell/awk script to aggregate (sum) for all the columns of Huge data file File delimiter "|" Need to have Sum of all columns, with column number : aggregation (summation) for each column File not having the header Like below - Column 1 "Total Column 2 : "Total ... ...... (2 Replies)
Discussion started by: kartikirans
2 Replies
FDM(1)							    BSD General Commands Manual 						    FDM(1)

NAME
fdm -- fetch and deliver mail SYNOPSIS
fdm [-hklmnqv] [-a account] [-D name= value] [-f conffile] [-u user] [-x account] [fetch | poll] DESCRIPTION
The fdm program fetches mail from a POP3 or IMAP server or from stdin and delivers it based on a ruleset in the configuration file. The options are as follows: -a name Process only the specified account. This option may appear multiple times. The account name may include shell glob characters to match multiple accounts. -D name=value This option defines a macro for use when parsing the configuration file. The macro name must be prefixed with $ or % to specify a string or numeric macro. This option may appear multiple times. -f conffile Specify the configuration file location. Default is ~/.fdm.conf, or /etc/fdm.conf if that doesn't exist. -h Look at the HOME environment variable to ascertain the user's home directory. -k Keep all mail after delivery, regardless of whether it matches a drop action. Note that mails kept in this way will be refetched by fdm if it is run again on the same account. -l Log using syslog(3) rather than to stderr. -m Ignore the lock file and run regardless of other instances of fdm. -n Do not process any accounts, just verify the configuration file syntax and exit. -q Quiet mode. Only print errors. -u user Specify the default user for delivery. This overrides the default-user option in the configuration file. -v Request verbose logging. This option may be specified multiple times. -vv will print information on configuration (useful with -n). -vvvv duplicates all traffic to and from remote servers to stdout. This feature is disabled when using the -l flag. -x name Exclude the named account. Multiple -x options may be specified. As with -a, shell glob characters may be used. fetch | poll | cache The fetch command instructs fdm to fetch and deliver messages. The poll command polls the accounts in the configuration file and reports a message count for each. cache allows fdm cache files to be manipulated: see the next section. CACHE COMMANDS
The following cache manipulation commands are supported: cache add path string cache remove path string Add or remove string as a key in the cache at path. cache list [path] List the number of keys in the specified cache, or if path is omitted, in all caches declared in the configuration file. cache dump path Dump the contents of the cache path to stdout. Each key is printed followed by a space and the timestamp as Unix time. cache clear path Delete all keys from the cache at path. FILES
~/.fdm.conf default fdm configuration file /etc/fdm.conf default system-wide configuration file ~/.fdm.lock default lock file /var/db/fdm.lock lock file for root user SEE ALSO
mail(1), fdm.conf(5), sendmail(8) AUTHORS
Nicholas Marriott <nicm@users.sourceforge.net> BSD
December 22, 2008 BSD
All times are GMT -4. The time now is 04:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy