Re: Reread - How can I create a case using reread?

Posted by Rich Ulrich on
URL: http://spssx-discussion.165.s1.nabble.com/How-data-entry-for-TURF-analysis-tp4635246p4657250.html

Why is there a need to do a re-read?

Read what you have as String and put the parts into a new set of variables,
placing the comments in the last variable if that is what you want;
and ignore the variables that you initially read in.  Why not?

You can apply a formatted read to any substring, if you want the
numeric translations.  That seems neater than generating a
complex format  on the fly, for re-read (if that is even possible).

When you Save File, delete the original text variable.

--
Rich Ulrich

> Date: Mon, 1 Aug 2011 12:29:05 -0400

> From: [hidden email]
> Subject: Reread - How can I create a case using reread?
> To: [hidden email]
>
> 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?
>