NB: Time column is having more other values,product can be more also .Measures are only these 3 values and stores are more store1,store2,store3....like this
I have a few to questions pose in response first:-
Is this homework/assignment? There are specific forums for these.
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
What are your preferred tools? (C, shell, perl, awk, etc.)
What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?
There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.
We're all here to learn and getting the relevant information will help us all.
I am using Linux server to achieve this and trying with shell. I tried split function along with awk also. But I am not getting desired out put.
I tried to traverse each record with something like (i=1;i<=n;i++) {$2=s;print}} and when it will encounter the 3rd pipe it will sort the data afterwards in columnar fashion.
Your spec is a bit inconsistent, a delimiter is missing between "store" and "Dollar" in the header; and also the delimiter count at line end differs between header and data lines. However, try