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. UNIX for Advanced & Expert Users
Hi I want to print the line until pattern is matched.
I am using below code:
sed -n '1,/pattern / p' file
It is working fine for me , but its not working for exact match.
sed -n '1,/^LAC$/ p' file
Input:
LACC FEGHRA 0
LACC FACAF 0
LACC DARA 0
LACC TALAC 0
LAC ILACTC 0... (8 Replies)
Discussion started by: Abhisrajput
8 Replies
3. Shell Programming and Scripting
Hi,
I need to search a file for a pattern,replace some other word and write a word at its 72nd position.
For example,
My name is Mano.Im learning Unix.
I want to search the file in all lines containing the word "Mano".In that matched line,replace the word "Unix" with "Java".And... (5 Replies)
Discussion started by: mano1 n
5 Replies
4. 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
5. Shell Programming and Scripting
Hi Guys.
I guess I have a very basic query but stuck with it :(
I have a file in which I want to extract particular content. The content is between standard format like :
Verify stats
A=0
B=12
C=34
TEST Failed
Now I want to extract data between "Verify stats" & "TEST Failed" but do... (6 Replies)
Discussion started by: ratneshnagori
6 Replies
6. Shell Programming and Scripting
would like to print word between matched patterns using sed
for example :
create INDEX SCOTT.OR_PK ON table_name(....)
would like to print between SCOTT. and ON which is OR_PK
Please help me out
Thanks (4 Replies)
Discussion started by: jhonnyrip
4 Replies
7. Shell Programming and Scripting
Hi experts
I need to pick 2 matched words from the same line.....
I have given below an example file
eg:
O14757 hsa04110 hsa04115 2 P38398 hsa04120 1
O15111 hsa04010 hsa04210 hsa04920 hsa04620 hsa04660 hsa04662 hsa05200 hsa05212 hsa05221 hsa05220 hsa05215 hsa05222 hsa05120 13 O14920... (4 Replies)
Discussion started by: binnybio
4 Replies
8. Shell Programming and Scripting
Hi,
If there exist multiple pattern in a file, how can I find the last record matching the pattern through perl.
The below script searches for the pattern everywhere in an input file.
#! /usr/bin/perl -s -wnl
BEGIN {
$pattern or
warn"Usage: $0 -pattern='RE' \n" and
exit 255;... (5 Replies)
Discussion started by: er_ashu
5 Replies
9. Shell Programming and Scripting
Hello,
Actually i want to replace the word after a matched pattern.
For Ex:
lets say that i am reading a file line by line
while read line
do
echo $line
# i need to search whether a pattern exists in the file and replace the word after if the pattern exist.
# for example :... (1 Reply)
Discussion started by: maxmave
1 Replies
10. Shell Programming and Scripting
Hi ,
If I match a word in a file, I want to pick the next line of that matched word.
My file is a below format-
The ntrag trace has auditError
Line5005 contains transaction Ntrag data
------------
Here I wanted if I match a word auditError, I need to get the next line
"Line5005... (10 Replies)
Discussion started by: Muktesh
10 Replies