10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a multicolumn text file with header in the first row like this
The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach
for ii in ${hdr}
do
gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
2. Shell Programming and Scripting
Hi,
When we "grep" for a word in a file, it returns the last lines containing the word that we searched for.
Is there a way to display last line to grep.
Thanks
Ex log.
Ex. logname.log
2015-07-29 06:43:07.023|BETA |2015-07-29... (5 Replies)
Discussion started by: ooilinlove
5 Replies
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
Hi,
I have input file as below. Can you help me?
inac_4y;0;2;Balance;200;1;1;
0;2;Balance;100;1;
0;inac_nq;0;1;Balance;100;1
desired output
Balance;200
Balance;100
Balance;100
-Suresh
Please use and tags when posting code, data or logs etc. to preserve formatting... (5 Replies)
Discussion started by: suresh3566
5 Replies
5. Shell Programming and Scripting
Hi guys.
I am trying to perform a search using grep. I get my grep to work, but need to "awk" a Process Number that is 2 lines above...
Example:
I run a query on my TSM server for Processes that are "Waiting" for something...it returns this:
Process Number: 32,881
Process... (14 Replies)
Discussion started by: Stephan
14 Replies
6. UNIX for Dummies Questions & Answers
hi, consider the below line in a text file,
'Y',getdate(),'N','V',NULL .....
'N',getdate(),'Y','D',NULL .....
'Y','N','Y',getdate(),'Y','D',NULL ....
as u see above, i want only the second word after the getdate() word...
getdate() will not come 2nd word alwys it may be any position but i... (11 Replies)
Discussion started by: prsam
11 Replies
7. Shell Programming and Scripting
Folks, is it possible to display only words with grep (or any built-in ultility)?
I have more than 1 pattern to search, say apple & orange
The text goes like this:
So I need to display all the words starting with apple or orange
The output should be:
Any idea? (7 Replies)
Discussion started by: bsddaemon
7 Replies
8. Shell Programming and Scripting
Hi Guru's.... I've one log file in all my systems which writes the backup information..
I'have written a command like this:
ssh -l ora${sid} ${primaryhost} "tail -50 /oracle/$ORACLE_SID/newbackup/END_BACKUP.log" |grep 'insert' |tail -1| awk '{print $7}'
We have nearly 50 systems in our... (2 Replies)
Discussion started by: suri.tyson
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
When we "grep" for a word in a file, it returns the lines containing the word that we searched for. Is there a way to display only the words and not the entire line containing them.
Thanks
Ananth (6 Replies)
Discussion started by: ananthmm
6 Replies
10. Shell Programming and Scripting
hi,
how to print a row which contains a perticular word in its third column using grep, cut,
or any thing else.
thanks (2 Replies)
Discussion started by: useless79
2 Replies