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

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

3327.0. "anyone got a program to remove <cr>'s ???" by UBEAUT::MANDERSON (Monday oneday, Tuesday the next) Thu Jan 11 1990 22:37

    I have a heap of files from my old cpm system that I have transferred
    to the amiga - but with the Amiga only wanting <lf> on the end of text
    lines and cpm putting <cr><lf> I get double line spacing.
    
    Does anyone have a a program to remove the offending <cr>'s from a
    file. 
    
    any assistance much appreciated 
    regards
    	kevin
T.RTitleUserPersonal
Name
DateLines
3327.1How's this?SMAUG::SPODARYKBinary ThrottleFri Jan 12 1990 02:0711
    Just the other day I wrote a quick C program to do that.
    It currently removes _most_ characters < ASCII 32 (space),
    but I can certainly modify it to remove CRs and leave
    TABs, ESCs, etc.  It's very basic, but should do the job for you.
    
    I'll get it compiled on my Amiga, and then I'll upload it
    to:
    
    	whammy::dka300:[public]strip.zoo
    
    ~Steve
3327.2thanksUBEAUT::MANDERSONMonday oneday, Tuesday the nextFri Jan 12 1990 03:012
    mucho appreciated.
    kevin
3327.3I assume you mean for the AmigaMSVAX::BARRETTWho is Steve Dahl?Fri Jan 12 1990 03:034
    Re: .0
    
    On one of the FISH disks is a series of 3 programs that will remove
    or replace CR, LF, CRLF (forget which disk offhand).
3327.4any ideas on the names?UBEAUT::MANDERSONMonday oneday, Tuesday the nextFri Jan 12 1990 03:044
    I had a hunt thru the fisk and couldn't find it - any idea of thye
    names??
    
    thanks kevin
3327.5TxEdLEVERS::PLOUFFcan't memorize Zen...Fri Jan 12 1990 13:326
    The TxEd editor has a menu selection to strip carriage returns,
    and the version I got came with two standalone conversion programs,
    one to strip CRs and one to insert them (before transfer to MS-DOS
    machines).  No doubt TxEd Plus offers this feature too.
    
    Wes
3327.6BOMBE::MOOREBaN CaSe_sEnSiTiVe iDeNtIfIeRs!Fri Jan 12 1990 22:321
    It's in the Dillon collection on Fish disks 168 & 169.
3327.7Matt Dillon beat me to it...SMAUG::SPODARYKBinary ThrottleSat Jan 13 1990 06:2965
    Oh well, I just finished my new version ( I like late night hacking ;^).
    
    It's located at whammy::dka300:[public]strip.zoo
    
    and here's the README...
    
    ~Steve
    ------
    
Makeshift README pulled from the comments...

/*
 * Stephen Spodaryk - 12-jan-1989
 * smaug::spodaryk 
 * spodaryk@smaug.dec.com
 *
 * strip.c -
 *
 *   A program to strip unwanted characters out of an ASCII file.
 *
 *   Takes several arguments.  $ strip infile outfile ...
 *
 *   The characters to strip must be specified after the outfile.
 *
 *       They can be specified in several forms.
 *
 *            alphabetic:      A     Z     g     %
 *            hexadecimal:  0x41  0x5A  0x67  0x25
 *            decimal:      0d65  0d90 0d103  0d37
 *
 *	 The '0d' and '0x' allow me to differentiate between 
 *       possible ambiguities such as '0' and 0.  Should the 
 *       character '0' be removed, or should the NULL character?
 *
 *       They may also be specified as a range of start - finish
 *       using combinations of the legal formats, such as:
 *
 *             A - 0x5A
 *          0d65 - Z  
 *
 *   To remove the "-" character, just specify it after a range,
 *   or as the first character.  That will work fine.
 *
 *   The error handling is fairly good, but semi-unforgiving.  Use
 *   a format as shown above, and don't try things like "nerd",
 *   or 0x$#c.  They will be fatal.  
 *   
 *   General Tips:
 *
 *   Also note that on some systems specifying wildcard characters
 *   such as * or % will be expanded before the program is invoked.
 *   This will usually yield undesireable results.  To play it safe
 *   you might want to use quotes around the character, like so "*".
 *
 *   I have also encountered some systems ( I won't mention which )
 *   that will uppercase the arguments before passing them to the
 *   program.  Again, if this it true of your environment, use 
 *   quotes to preserve case.
 * 
 *   It's written in 'standard' C.  There are probably things I
 *   should add, but it's really quite late.  If you find a bug,
 *   let me know (or fix it yourself).  Hope it's a help.
 *
 */
    
3327.8thanks steveUBEAUT::MANDERSONMonday oneday, Tuesday the nextSun Jan 14 1990 18:523
    a million thanks to steve for helping me out.
    
    kevin
3327.9STRIP.ZOO still available?AKOV11::SMITHReality, just a visible imagination?Tue Apr 10 1990 15:1314
    Re .7
    
    Steve, 
    
    Can you post STRIP.ZOO to TAPE::USER2:[UPLOAD]?  I tried to access it
    in the location you specified but no luck.  Does it compile on a VAX?
    I have some text files with hard <CR> and <LF> (^M and ^J) imbeded that
    I'd like to remove.  Can your STRIP handle this?  How would you specify
    the <CR> and <LF> characters?
    
    
    Thanx,
    
    ...Ed
3327.10now available at TAPE::USER2:[UPLOAD]strip.zooWHAMMY::SPODARYKBinary ThrottleTue Apr 10 1990 19:1725
Sure thing.

The `readme' file:

  Usage: $ strip infile outfile ...

    Where ... is a character, a hex or decimal value, or a range.

    Ie: $ strip infile outfile 0d0 - 0x09 0x0B a - z

    will strip characters 0 through 9, 11, and lowercase a to z

So, to get rid of <CR> use 0d13 or 0x0D
                  <LF> use 0d10 or 0x0A

$ strip infile outfile 0d13 0d10

strip.c will compile nicely for VMS (/standard=portable even :^). 
Just remember to use a foreign command. (VMS$ strip := $disk:[dir]strip.exe)
For more info, see the opening documentation.  It's not pretty, but it works.

Steve

--I should have probably allowed some mnemonics like CR, FF, LF, ESC...
  but I wanted to keep the CLI parsing real simple.  Maybe I'll do that.
3327.11VMS version, works like a charm...AKOV11::SMITHReality, just a visible imagination?Wed Apr 11 1990 13:439
Thanx Steve,

I complied a VMS version and it works great.  If anyone else is interested I 
uploaded STRIP.EXE to TAPE::USER2:[UPLOAD]


Cheers,

...Ed