10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
2. Shell Programming and Scripting
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
Discussion started by: cozzin
9 Replies
3. Shell Programming and Scripting
I am trying to go through a file that has a few million lines. I want to only pull lines that contain a number anywhere in the ninth field, but it has to be after a "/" character. Here is my awk:
awk -F\| '$9 ~ /\/*{1,}*/ {print $0}' file1 > file2
However, it is just printing out every... (3 Replies)
Discussion started by: dagamier
3 Replies
4. Shell Programming and Scripting
Hi All,
I have a file a.txt, content as mentioned below:
22454750
This data in this control file and
I have a variable called vCount which contains a number.
I need to extract the 22454750 from the above file and compare with the variable vCount. If match fine or else exit.
... (5 Replies)
Discussion started by: Arun Mishra
5 Replies
5. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
6. Shell Programming and Scripting
Can someone explain whats happening here:
$ awk 'BEGIN {print (2.5 - 1)}'
1,5
2.5 - 1 is correctly calculated to 1,5 (using european locale)
$ echo "2.5" | awk '{temp = $1 - 1; print temp}'
1
If i now pipe the string 2.5 through awk it seems at it truncates 2.5 to 2?
What's the... (4 Replies)
Discussion started by: beow
4 Replies
7. Programming
Hi guys,
I am new to unix shell scripts. I have a file-A.txt which contained several names in "ABCo12345678.gz_to_ABCn12345678.gz" format. I want to extract the numbers in a "for" loop that means I can not use cut -c6-13 A.txt.Dose anyone know how to do it by using awk? Thank you so much.
... (4 Replies)
Discussion started by: shrimpj
4 Replies
8. Shell Programming and Scripting
Ok,
So I have a huge file that has over 12000 lines in it.
in this file, there are 589 occurrences of the string "use five-minute-interval" spread in various areas in the file.
How can i replace the the last 250 of the occurrences of "use five-minute-interval" with "use... (10 Replies)
Discussion started by: SkySmart
10 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I'm new to using AWK and would be grateful for some basic advice to get me started.
I have a file consisting of 10 fields. Initially I wish to calculate the number of . , ~ and ^ characters in the 9th field ($9) of each line. This particular string also contains alphabetical... (6 Replies)
Discussion started by: Olly
6 Replies
10. UNIX for Dummies Questions & Answers
I need a sed line that will take STDM111 and change it to STDM161
the STDM will always be constant but the 3 numbers after will be random, I just need it to always replace the middle number with 6 regardless of what the numbers are. (8 Replies)
Discussion started by: glev2005
8 Replies