[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

655.0. "<CR><LF> Infestation" by SMAUG::MENDEL (Pessimists Always Get Good News.) Fri Jan 08 1988 10:19

    Did you ever edit a RUNOFF-produced .MEM file, and seen all those
    silly 
, or <CR><LF>, characters at the ends of the records. 
    
    We used to have a procedure to zap them into normality, that uses
    TECO. Something like:

    $	open/write  tmp  'tempfile'
    $	write tmp "@ER/''infile'/ @EW/''outfile'/"
    $	write tmp "EX"
    $	close tmp
    $	mcr teco @'tempfile'
    
    ... and it worked great until VMS V5 was put on the system. Now
    TECO doesn't work, because VAX-RSX isn't installed. 
    
    Since it seemed to me to be overkill to need to do this, I've been
    scratching my head on how to create a new procedure. 
    
    So I learned some TPU.
    
    Here's the question: With TPU, I can get the CRLFs out, but the
    record attributes don't change. I need them to be "carriage return
    carriage control" instead of "none" or "print file carriage control".
    
    How can I change it? Please don't say "write a program" - something
    that can be done from DCL is preferable. Something that can be done
    in batch. Perhaps TPU isn't the answer. Is there another way I can
    do it? 
    
    Kevin 
    
    P.S. My TPU method:
     
    
    $ 	tpu = "EDIT/TPU"
    $ 	define sys$output nl: !stop ugly info messages
    $ 	tpu /nosection/nodisplay/command=sys$input: 'infile' /output='outfile'

   	PROCEDURE fixitup

	    LOCAL
		crlf_count,
		crlf,
		crlf_range;

	    ON_ERROR
		fixitup := crlf_count;
		RETURN;
	    ENDON_ERROR;
	
	    crlf := ASCII(13) + ASCII(10);

	    LOOP
		crlf_range := SEARCH( crlf, FORWARD);
		ERASE( crlf_range );
		crlf_count := crlf_count + 1;
		POSITION( END_OF( crlf_range ) );
	    ENDLOOP;

	ENDPROCEDURE;
	
	input_file := GET_INFO( COMMAND_LINE, 'file_name' );
	result_file := GET_INFO( COMMAND_LINE, 'output_file' );

	main_buffer := CREATE_BUFFER( 'main', input_file );
	POSITION( BEGINNING_OF( main_buffer ) );

	IF ( fixitup > 0 ) OR ( input_file <> result_file )
	THEN
		WRITE_FILE( main_buffer, result_file )
	ENDIF;

	QUIT;	
                      
    $	exit
T.RTitleUserPersonal
Name
DateLines
655.1STAR::PIPERDerrell Piper - VAX/VMS DevelopmentFri Jan 08 1988 10:211
    VMS V5 ships with a native mode TECO.  You no longer need VAX/RSX.
655.2SMAUG::MENDELPessimists Always Get Good News.Fri Jan 08 1988 10:233
    We just installed IFT2 of VMS V5.0 - no TECO. Where is it?
    
    Kevin
655.3EDIT/TECO does the trickFROST::W_PIPERbill piper 266-4393Fri Jan 08 1988 11:166
    $ EDIT/TECO
    
    invokes TECO32.EXE.  Looks like TECO32 does most of the work in
    SYS$SHARE:TECOSHR.EXE.  Does this mean we have callable TECO now?
    
    -piper
655.4SMAUG::MENDELPessimists Always Get Good News.Fri Jan 08 1988 12:172
    I may go back to TECO, but I am still curios on how to change the
    record attributes.
655.5You've got the first part, here's the restMDVAX3::COARM��se ChoreographerFri Jan 08 1988 12:459
    To get the correct record attributes, use
    
    $ convert document.mem document.doc/fdl=sys$input
    record
    	carriage_control carriage return
    ^Z
    $ 
    
    #ken	:-)}
655.6no programming necessaryCSC32::M_AMBERMark Amber, VMS/C x4739Fri Jan 08 1988 18:5427
RE: .-1
>   	carriage_control carriage return
                                ^^^
    probably a typo, but the above should be:
    
    	carriage_control carriage_return
                                ^^^
RE: all
    and if you want to bypass TPU and TECO altogether, use a 3-step
    convert
    
    $ convert document.mem document.tmp/fdl=sys$input
    record
    format undefined
    ^Z
    $ convert document.tmp document.tmp/fdl=sys$input
    record
    format stream
    carriage_control carriage_return
    ^Z
    $ convert document.tmp document.txt/fdl=sys$input
    record
    format variable
    ^Z
    
    actually, you could stop after step-2, but step-3 is for perfectionists
655.7VIDEO::LEICHTERJJerry LeichterSat Jan 09 1988 12:0413
To return to an earlier topic:  Yes, there's a fully-native TECO that will
ship with V5; yes, its main image is TECO32, not TECO, which is why MCR TECO
will fail (but MCR TECO32 will succeed); yes, it is fully callable, supporting
the standard callable editor interface (so CALLABLE_TECO will work as your
MAIL editor, for example), plus a bunch of other calls to provide a pretty
complete interface between TECO and other progarmming languages; and, yes,
Digital has it now - it runs on V4, and has done so for quite some time.

All give a big hand to Rick Murphy, who did the port.

For more information, see the TECO notesfile on DSSDEV.

							-- Jerry
655.8@I/A title for your reply/UFP::MURPHYRick - WA1SPT/4Sat Jan 09 1988 21:264
    Thanks, Jerry....
    To use it, any of EDIT/TECO or TECO:==$TECO32 or DEFINE TECO TECO32
    will do it for you. For VMS V4 systems, the kit is at UFP::TECO32$KIT:
    	-Rick
655.9Thank you, all. SMAUG::MENDELPessimists Always Get Good News.Tue Jan 12 1988 12:030
655.10SMAUG::MENDELPessimists Always Get Good News.Wed Jan 13 1988 09:3112
    RE: .6
    
    	I gripe. 
    
    	I ran the procedure, that used only CONVERT, and it worked with
    	VMS V4.7.   
    
    	So I copied it onto my V5 system, and it didn't work - all
    	the records were concatenated together, then divied up into
    	512 byte ones.
    
    	Hmmm...
655.11SMAUG::MENDELPessimists Always Get Good News.Wed Jan 13 1988 09:526
    ... but don't let me imply that it was a VMSV5 problem.
    
    Basically, the reason that the file got re-organized seems to be
    that there were no CRLF's in the first place. 
    
    The TPU-followed by-CONVERT method seems to be working on all cases.
655.12.0 says there were CRLF in the first placeCSC32::M_AMBERMark Amber, VMS/C x4739Wed Jan 13 1988 13:305
  >    ... but don't let me imply that it was a VMSV5 problem.
    
    It works for me on FT5.0 (X5.0-3N2).
    If it didn't, it *would* be a VMS (convert) problem.

655.13An error in CONVERT?EAGLE1::DANTOWITZwon, to, tree, for, ...Thu Jan 28 1988 11:1658

    I tried what was recommended in .6 and found what looks like a bug. 

    After the <FF> below is the data file I use.  After the second <FF>
    is the result I get from a VMS 4.6 system.   The last line of the file
    is getting messed up.

David

    Here is the command file I use:

$ convert 'P1 $cvtrec.tmp/fdl=sys$input
record
format undefined
$EOD
$ convert $cvtrec.tmp $cvtrec.tmp/fdl=sys$input
record
format stream
carriage_control carriage_return
$EOD
$ convert $cvtrec.tmp 'P1/fdl=sys$input
record
format variable
$eod
$ delete $cvtrec.tmp;*







         ___ ___ ___ ___ ___ ___ ___

        |   |   |   |   |   |   |   | 

        | d | i | g | i | t | a | l |   I N T E R O F F I C E  M E M O

        |___|___|___|___|___|___|___|





        also  checks to see that both machines get xyzzy abcdef faults

        on the same pages (order independent).



             To enable xyzzy abcdef fault checking, the user must  add

        the  /TNV qualifier to GENERATE, PRINT, and VERIFY, as well as

        /VIRTUAL_MACHINE=ON to GENERATE and PRINT.




         ___ ___ ___ ___ ___ ___ ___
        |   |   |   |   |   |   |   | 
        | d | i | g | i | t | a | l |   I N T E R O F F I C E  M E M O
        |___|___|___|___|___|___|___|


        also  checks to see that both machines get xyzzy abcdef faults
        on the same pages (order independent).

             To enable xyzzy abcdef fault checking, the user must  add
        the  /TNV qualifier to GENERATE, PRINT, and VERIFY, as well as
        /VIRTUAL_MACHINE=ON to GENERATE and PRI
NT.