Sponsored Content
Full Discussion: Print only match pattern
Top Forums Shell Programming and Scripting Print only match pattern Post 302908770 by ureddy on Thursday 10th of July 2014 08:41:01 AM
Old 07-10-2014
hi,

there are two cases here.
1. print the string which occurs more than once into seperate file
2. Print the string which occurs only once into seperate file

so need to capture the output into seperate files.

the above solutions all are capturing either one or more occurences of string to a single file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

match a pattern, print it and the next line

I have a file nbu_faq.txt (Question/answer) which looks like this What I am trying to do is write out each question in a file1.txt and than the question/answer in a file2.txt like this file1.txt Q: What is nbu? Q: What is blablabla...? Q: Why ....? file2.txt Q: What is nbu? A:... (4 Replies)
Discussion started by: nymus7
4 Replies

2. Shell Programming and Scripting

Use to awk to match pattern, and print the pattern

Hi, I know how to use awk to search some expressions like five consecutive numbers, , this is easy. However, how do I make awk print the pattern that is been matched? For example: input: usa,canada99292,japan222,france59664,egypt223 output:99292,59664 (6 Replies)
Discussion started by: grossgermany
6 Replies

3. Solaris

Using grep to print just the pattern match

Hi all, Is it possible for grep to output just the pattern match and not the whole line when it comes across a match? I know you can adjust the number of trailing or leading lines that are printed, but am yet to find anything that outputs just the pattern match. Cheers, Tim (5 Replies)
Discussion started by: muzzaw
5 Replies

4. Shell Programming and Scripting

match pattern 1 and print or match pattern 2 and print

hi all basically i have file called rules which contain lines like below /usr/bwmgr/utils/bwmgr em1 -x 735 -name user92 -addr 10.10.201.92 -addrmsk 255.255.255.252 -bwout 1024000 -bwin 2048000 -statsdevice user92 -stats /usr/bwmgr/utils/bwmgr em1 -x 45032 -name user246 -addr 10.10.224.246... (2 Replies)
Discussion started by: sb245
2 Replies

5. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

6. Shell Programming and Scripting

Script to match a pattern and print only the pattern and after that

Hi, I am writing a shell script to parse some files, and gather data. The data in the files is displayed as below. .......xyz: abz: ...... .......xyz: abz: ..... I have tried using awk and cut, bu the position of these values keep changing, so I can use awk and split it into columns. ... (14 Replies)
Discussion started by: Serena
14 Replies

7. UNIX for Dummies Questions & Answers

Match Pattern after certain pattern and Print words next to Pattern

Hi experts , im new to Unix,AWK ,and im just not able to get this right. I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
Discussion started by: 100bees
2 Replies

8. Shell Programming and Scripting

Print only next pattern in a line after a pattern match

I have 2013-06-11 23:55:14 1Umexd-0004cm-IG <= user@domain.com I need sed/awk operation on this, so that it should print the very next pattern only after the the pattern mach <= ie only print user@domain.com (7 Replies)
Discussion started by: anil510
7 Replies

9. Shell Programming and Scripting

Print occurrences for pattern match

Hi All, I want to print all the occurrences for a particular pattern from a file. The catch is that the pattern search is partial and if any word in the file contains the pattern, that complete word has to be printed. If there are multiple words matching the pattern on a specific line, then all... (2 Replies)
Discussion started by: decci_7
2 Replies

10. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
winicontoppm(1)                                               General Commands Manual                                              winicontoppm(1)

NAME
winicontoppm - convert a Windows .ico file into 1 or more portable pixmap files SYNOPSIS
winicontoppm [-writeands] [-allicons|-bestqual] [-multippm] [-verbose] [iconfile] [ppmdestfile] DESCRIPTION
Reads a Microsoft Windows .ico file, converts it to one or more ppms. A Windows icon contains 1 or more images, at different resolutions and color depths. Each image has an 'and' mask, which contains transparancy data. By default, the output goes to Standard Output. If you specify ppmdestfile, output goes into one or more files named as follows. If it's just one file (i.e. you specify the -multippm option or don't specify -allicons), the file specification is ppmdestfile.ppm. If it's mul- tiple files, their file specifications are ppmdestfile_1.ppm, ppmdestfile_2.ppm, etc. When you specify the -writeands option, the filenames above are modified to include the string xor as in ppmdestfile_xor.ppm or ppmdest- file_xor_1.ppm. winicontoppm can convert images with 1, 4, 8, 24 or 32 bits per pixel (bpp). OPTIONS
-writeands For each icon written, also write the 'and' (transparancy) mask as a seperate PBM file. It's name is of the form ppmdest- file_and.pbm or ppmdestfile_and_1.pbm. -allicons Extract all images from the .ico file. -bestqual Extract only the best quality (largest, then highest bpp) image from the .ico file. -multippm Write all ppms to a single file. SEE ALSO
ppmtowinicon(1), ppm(5) AUTHOR
Copyright (C) 2000, 2003 by Lee Benfield. 22 May 2000 winicontoppm(1)
All times are GMT -4. The time now is 06:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy