Original Usenet thread from alt.ascii-art, started 8 Mar 1995.
_ _ _ _ _ _ | | | |___ ___ _ __ ___| |_ / \ _ __ ___| |__ (_)_ _____ | | | / __|/ _ \ '_ \ / _ \ __| / _ \ | '__/ __| '_ \| \ \ / / _ \ | |_| \__ \ __/ | | | __/ |_ / ___ \| | | (__| | | | |\ V / __/ \___/|___/\___|_| |_|\___|\__| /_/ \_\_| \___|_| |_|_| \_/ \___|
Request: Script to Remove Trailing Blanks
alt.ascii-art
· 4 messages · 8 Mar 1995 - 9 Mar 1995
Well, seeing as I received so much help from Tony about the centering text script, I figured I'd ask about another. One thing that I seem to spend a lot of time doing is manually removing trailing blanks from ASCII pics. So, what I'm asking is: does anyone have a script that does this, or does anyone have any ideas on how to go about it (Tony? ;) )? Thanks for any help. :) Oh, I've just had an idea: I could just mail it through the Figlet mailing list... :-) ___ _ _a' /( <. Simon Bradley, Knight Protector! / __><_>._ _ _ ___ ._ _ ~~ _}\ \( _ ) E-mail: syb...@aber.ac.uk \__ \| || ' ' |/ . \| ' | \(._(.)' Finger: syb...@osfb.aber.ac.uk <___/|_||_|_|_|\___/|_|_| ._>. _>. WWW: http://www.aber.ac.uk/~syb3/
Well, seeing as I received so much help from Tony about the centering text script, I figured I'd ask about another. One thing that I seem to spend a lot of time doing is manually removing trailing blanks from ASCII pics. So, what I'm asking is: does anyone have a script that does this, or does anyone have any ideas on how to go about it (Tony? ;) )? Thanks for any help. :) Oh, I've just had an idea: I could just mail it through the Figlet mailing list... :-) ___ _ _a' /( <. Simon Bradley, Knight Protector! / __><_>._ _ _ ___ ._ _ ~~ _}\ \( _ ) E-mail: syb...@aber.ac.uk \__ \| || ' ' |/ . \| ' | \(._(.)' Finger: syb...@osfb.aber.ac.uk <___/|_||_|_|_|\___/|_|_| ._>. _>. WWW: http://www.aber.ac.uk/~syb3/
In article <3jl8gk$oi...@gagme.wwa.com>, Simon Bradley <syb...@aber.ac.uk> wrote: > > Well, seeing as I received so much help from Tony about the centering >text script, I figured I'd ask about another. One thing that I seem to spend >a lot of time doing is manually removing trailing blanks from ASCII pics. So, >what I'm asking is: does anyone have a script that does this, or does anyone >have any ideas on how to go about it (Tony? ;) )? Thanks for any help. :) Oh, >I've just had an idea: I could just mail it through the Figlet mailing >list... :-) > ___ _ _a' /( <. Simon Bradley, Knight Protector! > / __><_>._ _ _ ___ ._ _ ~~ _}\ \( _ ) E-mail: syb...@aber.ac.uk > \__ \| || ' ' |/ . \| ' | \(._(.)' Finger: syb...@osfb.aber.ac.uk > <___/|_||_|_|_|\___/|_|_| ._>. _>. WWW: http://www.aber.ac.uk/~syb3/ If you are using ms-win. I can mail you my utility to do the job. Sy
syb...@aber.ac.uk (Simon Bradley) writes: > Well, seeing as I received so much help from Tony about the centering >text script, I figured I'd ask about another. One thing that I seem to spend (Funny... I've only seen the first of my messages about this posted so far... I presume the other one with *both* scripts will eventually appear in rec.arts.ascii. We don't carry the alt.[*]ascii.* groups here)-: >a lot of time doing is manually removing trailing blanks from ASCII pics. So, >what I'm asking is: does anyone have a script that does this, or does anyone >have any ideas on how to go about it (Tony? ;) )? Thanks for any help. :) Oh, >I've just had an idea: I could just mail it through the Figlet mailing >list... :-) Hehe... why didn't you ask me directly Simon? :-))) Ok, instead of awk, let's use sed... ========8<----cut-all-above-this-line-and-keep-all-below------- #!/bin/sh # # stripspaces # # Strip trailing spaces from the end of input lines. # Tony Nugent T.N...@sct.gu.edu.au tnu...@gucis.cit.gu.edu # sed -e 's/[\ ]*$//' ========8<----cut-all-below-this-line-and-keep-all-above------- Easy, no? :) To understand the syntax of the regular expression used there, refer to the man pages for ed (and sed, grep, awk, etc). Oh, for those that may ask (as I had a couple of people ask about my awk centering scripts), this (once again) is a unix shell script. Cut it out and save as a file, then "chmod +x stripspaces" to make it exectuable. The script will then take either standard input or a file redirected into it, and output the result on standard output (which can then be piped to something else or sent to a new file or appened to an existing one). example% cat asciipic.txt | stripspaces >>! fixed.pics or, better still: example% stripspaces < asciipic.txt >>! fixed.pics which does the same thing without a useless use of cat... file asciipic.txt will be sent to the script to strip the spaces off the end of each line, then the result appended to the file fixed.pics; this file will be created if it didn't already exist. If you use vi, then the following ex command will filter the current file through the script: :1,$!stripspaces (Ain't vi powerful? I use vim btw, an *excellent* vi clone! :) My apologies to those that already know these unix basics. IF YOU USE DOS: ~~~~~~~~~~~~~~ This script (and the awk ones posted earlier that center lines) can be easily adapted for any decent dos ports of sed (and awk). Such animals can be found at garbo or SimTel (or their many mirror sites): oak.oakland.edu :: /SimTel/msdos/gnuish/ (or ~/textutil/ or ~/fileutil/). (Check the file 00_index.txt in each dir). garbo.uwasa.edu :: /pc/txtutil/ (or /pc/fileutil/ etc). (Again, check the file 00index.txt). BTW, dos ports of awk can be found in the same places, as well as the /SimTel/msdos/awk/ directory. Cheers Tony Tony Nugent Griffith University, Brisbane, Queensland, Australia // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \': | \\ // | :,\\': | \\ // | :,\\': | \': | \\ // | :,\\': | \\ | | \\ // | | // \\ | | \\ // | | // \\ | |\\ | | \\ // | | // \\ | \\ | :,\\': | // \\ | :,\\': | // \\ | \\ | :,\\': | // \\ \\ // \\ // \\ // \\ // \\ \\ // \\ // \\ T.N...@sct.gu.edu.au tnu...@gucis.cit.gu.edu.au
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
|\/\/\/| | | | | | (o)(o) C _) | ,___| | / /____\
|HHHHH/"\"\HHHHHHH| |HH`\|_.-)'|/'dP,H| |Hb.`\\_/_//'.oddH| |HHHb|`.\/\,'|HHHH| |HHHHHb/\/\/|HHHHH| |"""""""""""""""""| | |"" /\ \ / |"" | | |__/--\ \/ __| |
_________
/___ ___\
//@@@\ /@@@\\
\\@@@/ \@@@//
\___ " ___/
| - |
\_/ jrjc ______
/|_||_\`.__
( _ _ _\
=`-(_)--(_)-'
hjw .="=. _/.-.-.\_ ( ( o o ) ) |/ " \| \'---'/jgs /`"""`\\
_________ | _____ |\ | |\ ___| | \ | | | | | | | | |___| | | \ | |____\| | \|_________| Andy Johnson
Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this thread.
These messages were posted publicly to the newsgroup
alt.ascii-art
in 1995 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.
Report this message
Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.