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
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
3. 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
4. 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
5. Shell Programming and Scripting
Hi,
I have a program written in awk and I want to extend it to do another task.
My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field)... (8 Replies)
Discussion started by: sandeepk1611
8 Replies
6. 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
7. UNIX for Advanced & Expert Users
Hi,
I would like to convert the output from awk function to date and print on the screen.
Example : echo "Start Date: May 24 2010" | gawk -F": " '{print $2}'
Output : May 04 2010
I want this to be converted to 2010/05/24
Can i use date function here and how?
Thanks,
Deepika (2 Replies)
Discussion started by: deepikad
2 Replies
8. Shell Programming and Scripting
How could I change the lines with grep and awk to output a number instead of a string?
case '2':
@ L0 = 1
@ LN = `grep RS_D resample.in | awk '{print $3}'`
@ P0 = 1
@ PN = `grep RS_D resample.in | awk '{print $5}'`
# ||| fall through |||
Cheers (1 Reply)
Discussion started by: larne
1 Replies
9. Shell Programming and Scripting
Hi!
I am writing a script handling downloading list of files and I have to check whether file is present locally and if not finished than continue downloading. To do so I have to compare sizes of remote file and local file.
To check remote file size I have to parse something like this:
... (2 Replies)
Discussion started by: hrwath
2 Replies
10. Shell Programming and Scripting
I am porting a awk script from Windows to unix
I_SALE_MEDIA=$67
if ((I_VOID_FLAG == "Y") && (I_SALE_MEDIA == 0))
NOW consider the case where I_SALE_MEDIA i.e $67 is "000"
The above comparison works fine in Windows , but to make it work in
Unix , I had to change the above as follows :
... (3 Replies)
Discussion started by: rohanrege
3 Replies