Date: Tue, 4 Oct 2011 12:10:50 -0700
Reply-To: Bruce Weaver <bruce.weaver@hotmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Bruce Weaver <bruce.weaver@hotmail.com>
Subject: Re: export variable as matrix (ASCII)
In-Reply-To: <1317744245282-4869261.post@n5.nabble.com>
Content-Type: text/plain; charset=us-ascii
The "fine manual" entry for WRITE (under MATRIX - END MATRIX) is a bit short
on examples, and the /FIELD sub-command is somewhat confusing. But the
following seems to work okay.
data list list / var1 to var3 (3f5.0).
begin data
1 7 13
2 8 14
3 9 15
4 10 16
5 11 17
6 12 18
end data.
MATRIX.
GET X /VARIABLES VAR1.
WRITE RESHAPE(x,3,2)
/OUTFILE = 'C:\temp\neu.txt'
/FIELD = 1 TO 10 BY 5
/FORMAT = f5.0.
Print x.
Print RESHAPE(x,3,2).
END MATRIX.
Cheers,
Bruce
SPSS-user-Austria wrote:
>
> Thanks a lot for your answers!
>
> With the first command (Compute) I had no success?!
>
> The second hint works but not satisfying..
> Here it is (in case of my example)..
>
> MATRIX.
> GET X /VARIABLES VAR1.
> WRITE RESHAPE(x,3,2)
> / OUTFILE=' D:\....\test\neu.txt'
> / FIELD = 1 TO 2 BY 2.
> Print x. *for immediate correction in the SPSS-output
> END MATRIX.
>
> The output (now as .txt file) is still a columnvector, but why?
> 1
> 2
> 3
> 4
> 5
> 6
>
> I assume that I did a mistake using the Field subcommand?!
>
> Hope you can help me once again!
> Thanks a million!
>
> holger
>
-----
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."
NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/export-variable-as-matrix-ASCII-tp4868248p4869991.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD