09-20-2007
how to append into array thru awk
hey champs,
i have variable as field_dtls,
which has values like
CLIENT ID|FAMILY NAME|MIDDLE NAME|FIRST NAME|COUNTRY NAME|ADDRESS|NATIONAL ID|PASSPORT NUMBER
so,
echo "$field_dtls"
CLIENT ID|FAMILY NAME|MIDDLE NAME|FIRST NAME|COUNTRY NAME|ADDRESS|NATIONAL ID|PASSPORT NUMBER
but i could not fragments these values into arrays based on field separator |
for i in `echo "$field_dtls" | awk -F"|" '{ for (i=1;i<NF;i++) { printf("%s\n",$i)}}'`
> do
> j=1
> var[$j]="$i"
> j=`expr $j + 1`
> done
if i am printing echo ${var[1]}
it showing me o/p as ID
how can i overcome this......e.g echo ${var[1]} should give CLIENT ID
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a problem with my awk script. I am trying to append the whole line to another file called " file.txt " but i can't. I suppose there's something wrong in the way that i pipe. I canot use " nawk -f awk_script input > file.txt " because i have a 2nd input.
Can any expert give some... (4 Replies)
Discussion started by: Raynon
4 Replies
2. Shell Programming and Scripting
Hi friends,
I have a file with content SOME TEXT HERE
I want to append the string GREAT to Line 1 of my file such that the file content should be
GREAT
SOME TEXT HERE
I can do a cat for the string great and file >> newfile and then rename newfile name to file
But this does not put... (5 Replies)
Discussion started by: dahlia84
5 Replies
3. Shell Programming and Scripting
Hello, I wrote the following in python that parses mathematical expressions and I'm trying to store the results in an array. For example, if I enter 3+4*2, the array should be . Unfortunately, I get the following:
Can anyone help me figure out what is wrong? The tokenizer seems to work... (0 Replies)
Discussion started by: jl487
0 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
Hi,
I have one array created and some values are there in ksh. I want to append some other values to it based on some condition in if statement.
#!/bin/ksh
echo "---------------------------------------------------"
set -A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}'... (2 Replies)
Discussion started by: sanzee007
2 Replies
6. Shell Programming and Scripting
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies
7. Shell Programming and Scripting
Hi all,
I'm dealing with a bash script to merge the elements of a set of files and counting how many times each element is present. The last field is the file name.
Sample files:
head -5 *.tab==> 3J373_P15Ac1y2_01_LS.tab <==
chr1 1956362 1956362 G A hom ... (7 Replies)
Discussion started by: lsantome
7 Replies
8. Shell Programming and Scripting
for a in {1..100}
do
awk '{ sum+=$a} END {print sum}' a=$a file1 > file2
done
I know I will get only one number if following the code above, how can I get 100 sum numbers in file2? (2 Replies)
Discussion started by: wanliushao
2 Replies
9. UNIX for Beginners Questions & Answers
I have to append the header (ie "START OF LINE") to a file only if there is data in it.
Below command is showing header though there is no data in a file, can you suggest how to correct..
awk '{NR!=0} BEGIN{print "START OF LINE"}; {print}' file (3 Replies)
Discussion started by: JSKOBS
3 Replies
10. UNIX for Beginners Questions & Answers
The bash stores each uniqueid in an array and then passes them to %q to get the unique path. That seems to work what I am having trouble with is renaming each .png with the unique value in %q. I thought it was working but upon closer inspection, a .png file is being sent to scp.... but only 1 and... (21 Replies)
Discussion started by: cmccabe
21 Replies
AZR3(1) General Commands Manual AZR3(1)
NAME
azr3 - Organ synth with distortion and rotating speakers
SYNOPSIS
azr3 --help
azr3 --version
azr3 [-a PORT|CLIENT] [-j NAME] [-m PORT|CLIENT] [-p NUMBER]
DESCRIPTION
azr3 is a port of Rumpelrausch Taips' VST plugin AZR-3 which simulates a drawbar organ with a distorting amplifier and a rotating speaker
cabinet. This version is a JACK client that can be connected to any other MIDI and audio software using JACK.
-a, --audio-output=PORT|CLIENT
When used, azr3 will try to connect its audio output ports to PORT (if it's a JACK port name) or the first two audio input ports in
CLIENT (if it's a JACK client name).
-h, --help
Display a help text and exit.
-j, --jack-name=NAME
Set the name of the JACK client. The default is AZR-3. Note that JACK may change this name by e.g. adding a number at the end if
needed.
-m, --midi-input=PORT|CLIENT
When used, azr3 will try to connect its MIDI input port to PORT (if it's a JACK port name) or the first MIDI output port in CLIENT
(if it's a JACK client name).
-p, --preset=NUMBER
Load the preset with the given number instead of the first available one.
-v, --version
Display version information and exit.
All program options can also be set using environment variables. The variable names are the same as the long option names with all letters
in upper case, all - changed to _ and the prefix AZR3_JACK_ added.
Command line options override environment variables.
AUTHOR
The original VST version was written by Philipp Mott, this JACK port by Lars Luthman.
This manual page was written by Lars Luthman <lars.luthman@gmail.com>.
February 24, 2010 AZR3(1)