10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I have a problem with awk array when iam trying to use awk in solaris box as below..Iam unable to figure out the problem..
Need your help. is there any alternative to make it in arrays from variable values
nawk 'BEGIN {SUBSEP=" ";
split("101880|110045 101887|110045 101896|110045... (9 Replies)
Discussion started by: cskumar
9 Replies
2. Shell Programming and Scripting
Hi, all
suppose I have following myfile (delimited by tab)
aa bb
cc dd
ee ffand I have following awk command:
awk 'BEGIN{FS="\t"}{AwkArrayVar_1=$1;AwkArrayVar_2=$2};END{for(i=0; i<NR; i++) print i, AwkArrayVar_1, AwkArrayVar_2,}' myfileMy question is: how can I assign the awk array... (7 Replies)
Discussion started by: littlewenwen
7 Replies
3. UNIX for Dummies Questions & Answers
Hi there is there a way to assing variable a value that is output of a program in awk script. For e.g., I did
temp=(`grep "" $5 | cut -f8 -d' '`)
but it does not work.
Any advice???
Thanks in advance!!! :) (3 Replies)
Discussion started by: FUTURE_EINSTEIN
3 Replies
4. Shell Programming and Scripting
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies
5. Shell Programming and Scripting
I have a fixed width text file data.txt delimited by pipe. My requirement is to replace the second column values by *. Problem is that when tried access the shell variable in the awk program, value of shell variable is not printed instead only the name of the variable is printed. Please help to... (4 Replies)
Discussion started by: VijayakumarS
4 Replies
6. Shell Programming and Scripting
Foo.txt
20 40 57 50 22
51 66 26 17 15
63 18 80 46 78
99 87 2 14 14
51 47 49 100 58
Bar.txt
20 22
51 15
63 78
99 55
51 58
How to get output using awk
20 22 57 50
51 15 26 17
63 78 80 46
99 55 - -
51 58 49 100 (5 Replies)
Discussion started by: genehunter
5 Replies
7. Shell Programming and Scripting
i have an array call ignore. it is set up
ignore=34th56
ignore=re45ty
ignore=rt45yu
.
.
ignore=rthg34
n is a variable. I have another variable that i read from a different file. It is $2 and it is working the way i expect. array ignore read and print correct values.
in the below if... (2 Replies)
Discussion started by: usustarr
2 Replies
8. Shell Programming and Scripting
Hi all,
i have a data array as follows.
array=ertfgj2345
array=456ttygkd
.
.
.
array=errdjt3235
so number or elements in the array can varies depending on how big the data input is.
now i have a variable, and it is $1 (there are $2, $3 and so on, i am only interested in $1).
... (9 Replies)
Discussion started by: usustarr
9 Replies
9. Shell Programming and Scripting
Hi,
I want to access a variable outside the awk program. My program is as below:- I can not access the exact value of k (See the last line of the program).
#!/usr/bin/sh
j=10
k=1
#k is declared outside awk
awk '
BEGIN {
i=1;
j1="'"$j"'"
printf("\n ## Value of j1 is %d ##", j1);
... (2 Replies)
Discussion started by: shouvik.mitra
2 Replies
10. Shell Programming and Scripting
hi all i am trying to save an awk value into an array in bash:
total=`awk '{sum+=$3} END {print sum}' "$count".txt"`
((count++))
the above statement is in a while loop..
$count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.)
i get the following error:
./lines1:... (1 Reply)
Discussion started by: npatwardhan
1 Replies