10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Trying to filter information when using awk -F. I'm trying to use wildcards to match a range of values but can't get the syntax to work.
Since I'm using awk -F I'm setting my delimiter then entering specific information abcde but if I want to do abcd(e-9) how do I make that work? Do I... (5 Replies)
Discussion started by: fgarvis88
5 Replies
2. Shell Programming and Scripting
I am trying to reformat the table by filling any missing rows. The final table will have consecutive IDs in the first column. My problem is the index of the associate array in the awk script.
infile:
S01 36407 53706 88540
S02 69343 87098 87316
S03 50133 59721 107923... (4 Replies)
Discussion started by: yifangt
4 Replies
3. Shell Programming and Scripting
HI All,
I would like to pass a integer and get all values under this index the by using awk. Could anyone help?
Thanks :>
input:
1,2,3,4,5,6,7
1,2,3,48,5,6,7
1,2,3,4,5,6,7
e.g. i pass 4 to awk command
output:
4
48
4
Video tutorial on how to use code tags in The UNIX and Linux... (8 Replies)
Discussion started by: mimilaw
8 Replies
4. Shell Programming and Scripting
1 2 000060000
How do i return the point in the string where the 6 is?
i.e what I want on output is
1 2 5
something like awk '{print $1 $2 index($3,6) }'
but I can't get it to work
Thanks in advance (3 Replies)
Discussion started by: garethsays
3 Replies
5. Shell Programming and Scripting
Hi All,
I have a file (FileNames.txt) which contains the following data in it.
$ cat FileNames.txt
MYFILE17XXX208Sep191307.csv
MYFILE19XXX208Sep192124.csv
MYFILE20XXX208Sep192418.csv
MYFILE22XXX208Sep193234.csv
MYFILE21XXX208Sep193018.csv
MYFILE24XXX208Sep194053.csv... (5 Replies)
Discussion started by: krish_indus
5 Replies
6. Shell Programming and Scripting
I am beginner in awk
awk 'BEGIN{for(i=1;(getline<"opnoise")>0;i++) arr=$1}{print arr}'
In the above script, opnoise is a file, I am reading it into an array and then printing the value corresponding to index 20. Well this is not my real objective, but I have posted this example to describe... (19 Replies)
Discussion started by: akshaykr2
19 Replies
7. Shell Programming and Scripting
$ cat file.txt
A|X|20
A|Y|20
A|X|30
A|Z|20
B|X|10
A|Y|40
Summing up $NF based on first 2 fields,
$ awk -F "|" 'BEGIN {OFS="|"}
{ sum += $NF }
END { for (f in sum) print f,sum }
' file.txt
o/p:
A|X|50
A|Y|60
A|Z|20 (4 Replies)
Discussion started by: uwork72
4 Replies
8. Shell Programming and Scripting
Hello,
I have this code:
#!/bin/sh
awk -v val="........." 'BEGIN{FS=OFS=" ";c=0}
NR==FNR&&d==0{a=$0; c++;next}
FNR==(NR-c){b=val;next}
{if(1234 in a){print "okay"}}
{print $1}' listi fpr.11 grn
that is working (awk find the value in the table "a" and return "okay" followed by 1234)
... (2 Replies)
Discussion started by: jolecanard
2 Replies
9. UNIX for Dummies Questions & Answers
brothers why inode index starts from 1 unlike array inex which starts from 0
its a question from the design of unix operating system of maurice j.bach
i need to know the answer urgently...someone help please (1 Reply)
Discussion started by: sairamdevotee
1 Replies
10. Filesystems, Disks and Memory
why do inode indices starts from 1 unlike array indexes which starts from 0
its a question from "the design of unix operating system" of maurice j bach
id be glad if i get to know the answer quickly
:) (0 Replies)
Discussion started by: sairamdevotee
0 Replies