Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Search for specific key in a file and print it Post 303037008 by amar1208 on Saturday 20th of July 2019 02:48:42 PM
Old 07-20-2019
Search for specific key in a file and print it

Hi All,

I have a file abc.txt
Database unique name: NEPAL
Database name: NEPAL
Services: NEPAL_COB,NEPAL_PROD

output i need is it should search "Services" and it that search "COB" word
so output i need is like
NEPAL_COB
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print lines with search string at specific position

Hi Folks, I have a file with all fields defined by byte position, but any field can be empty so I cannot print lines based on a search of specific columns. I need to print all lines of this file where the string of two characters at byte position 100-101 contains the number 27. Any ideas? ... (4 Replies)
Discussion started by: HealthyGuy
4 Replies

2. Shell Programming and Scripting

Search in specific position and print the whole line

I have two files abc.dat and sant.dat (Big file 60k rows) for every line's 1,4 of abc.dat need to seach if this is present on 28,4 of sant.dat every line. if its present the output needs to go to bde.dat Example: contents abc.dat aaaa bbbb cccc dddd contents sant.dat this is... (4 Replies)
Discussion started by: ssantoshss
4 Replies

3. 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

4. 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

5. Shell Programming and Scripting

Urgent request to consider:Search specific name in a file and fetch specific entries

Hi all, I have 2 files, One file contain data like this FHIT CS CHRM1 PDE3A PDE3B HSP90AA1 PTK2 HTR1A ESR1 PARP1 PLA2G1B These names are mentioned in the second file(Please see attached second file) as # Drug_Target_X_Gene_Name:(Where X can be any number (1-1000) (1 Reply)
Discussion started by: manigrover
1 Replies

6. Shell Programming and Scripting

Search specific name in a file and fetch specific entries

Hi all, I have 2 files, One file contain data like this FHIT CS CHRM1 PDE3A PDE3B HSP90AA1 PTK2 HTR1A ESR1 PARP1 PLA2G1B These names are mentioned in the second file(Please see attached second file) as (7 Replies)
Discussion started by: manigrover
7 Replies

7. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

8. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

9. UNIX for Beginners Questions & Answers

Non-root script used search and list specific key words

Hy there all. Im new here. Olso new to terminal & bash, but it seams that for me it's much easyer to undarsatnd scripts than an actual programming language as c or anyother languare for that matter. S-o here is one og my home works s-o to speak. Write a shell script which: -only works as a... (1 Reply)
Discussion started by: Crisso2Face
1 Replies

10. Shell Programming and Scripting

Shell Scripting , need to search and print a line that contains a specific pattern

Take example of below file. abc.txt nas1:/abc/test/test1 /test nas1:/abc/test/test1/test2 /test/abc nas1:/abc/test/ Now i have a variable that contains "nas1:/abc/test/test1" value , so i need to search the above file for this variable and print only this line. ... (14 Replies)
Discussion started by: mohit_vardhani
14 Replies
tracker-search(1)						   User Commands						 tracker-search(1)

NAME
tracker-search - Search all content for keywords SYNOPSIS
tracker-search [OPTION...] EXPRESSION [EXPRESSION...] DESCRIPTION
tracker-search searches all indexed content for EXPRESSION. The resource in which EXPRESSION matches must exist (see --all for more infor- mation). All results are returned in ascending order. In all cases, if no EXPRESSION is given for an argument (like --folders for example) then ALL items in that category are returned instead. EXPRESSION One or more terms to search. The default operation is a logical AND. For logical OR operations, see -r. OPTIONS
-?, --help Give a short help message. -l, --limit=N Limit search to N results. The default is 512. -o, --offset=N Offset the search results by N. For example, start at item number 10 in the results. The default is 0. -r, --or-operator Use OR for search terms instead of AND (the default) -d, --detailed Show the unique URN associated with each search result. This does not apply to --music-albums and --music-artists. -a, --all Show results which might not be available. This might bebecause a removable media is not mounted for example. Without this option, resources are only shown if they exist. This option applies to all command line switches except --music-albums and --music-artists. -f, --files=EXPRESSION Search for files of any type matching EXPRESSION (optional). -e, --folders=EXPRESSION Search for folders matching EXPRESSION (optional). -m, --music=EXPRESSION Search for music files matching EXPRESSION (optional). --music-albums=ALBUM Search for music albums matching ALBUM (optional). --music-artists=ARTIST Search for music artists matching ARTIST (optional). -l, --images=EXPRESSION Search for images matching EXPRESSION (optional). -v, --videos=EXPRESSION Search for videos matching EXPRESSION (optional). -t, --documents=EXPRESSION Search for documents matching EXPRESSION (optional). -e, --emails=EXPRESSION Search for emails matching EXPRESSION (optional). Returns a list of subjects for emails found. -c, --contacts=EXPRESSION Search for contacts matching EXPRESSION (optional). Returns a list of names and email addresses found. -V, --version Print version. SEE ALSO
tracker-store(1), tracker-stats(1), tracker-tag(1), tracker-info(1). GNU
July 2009 tracker-search(1)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy