data transformation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

data transformation

vlad simion
Hi all,

I have some data that looks like this:

   item1 brand1     7.41 item1 brand2     7.59 item1 brand3     7.92 item1
brand4     7.65 item2 brand1     7.78 item2 brand2     7.59 item2 brand3
8.02 item2 brand4     7.71 item3 brand1     7.93 item3 brand2     8.04 item3
brand3     7.60 item3 brand4     7.62

and I would like to have it like this:

     item1 item2 item3 brand1     7.41     7.78     7.93 brand2     7.59
7.59     8.04 brand3     7.92     8.02     7.60 brand4     7.65     7.71
7.62

can anyone help?

Many thanks!

Vlad.
--
Vlad Simion
Data Analyst
Tel:      +40 720130611
Reply | Threaded
Open this post in threaded view
|

Re: data transformation

Maguin, Eugene
Vlad,

Perhaps I misunderstand your question. But, if not, you should read the
documentation for the Save command.

As to your example, I'll assume that 7.41 is the value of a variable, x1,
7.59 is the value of x2, etc. I'll assume that 'item 1', 'brand 1', etc are
the variable names of values. Furthermore, these values are elements of one
data record.

   item1 brand1     7.41 item1 brand2     7.59 item1 brand3     7.92 item1
brand4     7.65 item2 brand1     7.78 item2 brand2     7.59 item2 brand3
8.02 item2 brand4     7.71 item3 brand1     7.93 item3 brand2     8.04 item3
brand3     7.60 item3 brand4     7.62

and I would like to have it like this:

     item1 item2 item3 brand1     7.41     7.78     7.93 brand2     7.59
7.59     8.04 brand3     7.92     8.02     7.60 brand4     7.65     7.71
7.62

It seems that what you want to do is to rearrange the order of the variables
in the data file.

Save outfile='<your file name>'/keep=item1 item2 item3 brand1 x1 x5 x8, etc.

Gene Maguin