Sponsored Content
Operating Systems Linux Search multiple pattern from list Post 302928157 by rajivrsk on Tuesday 9th of December 2014 12:01:04 PM
Old 12-09-2014
Search multiple pattern from list

I am working on AIX operating system.


I want to search list of Article Id for given Set Date (which are present in a seperate file input.txt)

art_list.csv
------------
Code:
"Article ID"        |"Ad Description"     |"Pyramid"|"Pyramid Desc "|"ProductTypeId"|"Set Date  "|
"000000000010000000"|"christmas sales    "|"300010 "|"MISCELLANEOUS"|"40000085     "|"10/22/2013"|
"000000000010000000"|"Thanks giving sales"|"300010 "|"MISCELLANEOUS"|"40000085     "|"04/22/2013"|
"000000000010000008"|"description for ad "|"300006 "|"GROCERY AND C"|"40000033     "|"10/22/2013"|
"000000000010000009"|"asdfdffdfdfdfdfdffd"|"300006 "|"GROCERY AND C"|"40000033     "|"10/22/2013"|
"000000000010000569"|"xxxxxxxxxxxxxxxxxxx"|"300006 "|"GROCERY AND C"|"40000033     "|"09/26/2014"|
"000000000010000001"|"christmas sales    "|"300010 "|"MISCELLANEOUS"|"40000085     "|"10/22/2013"|
"000000000010000016"|"Thanks giving sales"|"300010 "|"MISCELLANEOUS"|"40000085     "|"05/17/2013"|
"000000000010000038"|"description for ad "|"300006 "|"GROCERY AND C"|"40000033     "|"08/11/2013"|
"000000000010000009"|"asdfdffdfdfdfdfdffd"|"300006 "|"GROCERY AND C"|"40000033     "|"10/22/2013"|
"000000000010000569"|"xxxxxxxxxxxxxxxxxxx"|"300006 "|"GROCERY AND C"|"40000033     "|"10/26/2013"|


input.txt
---------

Code:
10000000, 10/22/2013
10000569, 09/26/2014
10000038, 08/11/2013


Expected output is
Code:
"000000000010000000"|"christmas sales    "|"300010 "|"MISCELLANEOUS"|"40000085     "|"10/22/2013"|
"000000000010000569"|"xxxxxxxxxxxxxxxxxxx"|"300006 "|"GROCERY AND C"|"40000033     "|"09/26/2014"|
"000000000010000038"|"description for ad "|"300006 "|"GROCERY AND C"|"40000033     "|"08/11/2013"|


Last edited by Don Cragun; 12-09-2014 at 05:14 PM.. Reason: Add CODE tags.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pattern search in multiple lines

Hi, I have to search those statements from the file which starts from "shanky"(only shanky, shanky09 or 09shanky is not allowed) and ends with ");". These two string can be in a same line or different line. And also i have to negate those lines which starts with #. Can any one please give me... (2 Replies)
Discussion started by: shanky09
2 Replies

2. Shell Programming and Scripting

pattern search for multiple log files and counting

I have 10 appservers and each appserver has 4 jvms . Each of these logs is archived and stored on a nfs directory . For example the files are /logs/200907/ap1-jvm1.server.log.20090715.gz /logs/200907/ap2-jvm2.server.log.20090714.gz /logs/200908/ap1-jvm1.server.log.20090812.gz I want to... (3 Replies)
Discussion started by: gubbu
3 Replies

3. Shell Programming and Scripting

Multiple pattern search in perl

user 10 values content is: musage.py yes value user 11 values content is: gusage.py yes value how to print "user" string line by searching "content is:" string and "usage.py" string in perl (8 Replies)
Discussion started by: Anjan1
8 Replies

4. Shell Programming and Scripting

Help need with PERL multiple search pattern matching!

My example file is as given below: conn=1 uid=oracle conn=2 uid=db2 conn=3 uid=oracle conn=4 uid=hash conn=5 uid=skher conn=6 uid=oracle conn=7 uid=mpalkar conn=8 uid=anarke conn=9 uid=oracle conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5 conn=2... (3 Replies)
Discussion started by: sags007_99
3 Replies

5. Shell Programming and Scripting

Multiple search pattern

Hello :) I have this file cat employee_list Name : jack Gender: m ID : 4512 DOB : 03/27/1980 hire date : 04/23/2012 Nationality: US marital status : single ===================== Name : mick Gender: m ID : 1256 DOB : 03/27/1970 Hire date : 012/10/2011 Nationality: US Marital... (4 Replies)
Discussion started by: Sara_84
4 Replies

6. Homework & Coursework Questions

sed Multiple Pattern search and delete the line

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have file which has got the following content sam 123 LD 41 sam 234 kp sam LD 41 kam pu sam LD 61 Now... (1 Reply)
Discussion started by: muchyog
1 Replies

7. Shell Programming and Scripting

awk with multiple pattern search

Want to fetch a column with multiple pattern using awk. How to achieve the same. Tried cat test address : 10.63.20.92/24 address : 10.64.22.93/24 address : 10.53.40.91/24 cat test | awk '{print $3}' |awk -F "/" '{print $1}' 10.63.20.92 10.64.22.93 10.53.40.91 Is there any... (2 Replies)
Discussion started by: Manasa Pradeep
2 Replies

8. Shell Programming and Scripting

Search multiple pattern in a file

I have a sample file with following output: HTTP/1.1 200 OK User: admin Set-Cookie: AMBARISESSIONID=y3v3648yqcno32nq478kw7ar;Path=/;HttpOnly Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/plain Vary: Accept-Encoding, User-Agent Content-Length: 6057 Server:... (4 Replies)
Discussion started by: saurau
4 Replies

9. Shell Programming and Scripting

Pattern search multiple files

#!/usr/bin/ksh a="Run successfully" cd $APPS ls -l *.txt | while read $txt do if then cp $APPS/$txt cp $hist/$txt else rm $APPS/$txt echo "Files has been removed" fi done New in shell script please help me out Around 100 txt files in $APPS dir i want to search pattern from... (8 Replies)
Discussion started by: Kalia
8 Replies
PROCESSCSV.PY(1)					      Virtualization Support						  PROCESSCSV.PY(1)

NAME
processcsv.py - process virt-top CSV files SUMMARY
virt-top --csv data.csv processcsv.py < data.csv DESCRIPTION
virt-top is a top(1)-like utility for showing stats of virtualized domains. processcsv.py is a simple Python script that post-processes the output of "virt-top --csv". It is used like this: virt-top --csv data.csv processcsv.py < data.csv The second command will overwrite the following files in the current directory: "global.csv" This contains the global (host) statistics columns from the CSV file. "domainNN.csv" (multiple files) For each libvirt domain ID NN, a file is created containing the per-domain statistics from the CSV file. SEE ALSO
virt-top(1) AUTHORS
Richard W.M. Jones <rjones @ redhat . com> COPYRIGHT
(C) Copyright 2007-2012 Red Hat Inc., Richard W.M. Jones http://libvirt.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. virt-top-1.0.8 2013-12-29 PROCESSCSV.PY(1)
All times are GMT -4. The time now is 05:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy