How can I read a text file with Quiz under UNIX?

Robert J.M. Edis robert.edis@creatcomp.com
Mon, 21 Feb 2000 19:21:11 -0500


Thanks to all who offered assistance. :)) <-- double chin?

I added a 1 byte filler to the end of the record definition and it now works
fine.  The trick is one can't 'see' the explicit CR in VI, MORE, CAT or
other UNIX tool but PH can.

I tried the dd solution suggested but to no avail.

Regards,

Blue


-----Original Message-----
From: Rohde Dirk (Van)
To: 'Robert J.M. Edis'; 'powerh-l@list.swau.edu'
Sent: 2/21/00 4:51 PM
Subject: RE: How can I read a text file with Quiz under UNIX?

You probably need to account for a single character at the end of the
file,
which is your carriage return.  Just add a one character filler field at
the
end and you should be able to read the file properly using quiz.  You
can
also convert it using the Unix "dd" command with the "unblock" option to
drop the carriage returns before reading it with quiz.

-----Original Message-----
From: Robert J.M. Edis [mailto:robert.edis@creatcomp.com]
Sent: Monday, February 21, 2000 1:11 PM
To: 'powerh-l@list.swau.edu'
Subject: How can I read a text file with Quiz under UNIX?


G'day all

Environment:  HP/UX 10.20, PH 7.33.D3

I need to read a data file created in MS Excel.  In VI I can 'see' that
data
quite nicely and I created a record layout in the dictionary to match
what I
see in the editor.

First of all I saved the spreadsheet data as a .PRN file.  I then used
TextPad 4.0 to strip the header and footer records so I only had data
records.  The editor tells me the last byte is in column 77.

I then used WRQ FTP mode to copy the file to the HP/UX box where I
inspected
the contents using both MORE and VI.  The transfer looked ok.

I created the record layout as follows:

FILE gemini_adns          &
  ORGANIZATION SEQUENTIAL &
  TYPE UNIXIO             &
  CREATE                  &
  OPEN "ChartAccts.prn"

RECORD gemini_adns        
  ITEM old_accountno      &
    DATATYPE CHARACTER Size 12
  ITEM gem_acct_desc      &
    DATATYPE CHARACTER Size 36
  ITEM gem_account        &
    DATATYPE CHARACTER Size 9
  ITEM gem_func_code      &
    DATATYPE CHARACTER Size 3
  ITEM gem_anal_code      &
    DATATYPE CHARACTER Size 1
  ITEM gem_mgnt_code      &
    DATATYPE CHARACTER Size 3
  ITEM gem_prod_line      &
    DATATYPE CHARACTER Size 7
  ITEM gem_loc_code       &
    DATATYPE CHARACTER Size 6

The problem I have is that QUIZ does not appear to reD the file
correctly.
For example, if I do a simple REPORT old_accountno I get:

    Old
  Account
  Number

  10105100099
  
10111000000
  0
1013010100
  80
101301019
  880

when VI shows me the data as:

10105100099
10111000000
10130101000
10130101999

The value '880' is the last 3 bytes of the record in all four cases.

I would realy appreciate any help offered by the PH/UNIX gurus out
there.

Regards

Blue
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= =
Subscribe: "subscribe powerh-l" in message body to
majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to
majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.