Trying to print out long text

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

Trying to print out long text

R C Intrieri

Hi – I need some help.

 

I have a file that contains 11 items that are 800 characters long.

I have tried these two solutions

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SET WIDTH=600.

LIST variables Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

        /FORMAT =WRAP

        /CASES FROM 1 TO 65.

 

This solution provides with the 11 variables listed in Long view (the way I want it) but it will truncate anything that is longer than 500 chars wide.

 

#2

I have used the next solution

 

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SUMMARIZE

/TABLES=Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

/FORMAT=LIST NOCASENUM NOTOTAL

/TITLE='Case Summaries'

/MISSING=VARIABLE

/CELLS=NONE.

 

It will print all of the text in the variable but prints the 11 vars in columns rather than rows.

 

QUESTION

How do I get all of the text printed in the long form?

===========================================================================
R. C. Intrieri, Ph.D.
Associate Professor
Department of Psychology
1 University Circle
Western Illinois University
Macomb, IL  61455-1390
Office: 309-298-1336 Fax: 309-298-2179

Reply | Threaded
Open this post in threaded view
|

Re: Trying to print out long text

Maguin, Eugene

This line is ambigious “I have a file that contains 11 items that are 800 characters long.” Is each of the 11 items A800 or is the sum of the 11 items 800 characters wide (e.g., 11*A72)??

 

I don’t know what your ultimate end use is but it might work better to use the print command or the write command and write the data to either the output file (using print) or to an external file (using write).

 

On the other hand if each variable is A800 and you want them formatted so that they can be printed on 8.5x11, I think you are going to have to split each variable in to 10 component variables, so from 11 variables to 110 variables, and write/print/list those. Why don’t you tell us what the story is on the variables and somebody can reply.

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R C Intrieri
Sent: Wednesday, February 01, 2012 8:45 PM
To: [hidden email]
Subject: Trying to print out long text

 

Hi – I need some help.

 

I have a file that contains 11 items that are 800 characters long.

I have tried these two solutions

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SET WIDTH=600.

LIST variables Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

        /FORMAT =WRAP

        /CASES FROM 1 TO 65.

 

This solution provides with the 11 variables listed in Long view (the way I want it) but it will truncate anything that is longer than 500 chars wide.

 

#2

I have used the next solution

 

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SUMMARIZE

/TABLES=Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

/FORMAT=LIST NOCASENUM NOTOTAL

/TITLE='Case Summaries'

/MISSING=VARIABLE

/CELLS=NONE.

 

It will print all of the text in the variable but prints the 11 vars in columns rather than rows.

 

QUESTION

How do I get all of the text printed in the long form?

===========================================================================
R. C. Intrieri, Ph.D.
Associate Professor
Department of Psychology
1 University Circle
Western Illinois University
Macomb, IL  61455-1390
Office: 309-298-1336 Fax: 309-298-2179

Reply | Threaded
Open this post in threaded view
|

Re: Trying to print out long text

R C Intrieri

Gene,

 

Thank you for your response.  To clarify there are 11 string variables.

I each variable contains no more than 800 characters.

I want the variables listed in the following fashion

1.       Var1

2.       Var2

3.       Var3

4.       Var4

5.       Etc

 

I don’t have a strong preference for how I do this this.  I have tried to write it to an outfile and have had the same problem in term of the 800 character limit.  There is a possibility that I have done that incorrectly so anyone who has done something like this before and would feel inclined to lead me on to the right path would be welcomed.

 

Bob Intrieri

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gene Maguin
Sent: Thursday, February 02, 2012 9:22 AM
To: [hidden email]
Subject: Re: Trying to print out long text

 

This line is ambigious “I have a file that contains 11 items that are 800 characters long.” Is each of the 11 items A800 or is the sum of the 11 items 800 characters wide (e.g., 11*A72)??

 

I don’t know what your ultimate end use is but it might work better to use the print command or the write command and write the data to either the output file (using print) or to an external file (using write).

 

On the other hand if each variable is A800 and you want them formatted so that they can be printed on 8.5x11, I think you are going to have to split each variable in to 10 component variables, so from 11 variables to 110 variables, and write/print/list those. Why don’t you tell us what the story is on the variables and somebody can reply.

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [hidden email] On Behalf Of R C Intrieri
Sent: Wednesday, February 01, 2012 8:45 PM
To: [hidden email]
Subject: Trying to print out long text

 

Hi – I need some help.

 

I have a file that contains 11 items that are 800 characters long.

I have tried these two solutions

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SET WIDTH=600.

LIST variables Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

        /FORMAT =WRAP

        /CASES FROM 1 TO 65.

 

This solution provides with the 11 variables listed in Long view (the way I want it) but it will truncate anything that is longer than 500 chars wide.

 

