Sponsored Content
Top Forums Shell Programming and Scripting Print word 1 in line 1 and word 2 in line 2 if it matches a pattern Post 302349072 by bangaram on Monday 31st of August 2009 04:16:18 AM
Old 08-31-2009
Quote:
Originally Posted by protocomm
Rather this...

Code:
awk '{ORS=""} /MATCH1/||/MATCH2/ {print $3,","}' file


Thanks for this,But it will only Print word2 ,i i need IMAGE from MATCH1

the abv o/p will come like....

word2,word2,word2..
i need

IMAGE,word2,word2

sorry if i am not clear
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print next line if matches a particular word..need help

Hi i need a help for making a script whch can print next line if it matches a particular word like file1 have ename Mohan eid 2008 ename Shyam eid 345 if scipt got Mohan it will print next line (eid 2008) pls help me .......:) (2 Replies)
Discussion started by: anish19
2 Replies

2. Shell Programming and Scripting

Print line if first Field matches a pattern

Hi All, I would like my code to be able to print out the whole line if 1st field has a dot in the number. Sample input and expected output given below. My AWK code is below but it can;t work, can any expert help me ? Thanks in advance. {if ($1 ~ /*\.*/) { print $0 }} Input: ... (2 Replies)
Discussion started by: Raynon
2 Replies

3. Shell Programming and Scripting

Search word in a line and print earlier pattern match

Hi All, I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input. Search for: word1.word2 (Which procedure contain this word, I need procedure name in output. Expected output: procedure test1 procedure test2 procedure test3 procedure test4 ... (7 Replies)
Discussion started by: susau_79
7 Replies

4. Shell Programming and Scripting

Using awk to print line starting with particular word

Hi Geeks, Consider this line: driver=c:\folder1\folder2 The above line is contained in a variable say 'var' . I want to copy everything after 'driver=' in to another variable say var2. Please tell me how can this be done. (8 Replies)
Discussion started by: ajincoep
8 Replies

5. Shell Programming and Scripting

copy line to new file if word matches

I'm drawing blank on this. The log file I have is filled with garbage, but the important lines are ##/##/### Installation xxxxxxx So, I want to sed the line to a new file IF the word installation is in it. I tried removing none matching lines sed 's/Installation/,//!d' infile > outfile but that... (3 Replies)
Discussion started by: dba_frog
3 Replies

6. Shell Programming and Scripting

How to print last word of line

Hi, How to print last word of line? #!/bin/bash x1="This is Kiran" echo "$x1" how to print "Kiran" in new variable.i.e x2=kiran (7 Replies)
Discussion started by: kiran_j
7 Replies

7. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

8. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

9. Shell Programming and Scripting

Read a File line by line and split into array word by word

Hi All, Hope you guys had a wonderful weekend I have a scenario where in which I have to read a file line by line and check for few words before redirecting to a file I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Discussion started by: Kingcobra
6 Replies

10. Shell Programming and Scripting

Find word in a line and output in which line the word occurs / no. of times it occurred

I have a file: file.txt, which contains the following data in it. This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt My name is not Karl, my name is Karl Joey What is your name? Do you know your name and... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies
SWISH-E(1)						       SWISH-E Documentation							SWISH-E(1)

NAME
Swish-e - A Search Engine SYNOPSIS
swish [-e] [-i dir file ... ] [-S system] [-c file] [-f file] [-l] [-v (num)] swish -w word1 word2 ... [-f file1 file2 ...] [-P phrase_delimiter] [-p prop1 ...] [-s sortprop1 [asc|desc] ...] [-m num] [-t str] [-d delim] [-H (num)] [-x output_format] swish -k (char|*) [-f file1 file2 ...] swish -M index1 index2 ... outputfile swish -N /path/to/compare/file swish -V See the the SWISH-RUN(1) man page for details on run-time options. DESCRIPTION
Swish-e is Simple Web Indexing System for Humans - Enhanced. Swish-e can quickly and easily index directories of files or remote web sites and search the generated indexes. Swish-e is extremely fast in both indexing and searching, highly configurable, and can be seamlessly integrated with existing web sites to maintain a consistent design. Swish-e can index web pages, but can just as easily index text files, mailing list archives, or data stored in a relational database. Swish is designed to index small to medium sized collection of documents, Although a few users are indexing over a million documents, typi- cal usage is more often in the tens of thousands. Currently, Swish-e only indexes eight bit character encodings. DOCUMENTATION
Documentation is provided as HTML pages installed in $prefix/share/doc/swish-e where $prefix is /usr/local if building from source, or /usr if installed as part of a package from your OS vendor. Under Windows $prefix is selected at installation time. Documentation is also available on-line at http://swish-e.org. A subset of the documentation is installed as system man pages as well. The following man pages should be installed: swish-e(1) This man page. SWISH-CONFIG(1) Defines options that can be used in a configuration file. SWISH-RUN(1) Describes the run-time options and switches. SWISH-FAQ(1) Answers to commonly asked questions. SWISH-LIBRARY(1) API for the Swish-e search library. Applications can link against this library. SUPPORT
Support for Swish-e is provide via the Swish-e discussion list. See http://swish-e.org for information. 2.4.7 2009-04-04 SWISH-E(1)
All times are GMT -4. The time now is 03:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy