What are you calling the awk with? Many shells only support single diminsion arrarys, i.e. a list. If you have few enough items, then you might get away with using a formula to convert your 2D plan into a single value that you can repeat the function with the function with to recall the data later, but there are limits to the number of elements you can have, e.g. ksh will support up to 1024 (depending how you interpret the rules and how you use it)
Could you tell us a bit more about what you have tried, what the purspose is and data volumes. It might suggest something or steer someone with an idea.
awk 'BEGIN{
FS="|";
RS=";";
}
{
print "We are here after begin";
--Here I want to assigne values in 2 D array
--say array[i,j]=$2
}
END {
;
}'File
Please help me here to improve the same.
Thanks,
[/FONT]
---------- Post updated at 09:45 AM ---------- Previous update was at 09:07 AM ----------
Thanks for the help.
Please help me understand your code.
1) I could not see where ";" line separator is defined.
2) Can I below line in starting of code:
awk 'BEGIN{
FS="|";
RS=";";
}
3) I am working on KSH , I suppose gsub might not work there.I see you are replacing "\n" with "". Will that be necessary even if I use this line RS=";";
It would be really helpful if you could guide me what are changes I should as KSH perspective.