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