Sponsored Content
Full Discussion: fgrep command
Top Forums Shell Programming and Scripting fgrep command Post 302382303 by morbid_angel on Wednesday 23rd of December 2009 02:15:32 AM
Old 12-23-2009
fgrep command

How can we use fgrep command to search pattern on perticular field on a file.
eg : I have a parren file having format
cat patternfile
SPA16S199982
SPA5S26330

I want to seach these pattern on FIRST field of File2(since other field has
same data) and that too maching entirely.

cat File2
SPA16S199982P|Diamond Necklace|SPA16S199982|1
SPA16S199982|Diamond Necklace|SPA16S199982|1
SPA5S26330|Diamond Necklace|SPA16S199982|1


Desired O/p
----------
SPA16S199982|Diamond Necklace|SPA16S199982|1
SPA5S26330|Diamond Necklace|SPA16S199982|1

The command that i am using is fgrep -f -x patternfile File2. How to modify this command for grepping on first column.


Thanxx in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

fgrep

Hi Guys, Can anyone explain why I'm getting error below? when I execute in other server there is no error, what could be the reason. $ fgrep -f timecell.txt ldap_prev.dat wordlist too large $ wc -l timecell.txt ldap_prev.dat 372461 timecell.txt 3722878 ldap_prev.dat Thanks in... (2 Replies)
Discussion started by: krishna
2 Replies

2. UNIX for Dummies Questions & Answers

Usage of fgrep -f command in kshell

Hi, Can I know the usage of fgrep -f command in kshell. Reqirement: Need to search for list of patterns in list of files and display all the files which are having atleast one in the patterns list. I hope fgrep -f will serve this purpose within a loop. But I am not successfull in doing this.... (0 Replies)
Discussion started by: divv
0 Replies

3. UNIX for Dummies Questions & Answers

FGREP question

Hi, I need fgrep to search all files in the subdirectories in /var/spool/postfix/defer/... How can I issue such a command? (3 Replies)
Discussion started by: mojoman
3 Replies

4. Shell Programming and Scripting

fgrep to file plus some

Hi, I know that I can grep desired data to a file but is there a way to add an additional field of data to the output in addition to what is found. I want to add a login id to the data that is found in the grep. Is this even possible? Thanks for your help. Toni (14 Replies)
Discussion started by: ski
14 Replies

5. Shell Programming and Scripting

Awk Vs Fgrep

Hi All, I have 2 files new.txt and old.txt cat new.txt sku1|v1|v2|v3 sku2|v11|v22|v33 sku3|v11|v22|v33 cat old.txt sku1|vx1|vx2|vx3 sku2|vx11|vx22|vx33 sku3|v11|v22|v33 The key column in both files are first column itself. I want to get records in... (6 Replies)
Discussion started by: morbid_angel
6 Replies

6. Shell Programming and Scripting

Problem in Using fgrep Command with pattern file option

Hi, i am using fgrep command with following syntax fgrep -v -f pattern_file_name file file contains few line and have the pattern which i am giving in pattern file. My Problem is : its is not giving any output. while i am using fgrep -f pattern_file_name file it is showing all... (4 Replies)
Discussion started by: emresearch
4 Replies

7. Shell Programming and Scripting

Pipe and fgrep

Hi , Please help me resolve the below issue. I need to combine the below two command into one. grep 'ImanItemP' import.report| tr -s ' ' | cut -f2 -d ' ' > tmp.txt fgrep -v -f tmp.txt input.txt > reuired file.txt Thanks Ramesh (4 Replies)
Discussion started by: ramesh12621
4 Replies

8. Shell Programming and Scripting

fgrep command: Perl programming help needed..Kindly advise

Hi, I am novice in PERL enviornment. I have a text files withso many entries in rows and columns. I have to pick up entries named as "Uniprot ID" in the file and create a new text file with list of particular Uniprot ID entries. Can anybody guide regarding this.. I came to know abut fgrep... (1 Reply)
Discussion started by: manigrover
1 Replies

9. UNIX for Dummies Questions & Answers

Fgrep -v

Using the fgrep command with the -v option. I have two files: file1: dog 1 cat 3 bird 5 fish 7file2: dog catUsing fgrep -v file2 file1 According to the fgrep man page, the output should be bird5 fish 7 but I can't seem to get it to work. Any help would be appreciated. (2 Replies)
Discussion started by: jimmyf
2 Replies

10. UNIX for Advanced & Expert Users

Need to use fgrep and egrep in a single command

I have a source file which is something like : C/*M/ / ***HMACCT ** MONTH FOR CURRENT MINUS 14 CAL DAY C/*D/ / ***HMACCT ** DAY FOR CURRENT MINUS 14 CAL DAY C/*X/ / ***HMACCT ** CENTURY FOR CURRENT MINUS 14 CAL DAY C/*Y/ / ***HMACCT **... (5 Replies)
Discussion started by: gotamp
5 Replies
URIO(4) 						   BSD Kernel Interfaces Manual 						   URIO(4)

NAME
urio -- USB driver for the Rio MP3 players SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device urio Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): urio_load="YES" DESCRIPTION
The urio driver provides support for Rio MP3 players from Diamond MultiMedia which attaches to the USB port. The urio device must be config- ured in the kernel, along with usb and one of the uhci or ohci controllers. Subsequently, the /dev/urio0 device can be used by the Rio userland applications. HARDWARE
The following devices are supported by the urio driver: o Diamond MultiMedia Rio 500 o Diamond MultiMedia Rio 600 o Diamond MultiMedia Rio 800 FILES
/dev/urio0 blocking device node EXAMPLES
The following line in the kernel configuration file adds the urio driver to the kernel: device urio To download a song over the USB connection into the Rio using the rio_add_song(1) utility (see the SEE ALSO section): rio_add_song /usr/local/MP3/TracyChapman/02-Fast-Car.mp3 SEE ALSO
ohci(4), uhci(4), usb(4) The Rio 500 SourceForge Project Web Page, http://rio500.sourceforge.net/. The Rio500 tools from SourceForge are the actual userland tools used to download, format or rename songs on players. When compiling these tools, the following pre-build configuration command will ensure that rio_usb.h is available in the include path and that the device used is /dev/urio0: CFLAGS="-I/usr/include/dev/usb" ./configure --with-devicepath='/dev' --with-deviceentry='urio0' AUTHORS
The urio driver was written by Iwasa Kazmi <kzmi@ca2.so-net.ne.jp> for FreeBSD. This manual page was written by Dirk-Willem van Gulik <dirkx@webweaving.org>. BSD
November 22, 2006 BSD
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy