10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
I have a file which I am reading and then I need to extract a particualr word and if it matches the line.
2015-01-22 07:30:17,814000 +0900 /INFO: - <ns2:virtualServerid="PH11PK" />
Means if the line contain Virtual server I need to extract the id .
Code I wrote#!/usr/bin/perl
... (19 Replies)
Discussion started by: karan8810
19 Replies
3. UNIX for Advanced & Expert Users
I was thinking something like this but it always gets rid of the file location.
grep -roh base. | wc -l
find . -type f -exec grep -o base {} \; | wc -l
Would this be a job for awk? Would I need to store the file locations in an array? (3 Replies)
Discussion started by: cokedude
3 Replies
4. Shell Programming and Scripting
hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this:
I have in my response lines like:
<div class="sender">mimi020</div>
<some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies
5. UNIX for Dummies Questions & Answers
Hi ,
My input file is below like that :-
$cat abc.txt
Service name: test_taf
Service is enabled
Server pool: test_tac
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: true
Failover type: SESSION... (3 Replies)
Discussion started by: sp001
3 Replies
6. UNIX for Dummies Questions & Answers
Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name".
Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies
7. Shell Programming and Scripting
i have a file containing over 1 million records,and i want to print about 300,000 line containing a some specific words.
file has content.
eg
1,rrt,234
3,fgt,678
4,crf,456
5,cde,drt
6,cfg,123
and i want to print the line with the word fgt,crf
this is just an example,my file is so... (2 Replies)
Discussion started by: tomjones
2 Replies
8. Shell Programming and Scripting
Can any one help us in finding the the last word of each line from a text file and print it.
eg:
1st --> aaa bbbb cccc dddd eeee ffff ee
2nd --> aab ered er fdf ere ww ww f
the o/p should be a below.
ee
f (1 Reply)
Discussion started by: naveen_sangam
1 Replies
9. Shell Programming and Scripting
hi ,
i m having a html file and this file looks like this
<ssl>
<name>PIA</name>
<enabled>true</enabled>
<listen-port>39370</listen-port>
</ssl>
<log>
<name>PIA</name>
</log>
<execute-queue>
<name>weblogic.kernel.Default</name>
... (7 Replies)
Discussion started by: becksram123
7 Replies
10. Shell Programming and Scripting
Hi,
I am looking for a way to find a particular word in a file then print a line that precedes this line, as well as this line.
Sometimes in a log file there is only one word per line and I need to print one of the lines leading up to the single worded line.
Example - I can grep for ouch... (5 Replies)
Discussion started by: g_jumpin
5 Replies