10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, i have file file.txt with data like:
START
03:11:30 a
03:11:40 b
END
START
03:13:30 eee
03:13:35 fff
END
jjjjjjjjjjjjjjjjjjjjj
START
03:14:30 eee
03:15:30 fff
END
ggggggggggg
iiiiiiiiiiiiiiiiiiiiiiiii
I want the below output
START (13 Replies)
Discussion started by: Jyotshna
13 Replies
2. Shell Programming and Scripting
I am trying to use awk to extract and print the first ocurrence of NM_ and NP_ with a : before in each line. The input file is tab-delimeted, but the output does not need to be. The below does execute but prints all the lines in the file not just the patterns. Thank you :).
file tab-delimeted
... (2 Replies)
Discussion started by: cmccabe
2 Replies
3. Shell Programming and Scripting
What i'm trying to do here is show X amount of lines before and after the string "serialNumber" is found.
BEFORE=3
AFTER=2
gawk '{a=$0} {count=0} /serialNumber/ && /./ {for(i=NR-'"${BEFORE}"';i<=NR;i++){count++ ;print a}for(i=1;i<'"${AFTER}"';i++){getline; print ; count ++; print... (5 Replies)
Discussion started by: SkySmart
5 Replies
4. Shell Programming and Scripting
Hi,
I am trying to print multiple patterns in a line using sed. But it is printing only the last occurance of a pattern.
If the line is
the the output should be
Lookup Procedure|Stored proc
But the output I am getting is
Stored proc
The code I am using is
echo... (9 Replies)
Discussion started by: kedar_laveti
9 Replies
5. Shell Programming and Scripting
Coins.txt:
gold 1 1986 USA American Eagle
gold 1 1908 Austria-Hungary Franz Josef 100 Korona
silver 10 1981 USA ingot
gold 1 1984 Switzerland ingot
gold 1 1979 RSA Krugerrand
gold 0.5 1981 RSA Krugerrand
gold 0.1 1986 PRC Panda
silver 1 1986 USA Liberty dollar
gold 0.25 1986 USA Liberty... (2 Replies)
Discussion started by: Ramesh M
2 Replies
6. Shell Programming and Scripting
Hi,
I have a file, which contains the following log data.
I am trying to print fromt he file the following data:
I have tried using sed, but I am getting from the first pattern
Thanks for your help. (5 Replies)
Discussion started by: sol_nov
5 Replies
7. Shell Programming and Scripting
Hi All,
I need help for below scenario :
I have a principals.xml_24092012backup file :
cat principals.xml_24092012backup
</user>
<user username="eramire" password="2D393C01720749256303D204826A374D9AE9ABABBF8A">
<roleMapping rolename="VIEW_EVERYTHING"/>
</user>
... (2 Replies)
Discussion started by: kiran_j
2 Replies
8. Shell Programming and Scripting
Hi, i have file f1.txt with data like:
CHECK
a
b
CHECK
c
d
CHECK
e
f
JOB_START
....
I want to match the last occurrence of 'CHECK' until the end of the file.
I can use awk:
awk '/^CHECK/ { buf = "" } { buf = buf "\n" $0 } END { print buf }' f1.txt | tail +2Is there a cleaner way of... (2 Replies)
Discussion started by: ysrini
2 Replies
9. Shell Programming and Scripting
Guys,
I am trying the following:
i have a log file of a webbap which logs in the following pattern:
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
bla
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
... (6 Replies)
Discussion started by: ppolianidis
6 Replies
10. Shell Programming and Scripting
Hi, I am totally new to shell scripting.
I have a String "c:\working\html\index.txt.12-12-2009.bkp" I want to check if the string has more than one "." character. If it does I would like to retrieve only "c:\working\html\index.txt" i.e, discard the second occurrence of "." and the rest of the... (7 Replies)
Discussion started by: imr
7 Replies