[Info-vax] *.xml files - carriage return's go into file in VMS - how to remove CR's?

G Cornelius cornelius at eisner.decus.invalid
Thu Apr 2 12:16:01 EDT 2009


Phillip Helbig---remove CLOTHES to reply wrote:
> In article <00A89268.655AB6AA at SendSpamHere.ORG>, VAXman- 
> @SendSpamHere.ORG writes: 
> 
> 
>>In article <gqire8$d6$1 at mailhub227.itcs.purdue.edu>, Chuck Aaron <caaron at ceris.purdue.edu> writes:
>>
>>>Since we have a lot of these *.xml text files, is there
>>>a command file with convert commands that will work on
>>>a large number of files quicker?
>>
>>Put that into an editor init file.
> 
> 
> TECO might be the quickest here.  I think it's enough to just fire up 
> TECO on the file then immediately exit.

$ EDIT/TECO myfile.txt
*EX$$

$ ! Note that the '*' is TECO's prompt.  The '$$' is actually a
$ ! double ESCAPE (or ^[^[ if your keyboard doesn't have a true
$ ! ESCAPE key) - this is TECO's command line terminator.

> 
> If Elliott is still around, maybe he'll give some expert advice.
> 

$ !
$ ! Here's my shot at it - uses TECO in a loop.
$ !
$ ! [Not for the faint of heart.  You may want to do this after making
$ ! sure all your files are backed up and that you don't have BYPASS or
$ ! SYSPRV enabled).
$ !
$ create/dir [.junk]
$ copy *.com;0/lo [.junk]*.*;*   ! Copy to a subdir
%COPY-S-COPIED, MAILBOX:[PROGRAMMERS.CORNELIUS]LOGIN.COM;18 copied to MAILBOX:[P
ROGRAMMERS.CORNELIUS.JUNK]LOGIN.COM;18 (4 blocks)
%COPY-S-COPIED, MAILBOX:[PROGRAMMERS.CORNELIUS]XXX.COM;1 copied to MAILBOX:[PROG
RAMMERS.CORNELIUS.JUNK]XXX.COM;1 (1 block)
%COPY-S-NEWFILES, 2 files created
$ set def [.junk]  ! Work in subdir only
$ !
$ ! Enter TECO and execute a loop to wildcard thru *.com;-0
$ ! [uses LOWEST version in case we have to abort and restart -
$ ! we set things up so *.com;-0 is the base for the edits].
$ !
$ !  @en/wildspec/  ! Sets up wildcard spec !
$ !  <some teco code>  ! A TECO loop !
$ !  @:en//;        ! Get next filename. ';' => exit loop on failure     !
$ !  ^A something ^A  ! Echo given text !
$ !  :G*            ! Display special q-register '*' = current file name !
$ !  @eb/^Eq*/      ! Open for edit using filename from @:en// op        !
$ !  ec             ! Flush infile to outfile and close                  !
$ !  hk ek ex       ! Quick exit: erase buffer, kill outfile, exit       !
$ !  $$             ! Double ESCAPE terminator                           !
$ !
$ edit/teco/nomem
*hk ek
@en/*.com;-0/
<@:en//; ^A >>> ^A :G* ^A >>>
^A
@eb/^Eq*/ ec
>
$$
 >>> MAILBOX:[PROGRAMMERS.CORNELIUS.JUNK]LOGIN.COM;18 >>>
 >>> MAILBOX:[PROGRAMMERS.CORNELIUS.JUNK]XXX.COM;1 >>>
*hkekex
$$
$ dir/sin/date/siz/wid=file:45

Directory MAILBOX:[PROGRAMMERS.CORNELIUS.JUNK]

LOGIN.COM;19                                          4   2-APR-2009 10:18:46.79
XXX.COM;2                                             1   2-APR-2009 10:18:46.81

Total of 2 files, 5 blocks.


George



More information about the Info-vax mailing list