#2

I have used the next solution

 

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SUMMARIZE

/TABLES=Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

/FORMAT=LIST NOCASENUM NOTOTAL

/TITLE='Case Summaries'

/MISSING=VARIABLE

/CELLS=NONE.

 

It will print all of the text in the variable but prints the 11 vars in columns rather than rows.

 

QUESTION

How do I get all of the text printed in the long form?

===========================================================================
R. C. Intrieri, Ph.D.
Associate Professor
Department of Psychology
1 University Circle
Western Illinois University
Macomb, IL  61455-1390
Office: 309-298-1336 Fax: 309-298-2179

Reply | Threaded
Open this post in threaded view
|

Re: Trying to print out long text

Maguin, Eugene

Bob,

 

One thing to investigate is ctables. I don’t have this on my present version so I can’t offer specifics but if you do this may work for you because you can arrange the output placement.

 

There may be other ways to do this but I’d cut each variable up into parts and print the parts. Right now you have a wide structure, I assume. A long structure would be more efficient but not necessary. So: I’ll assume a long structure.

 

Vartocases make var from var1 to var11/index=name (var).

 

Vector parts(12,a67).

Loop #i=1,12

+  compute parts(#i)=char.substr(var,(67*(#i-1)+1),67).

End loop.

 

Print / id name parts1  / id name parts2 / id name parts3 / id name parts4 . . . / id name parts12.

Execute.

 

You can adjust the parts format to fit your needs.  A67 will give you some room for an id and the source variable names, perhaps an important consideration. The drawback to this solution is that the splits occur at a specific character position, which, most of the time, will be in the middle of a word. Perhaps Dave or Bruce know a clever, simple way to get the split to be between words.

 

Gene

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R C Intrieri
Sent: Thursday, February 02, 2012 11:58 AM
To: [hidden email]
Subject: Re: Trying to print out long text

 

Gene,

 

Thank you for your response.  To clarify there are 11 string variables.

I each variable contains no more than 800 characters.

I want the variables listed in the following fashion

1.       Var1

2.       Var2

3.       Var3

4.       Var4

5.       Etc

 

I don’t have a strong preference for how I do this this.  I have tried to write it to an outfile and have had the same problem in term of the 800 character limit.  There is a possibility that I have done that incorrectly so anyone who has done something like this before and would feel inclined to lead me on to the right path would be welcomed.

 

Bob Intrieri

 

From: SPSSX(r) Discussion [hidden email] On Behalf Of Gene Maguin
Sent: Thursday, February 02, 2012 9:22 AM
To: [hidden email]
Subject: Re: Trying to print out long text

 

This line is ambigious “I have a file that contains 11 items that are 800 characters long.” Is each of the 11 items A800 or is the sum of the 11 items 800 characters wide (e.g., 11*A72)??

 

I don’t know what your ultimate end use is but it might work better to use the print command or the write command and write the data to either the output file (using print) or to an external file (using write).

 

On the other hand if each variable is A800 and you want them formatted so that they can be printed on 8.5x11, I think you are going to have to split each variable in to 10 component variables, so from 11 variables to 110 variables, and write/print/list those. Why don’t you tell us what the story is on the variables and somebody can reply.

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [hidden email] On Behalf Of R C Intrieri
Sent: Wednesday, February 01, 2012 8:45 PM
To: [hidden email]
Subject: Trying to print out long text

 

Hi – I need some help.

 

I have a file that contains 11 items that are 800 characters long.

I have tried these two solutions

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SET WIDTH=600.

LIST variables Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

        /FORMAT =WRAP

        /CASES FROM 1 TO 65.

 

This solution provides with the 11 variables listed in Long view (the way I want it) but it will truncate anything that is longer than 500 chars wide.

 

#2

I have used the next solution

 

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SUMMARIZE

/TABLES=Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

/FORMAT=LIST NOCASENUM NOTOTAL

/TITLE='Case Summaries'

/MISSING=VARIABLE

/CELLS=NONE.

 

It will print all of the text in the variable but prints the 11 vars in columns rather than rows.

 

QUESTION

How do I get all of the text printed in the long form?

===========================================================================
R. C. Intrieri, Ph.D.
Associate Professor
Department of Psychology
1 University Circle
Western Illinois University
Macomb, IL  61455-1390
Office: 309-298-1336 Fax: 309-298-2179

Reply | Threaded
Open this post in threaded view
|

Re: Trying to print out long text

David Marso
Administrator
"The drawback to this solution is that the splits occur at a
specific character position, which, most of the time, will be in the middle
of a word. Perhaps Dave or Bruce know a clever, simple way to get the split
to be between words."

I don't know whether it's clever, don't know if it's simple BUT ...
Simple adaption of my ancient parsing method.

VARSTOCASES
      /ID = id
      /MAKE trans FROM alpha01 TO alpha10
      /INDEX = Index1(10).

STRING #ALPHA(A67).
/* Change (A255) to (A800) */.
STRING #Trans1(A255).
COMPUTE #Trans1=trans.
LOOP .
COMPUTE #ALPHA=SUBSTR(#trans1,1,67).
COMPUTE #trans1=SUBSTR(#trans1,68).
COMPUTE #=RINDEX(#ALPHA," ").
COMPUTE #trans1=CONCAT(SUBSTR(#ALPHA,#),RTRIM(#trans1)).
COMPUTE #ALPHA=LTRIM(SUBSTR(#ALPHA,1,#)).
PRINT / ID INDEX1 #ALPHA.
END LOOP IF #trans1=" ".

EXE.







Gene Maguin wrote
Bob,



One thing to investigate is ctables. I don't have this on my present version
so I can't offer specifics but if you do this may work for you because you
can arrange the output placement.



There may be other ways to do this but I'd cut each variable up into parts
and print the parts. Right now you have a wide structure, I assume. A long
structure would be more efficient but not necessary. So: I'll assume a long
structure.



Vartocases make var from var1 to var11/index=name (var).



Vector parts(12,a67).

Loop #i=1,12

+  compute parts(#i)=char.substr(var,(67*(#i-1)+1),67).

End loop.



Print / id name parts1  / id name parts2 / id name parts3 / id name parts4 .
. . / id name parts12.

Execute.



You can adjust the parts format to fit your needs.  A67 will give you some
room for an id and the source variable names, perhaps an important
consideration. The drawback to this solution is that the splits occur at a
specific character position, which, most of the time, will be in the middle
of a word. Perhaps Dave or Bruce know a clever, simple way to get the split
to be between words.



Gene









From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R C
Intrieri
Sent: Thursday, February 02, 2012 11:58 AM
To: [hidden email]
Subject: Re: Trying to print out long text



Gene,



Thank you for your response.  To clarify there are 11 string variables.

I each variable contains no more than 800 characters.

I want the variables listed in the following fashion

1.       Var1

2.       Var2

3.       Var3

4.       Var4

5.       Etc



I don't have a strong preference for how I do this this.  I have tried to
write it to an outfile and have had the same problem in term of the 800
character limit.  There is a possibility that I have done that incorrectly
so anyone who has done something like this before and would feel inclined to
lead me on to the right path would be welcomed.



Bob Intrieri



From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gene Maguin
Sent: Thursday, February 02, 2012 9:22 AM
To: [hidden email]
Subject: Re: Trying to print out long text



This line is ambigious "I have a file that contains 11 items that are 800
characters long." Is each of the 11 items A800 or is the sum of the 11 items
800 characters wide (e.g., 11*A72)??



I don't know what your ultimate end use is but it might work better to use
the print command or the write command and write the data to either the
output file (using print) or to an external file (using write).



On the other hand if each variable is A800 and you want them formatted so
that they can be printed on 8.5x11, I think you are going to have to split
each variable in to 10 component variables, so from 11 variables to 110
variables, and write/print/list those. Why don't you tell us what the story
is on the variables and somebody can reply.



Gene Maguin







From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R C
Intrieri
Sent: Wednesday, February 01, 2012 8:45 PM
To: [hidden email]
Subject: Trying to print out long text



Hi - I need some help.



I have a file that contains 11 items that are 800 characters long.

I have tried these two solutions

SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SET WIDTH=600.

LIST variables Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

        /FORMAT =WRAP

        /CASES FROM 1 TO 65.



This solution provides with the 11 variables listed in Long view (the way I
want it) but it will truncate anything that is longer than 500 chars wide.



#2

I have used the next solution



SORT CASES BY seqid1.

TEMPORARY.

SPLIT FILE SEPARATE BY seqid1.

SUMMARIZE

/TABLES=Imp1 Imp2 Imp3 Imp4 Imp5 Imp6 Imp7 Imp8 Imp9 Imp10 Imp11

/FORMAT=LIST NOCASENUM NOTOTAL

/TITLE='Case Summaries'

/MISSING=VARIABLE

/CELLS=NONE.



It will print all of the text in the variable but prints the 11 vars in
columns rather than rows.



QUESTION

How do I get all of the text printed in the long form?

===========================================================================
R. C. Intrieri, Ph.D.
Associate Professor
Department of Psychology
1 University Circle
Western Illinois University
Macomb, IL  61455-1390
Office: 309-298-1336 Fax: 309-298-2179
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"