10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hello everybody
I have a text file which has the following format:
nmm "text20140601.033954text" "text" "text"
"text" , ... , "text"
"text" , ... , Lat 36.3247 Lon 16.0588 Depth 8
"text", ... , "text"
"text", ..., CovXX 1.65 CovYY 2.32 CovZZ 1.2
"text" , ..., "text
nmm ... (6 Replies)
Discussion started by: phaethon
6 Replies
3. UNIX for Dummies Questions & Answers
Hello,
May i please know how do i print the array using awk script. I am using below shell script to start with but not working.
#!/bin/bash
LOADSTATUS="Line 0"
LOADSTATUS="Line 1"
LOADSTATUS="Line 2"
LOADSTATUS="Line 3"
LOADSTATUS="Line 4"
awk '
BEGIN {
Your File Load Status
}... (1 Reply)
Discussion started by: Ariean
1 Replies
4. Shell Programming and Scripting
Can you search AWK array elements and return each index value for that element.
For example an array named car would have index make and element engine. I want to return all makes with engine size 1.6.
Array woulld look like this:
BMW 1.6
BMW 2.0
BMW 2.5
AUDI 1.8
AUDI 1.6
... (11 Replies)
Discussion started by: u20sr
11 Replies
5. UNIX for Dummies Questions & Answers
Hi!
Let's say I would like to convert "1", "2", "3" to "a", "b", "c" respectively. But if a record contains other number then return "X".
input:
1
2
3
4
output:
a
b
c
X
What is the syntax for:
if(array doesn't contain a particular index){
then print the value "X" instead} (12 Replies)
Discussion started by: beca123456
12 Replies
6. Shell Programming and Scripting
Hi,
I am using KSH shell to do some programming.
I want to search array and print index value of the array.
Example..
nodeval4workflow="DESCRIPTION ="" ISENABLED ="YES" ISVALID ="YES" NAME="TESTVALIDATION"
set -A strwfVar $nodeval4workflow
strwfVar=DESCRIPTION=""... (1 Reply)
Discussion started by: tmalik79
1 Replies
7. Shell Programming and Scripting
I want to read $3,$4,$5,$6,$7 of fileA in array and when
fileb $1 = fileA $4
the i want to print array and few fields from fileB.
This should work but has some syntax error.
nawk -F, 'FNR==NR{a=;next} a{print a}' fileB fileA
Appreciate if someone can correct this. (2 Replies)
Discussion started by: pinnacle
2 Replies
8. 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
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