using an awk internal variable as parameter for an external array
Hello,
I am running a bash script under linux which first defines an CA-array like
within the later awk section of this same script I want to read data from a file. If the value of the second column is equal to the value of CA[0 to 5] the array MF[0 to 5] should read the value from column 59:
As long in the bold written part the parameter of the array is fixed to certain value (here "1") the script works fine. In later stage I do want to read dozend of lines from the file and not only 5!
Does anyone know how I do have to change the script ('${CA[1]}') in order to have "i" of the awk loop to define the parameter fo the external array CA? Any help or work arround is appreciated.
Regards,
MotAah
Last edited by Scott; 08-25-2011 at 10:14 AM..
Reason: Code tags
i need help with an awk question. i am looking to have an external variable be defined outside of awk but used in awk. so if we have fields $1, $2, $3 so on and so forth, i would like to be able to dictate what field is being printed by something like $. so if i had a counter called test, make it 3... (8 Replies)
So I have a if statement inside an awk to check if $2 of a awk equals a specific IP but the test fails. So here is what I have.
# !/bin/sh
echo "Enter client ID"
read ID
echo "Enter month (01, 02, 03)"
read month
echo "Enter day (03, 15)"
read day
echo "Enter Year (07, 08)"
read... (6 Replies)
Dear all,
¿How can i insert a variable in a AWK pattern?
I have almost succeeded in solving a puzzle with AWK but now i want to make a script. Let me explain.
cat file.txt | awk 'BEGIN {RS="\\n\\n"} /tux/ { print "\n"$0 }'
I know that this command makes right what i want to do, but mi... (8 Replies)
I want to incorporate the variable in the for statement as a column of my processed file. In the INCORRECT example below, it is $i which corresponds to the i in my for loop:
for i in x86_64 i686; do
awk '{ print $1" "$4" "$5" "$i }'awk $file-$i > processed-$i.log
doneThanks! (3 Replies)
is it possible to assign value to an array variable from an external file?? if yes then how??
I am using below code but its not working.
#!bin/bash
myarray < file_name
echo ${mayarray} (6 Replies)
I'm trying to get the universities result data into different file, where the $9 contains unversity field and field7,4 & 5 contains the keys to sort the students by marks. How to use uni variable to match against $9 inside awk?
c=0
for uni in `cat /tmp/global_rank| awk -F ',' '{print... (1 Reply)
Hi,
I am trying to write a bash script in which I need to pass a external variable to the awk program. I tired using -v but it not accepting the value.
Here is my sample code.
#!/usr/bin/bash
######################################################################################
####... (5 Replies)
How to check whether the disk in linux machine are internal or external ( from nas or san). How to identify internal(local) and external disks. Following are some details of my server. Thanks.
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 15G 3.5G 10G... (2 Replies)
Discussion started by: salmanraza
2 Replies
LEARN ABOUT LINUX
wxsizerflags
wxSizerFlags(3erl) Erlang Module Definition wxSizerFlags(3erl)NAME
wxSizerFlags - See external documentation: wxSizerFlags.
DESCRIPTION
See external documentation: wxSizerFlags .
DATA TYPES
wxSizerFlags() :
An object reference, The representation is internal and can be changed without notice. It can't be used for comparsion stored on disc
or distributed for use on other nodes.
EXPORTS
new() -> wxSizerFlags()
Equivalent to new([]) .
new(Options::[Option]) -> wxSizerFlags()
Types Option = {proportion, integer()}
See external documentation .
align(This::wxSizerFlags(), Alignment::integer()) -> wxSizerFlags()
See external documentation .
border(This::wxSizerFlags()) -> wxSizerFlags()
Equivalent to border(This, []) .
border(This::wxSizerFlags(), Options::[Option]) -> wxSizerFlags()
Types Option = {direction, integer()}
See external documentation .
border(This::wxSizerFlags(), Direction::integer(), BorderInPixels::integer()) -> wxSizerFlags()
See external documentation .
center(This::wxSizerFlags()) -> wxSizerFlags()
See external documentation .
centre(This::wxSizerFlags()) -> wxSizerFlags()
See external documentation .
expand(This::wxSizerFlags()) -> wxSizerFlags()
See external documentation .
left(This::wxSizerFlags()) -> wxSizerFlags()
See external documentation .
proportion(This::wxSizerFlags(), Proportion::integer()) -> wxSizerFlags()
See external documentation .
right(This::wxSizerFlags()) -> wxSizerFlags()
See external documentation .
destroy(This::wxSizerFlags()) -> ok
Destroys this object, do not use object again
AUTHORS
<>
wxErlang 0.98.9 wxSizerFlags(3erl)