Sponsored Content
Top Forums Shell Programming and Scripting Search a String and display only word. Post 302443417 by kurumi on Sunday 8th of August 2010 10:31:13 PM
Old 08-08-2010
Code:
tr -s "[ \t]" "\n" <file | grep 'DB[._].*'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check a string conating a search word or not ...

Hi fiends, I need some help. i have a var called fname="req_detail_TAM.dat" and is have a search string var as tmp="TAM". Now my requirement is i need to check whether a "fname" is contains "search str" or not. if search string is part of the filename, then i need to store value 1 in a... (2 Replies)
Discussion started by: manu.vmr
2 Replies

2. Shell Programming and Scripting

Search for string and display those NOT found

In my script I read a input file and search all the files in a directory and it's sub-directories for that string using: find . -type f -print | xargs grep $var1 This just displays all the lines the string was found on. Too much data. What I need is to store in a file one time those... (17 Replies)
Discussion started by: John Rihn
17 Replies

3. UNIX for Advanced & Expert Users

Parsing String, Search then display rows

Get occurence of "open" considering duplicates(get the last open). Once you are pointing to the last open count 2 rows to get the correct data. Every begin and end statement, there is a "close" and "open". There can be many "close" and "open" within the begin and end statement but we are... (9 Replies)
Discussion started by: buddyme
9 Replies

4. Shell Programming and Scripting

search a word and print specific string using awk

Hi, I have list of directory paths in a variable and i want to delete those dirs and if dir does not exist then search that string and get the correct path from xml file after that delete the correct directory. i tried to use grep and it prints the entire line from the search.once i get the entire... (7 Replies)
Discussion started by: dragon.1431
7 Replies

5. Shell Programming and Scripting

search-word-print-specific-string

Hi, Our input xml looks like: <doc> <str name="account_id">1111</str> <str name="prd_id">DHEP155EK</str> </doc> - <doc> <str name="account_id">6666</str> <str name="prd_id">394531662</str> </doc> - <doc> <str name="account_id">6666</str> <str... (1 Reply)
Discussion started by: Jassz
1 Replies

6. Shell Programming and Scripting

Search string in unix and print whole matching word

Hi I have requirement to search string starting with specific characters and print whole matching word in that string. example mystr="ATTRIBUTE NAME="Event Name" VALUE="Execute"" I want to search by passing "NAME=" and result should be NAME="Event Name". i am using below command but... (3 Replies)
Discussion started by: tmalik79
3 Replies

7. Shell Programming and Scripting

Grep word after last occurance of string and display next few lines

Hi, I wanted to grep string "ERROR" and "WORNING" after last occurrence of String "Starting" only and wanted to display two lines after searched ERROR and WORNING string and one line before. I have following cronjob log file "errorlog" file and I have written the code for same in Unix as below... (17 Replies)
Discussion started by: nes
17 Replies

8. Shell Programming and Scripting

Search and replace the string with new word using xml tags

Hi All i need to replace the url1 inside <remote> tag in below xml in first instance and in the second instance with url2. any help appreciated <locations> <hudson.scm.SubversionSCM_-ModuleLocation> <remote>https://svn2015.com/svn/repos/internalshard</remote> ... (4 Replies)
Discussion started by: madankumar.t@hp
4 Replies

9. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies

10. Shell Programming and Scripting

Search string in multiple files and display column wise

I have 3 files. Each of those files have the same number of records, however certain records have different values. I would like to grep the field in ALL 3 files and display the output with only the differences in column wise and if possible line number File1 Name = Joe Age = 33... (3 Replies)
Discussion started by: sidnow
3 Replies
Xapian::WritableDatabase(3pm)				User Contributed Perl Documentation			     Xapian::WritableDatabase(3pm)

NAME
Search::Xapian::WritableDatabase - writable database object DESCRIPTION
This class represents a Xapian database for indexing. It's a subclass of Search::Xapian::Database, which is used for searching. METHODS
new <database> or new <path> <mode> Class constructor. Takes either a database object, or a path and one of DB_OPEN, DB_CREATE, DB_CREATE_OR_OPEN or DB_CREATE_OR_OVERWRITE. These are exported by Search::Xapian with the 'db' option. clone Return a clone of this class. flush Flush to disk any modifications made to the database. For efficiency reasons, when performing multiple updates to a database it is best (indeed, almost essential) to make as many modifications as memory will permit in a single pass through the database. To ensure this, Xapian batches up modifications. Flush may be called at any time to ensure that the modifications which have been made are written to disk: if the flush succeeds, all the preceding modifications will have been written to disk. If any of the modifications fail, an exception will be thrown and the database will be left in a state in which each separate addition, replacement or deletion operation has either been fully performed or not performed at all: it is then up to the application to work out which operations need to be repeated. Beware of calling flush too frequently: this will have a severe performance cost. Note that flush need not be called explicitly: it will be called automatically when the database is closed, or when a sufficient number of modifications have been made. add_document <document> Add a new document to the database. This method adds the specified document to the database, returning a newly allocated document ID. Note that this does not mean the document will immediately appear in the database; see flush() for more details. As with all database modification operations, the effect is atomic: the document will either be fully added, or the document fails to be added and an exception is thrown (possibly at a later time when flush is called or the database is closed). delete_document <doc_id> Delete a document from the database. This method removes the document with the specified document ID from the database. Note that this does not mean the document will immediately disappear from the database; see flush() for more details. As with all database modification operations, the effect is atomic: the document will either be fully removed, or the document fails to be removed and an exception is thrown (possibly at a later time when flush is called or the database is closed). delete_document_by_term <term> Delete any documents indexed by a term from the database. This method removes any documents indexed by the specified term from the database. The intended use is to allow UIDs from another system to easily be mapped to terms in Xapian, although this method probably has other uses. replace_document <doc_id> <document> eplace a given document in the database. This method replaces the document with the specified document ID. Note that this does not mean the document will immediately change in the database; see flush() for more details. As with all database modification operations, the effect is atomic: the document will either be fully replaced, or the document fails to be replaced and an exception is thrown (possibly at a later time when flush is called or the database is closed). replace_document_by_term <unique_term> <document> Replace any documents matching an unique term. This method replaces any documents indexed by the specified term with the specified document. If any documents are indexed by the term, the lowest document ID will be used for the document, otherwise a new document ID will be generated as for add_document. The intended use is to allow UIDs from another system to easily be mapped to terms in Xapian, although this method probably has other uses. Note that this does not mean the document(s) will immediately change in the database; see flush() for more details. As with all database modification operations, the effect is atomic: the document(s) will either be fully replaced, or the document(s) fail to be replaced and an exception is thrown (possibly at a later time when flush is called or the database is closed). add_spelling <word> <freqinc> Add a word to the spelling dictionary. If the word is already present, its frequency is increased. Parameters: word The word to add. freqinc How much to increase its frequency by (default 1). remove_spelling <word> <freqdec> Remove a word from the spelling dictionary. The word's frequency is decreased, and if would become zero or less then the word is removed completely. Parameters: word The word to remove. freqdec How much to decrease its frequency by (default 1). reopen Re-open the database to ensure you are using the latest revision. close Close the database. This also implies a commit() unless a transaction is in progress. SEE ALSO
Search::Xapian,Search::Xapian::Enquire,Search::Xapian::Database perl v5.14.2 2012-05-09 Xapian::WritableDatabase(3pm)
All times are GMT -4. The time now is 08:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy