Posted by
Maguin, Eugene on
URL: http://spssx-discussion.165.s1.nabble.com/How-data-entry-for-TURF-analysis-tp4635246p4656985.html
Robert,
I think it would be very helpful to all of us if you would post either sample
data or example (made-up but structurally the same) data, along with detailed
processing instructions. It's just too hard to visualize correctly otherwise.
However, given what you have said, in so far as i understand it, i wonder if
python will be more powerful (I assume that it can used to read a file into an
spss structure). That said, as near as i remember the reread command, it can be
used to reread the current line and, i think, the documentation (CSR not the
online version) clearly illustrates that point. It seems that you want to reread
more than the current line. A possible alternative is to read the file as text
records. Maybe each line in the input file would correspond to a spss record.
Depending on many things, you might be able to use standard spss syntax functions
to take apart a record and reassemble it correctly structured. Again, and if you
wind up going this route, i'll just bet anything that python is far more powerful
than syntax.
All that is speculation. Please post sample/example data.
Gene Maguin
On Mon 08/01/11 12:29 PM , "Roberts, Michael"
[hidden email]
sent:
> Good Morning List,
>
> I am trying to build cases out of a file but am not very familiar with the
> reread function, so would appreciate any help with building cases out of
> raw data files with the following format:
> Data are text files with variable length records - not all fields are
> included in each record. Fields are delimited by the hex equivalent of '1C'
> and sometimes fields are followed by delimited comments, so they may appear
> as fields as well. There does not appear to be any pattern as to where the
> comments appear, except they are preceded by "FY" or
> "FQ" and have commas, hyphens, and periods interspersed
> throughout. Each record begins with a hex equivalent of '2' and ends with
> '3' (non printing characters); I can modify these, that is not a
> problem.
> I have tried doing this using Input Program, but lack of familiarity with
> "reread", my result is not applicable to the different files
> having different formats - very limited!
> Here is what I would like know: How would I go about looping through each
> record, building a case up, unless I find the comment, then reread past the
> comment, continue to build the case until I reach the end of the record,
> then reread in order to put the comment at the end of the case I am
> building?
> TIA
> Mike
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LIS
>
[hidden email] (not to SPSSX-L), with no body text except
> thecommand. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
>
>
>
>
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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