11-06-2012
Help searching for patterns occuring near one another in document
I'm very new to unix and linux, so I apologize if the answer to this question should be obvious..
What I would like to know is, is there a way to search a text document ( opened in less, or some other text viewer) for any two or more patterns that appear near one another in the document?
In other words, if both strings appear in the document, but they are separated by too many characters, a match would not be returned, however, if they are within a certain number of characters from each other, they will be selected.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how can I search for two or more patterns in one line using grep?
for example if I want to show only the lines that have patterns "abc" and "123"?
and what if I want to show only the lines that have either "abc" or "123" in them?
any hint apprecited (4 Replies)
Discussion started by: metalwarrior
4 Replies
2. Shell Programming and Scripting
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies
3. Shell Programming and Scripting
I have a situation where I need to search for multiple strings (error messages) such as 'aborted' 'file not found' etc in directory having logs. I have put all the error messages in a text file and using the command.
grep -f <textfile> <filetobegrepped>
I'm doing this thru a script where I... (5 Replies)
Discussion started by: bornon2303
5 Replies
4. UNIX for Dummies Questions & Answers
I need a script that reads only printable characters (no duplicates) from all files in a directory and output them in a text file. (2 Replies)
Discussion started by: l20N1N
2 Replies
5. Shell Programming and Scripting
Hi All,
I have a file in which i have to search for a pattern from the beginning of the file and if the pattern is found , then i have to perform a reverse search from that line to the beginning of the file to get the first occurrence of another pattern.
sample input file
hey
what are you... (8 Replies)
Discussion started by: Kesavan
8 Replies
6. Shell Programming and Scripting
Hi
I am having a file like this
FILE1
#####################
C16ROTINV_
REFCLK_RXL
RXBCLK32_R
REFCLK_TXL
CLK8_TXLIN
RXBCLK32_R
DCLK_TXLIN
CLK32D_TXL
RXACLK32_R
##################### (3 Replies)
Discussion started by: jaita
3 Replies
7. Shell Programming and Scripting
Hi,
I have code like:
Output it is comming as:
Rels: WM2
Rels: WG2
Rels: 5
- pre/prods.pl
Rels: 6
Rels: 7
Rels: 8
Rels: 10
Rels: Int
But i want only "Rels: 5" pattern Just above "- pre/prods.pl".
By... (7 Replies)
Discussion started by: Anjan1
7 Replies
8. Shell Programming and Scripting
Hi,
I am having an '.xml' file with 'n' number of lines and also having another file with '.txt' format contains values which i want to search.
Now I want to print the next line with the pattern which i am searching in '.xml' file. And the loop has to repeat for different patterns which... (5 Replies)
Discussion started by: tejastrikez
5 Replies
9. Shell Programming and Scripting
Hello,
I have the following input file:
qh1adm 20130710111201 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ
qh1adm 20130711151154 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ
qx1adm 20130711151154 : tp count QX1 u6 -Dsourcesystems=B17,E17,EE7
qh1adm 20130711151155 : tp import all... (7 Replies)
Discussion started by: kcboy
7 Replies
10. Shell Programming and Scripting
Hello,
I have attached 2 files
1) Original_table_definition.txt => which has definition of 3 tables
2) describe_table_output.txt => which has again 3 tables definition gotten thorugh doing a show table or describe table way.
Now difference between 3 tables are that tablea has no... (2 Replies)
Discussion started by: nv186000
2 Replies
LEARN ABOUT OPENSOLARIS
pdf2dsc
PDF2DSC(1) Ghostscript Tools PDF2DSC(1)
NAME
pdf2dsc - generate a PostScript page list of a PDF document
SYNOPSIS
pdf2dsc input.pdf [ output.dsc ]
DESCRIPTION
pdf2dsc uses gs(1) to read an Adobe Portable Document Format (PDF) document "input.pdf" and create a PostScript(tm) document "output.dsc"
that conforms to Adobe's Document Structuring Conventions (DSC) requirements.
This new document simply tells Ghostscript to read the PDF file and to display pages one at a time. The generated document can then be
viewed with any PostScript viewer based on Ghostscript, like ghostview(1) on Unix or GSview on Windows, with which the user can browse
through the pages of the PDF document in any order.
If no output file is named on the command line, the name of the output file is that of the input file with any extension removed, followed
by the extension ".dsc".
CAVEATS
The DSC document uses Ghostscript-specific procedures. In addition, the original PDF document must be accessible when the DSC document is
processed.
You need the file "pdf2dsc.ps" (originally by Russell Lang) supplied with Ghostscript since release 3.53.
SEE ALSO
gs(1), ghostview(1)
VERSION
This document was last revised for Ghostscript version 8.63.
AUTHOR
Yves Arrouye <yves.arrouye@usa.net> and Russell Lang gsview at ghostgum.com.au
8.63 1 August 2008 PDF2DSC(1)