Thread View: news.software.nn
4 messages
4 total messages
Started by Noel Estabrook
Tue, 06 Apr 1993 11:09
Concatenate, uudecode in nn?
Author: Noel Estabrook
Date: Tue, 06 Apr 1993 11:09
Date: Tue, 06 Apr 1993 11:09
7 lines
1031 bytes
1031 bytes
I _know you can concatenate and uudecode files in nn to save a lot of time, but how? Can someone help? -- Noel Estabrook - MSU __|__ Men do not reject the Bible because nestabro@nova.gmi.edu | it contradicts itself, but because it Instructional Design | contradicts them -- II Timothy 3:16 It is easier to fight for one's principles than to live up to them.
Re: Concatenate, uudecode in nn? [yet another script to do it]
Author: Ian Phillipps
Date: Tue, 06 Apr 1993 12:55
Date: Tue, 06 Apr 1993 12:55
90 lines
3471 bytes
3471 bytes
nestabro@nova.gmi.edu (Noel Estabrook) writes:
>I _know you can concatenate and uudecode files in nn to save a lot of
>time, but how? Can someone help?
Here's the script I use (there are lots more like this floating
around). Mine has some pretty hairy heuristics in it, but I don't
know of any failures with actual postings. Assuming that you've an
appropriate sort option in place, you can pipe this the whole of,
say, comp.binaries.etc.etc and it will do the right thing.
(a) What do you mean, you don't have perl? Get it!
(b) Yes, I know perl can do uudecode, but I wrote this before it could.
---- cut here ---- (I resisted the temptation to uuencode this...)
#!/usr/bin/perl
# Attempt to join up uuencoded stuff
# Should work with most formats
$debug++ if $ARGV[0] eq '-d' && shift;
$rejects++ if $ARGV[0] eq '-r' && shift;
$stdout++ if $ARGV[0] eq '-t' && shift;
sub reject
{
return unless $debug;
print STDERR "Rejected ($_[0]): \"$_\"\n";
print STDERR join(' ',unpack('c*',$_));
}
file:
while(1)
{
#DEBUG# print stderr "file started";
while(<>)
{ $file=$1, last if /^begin +[0-9]* +([^ ]+)\n/ ; }
exit if eof();
print STDERR " $file\n";
if ( $stdout )
{ *OUT = *STDOUT; }
else
{ open( OUT, "|uudecode" ) || die "Can't do uudecode - " . $!; }
#DEBUG# open( OUT, ">judout" ) || die "Can't do uudecode";
print OUT $_;
line:
while(<>)
{
# Deal with the usual case first, allowing for checksum/not
if ( /^M/ && ( length($_) == 62 || length($_) == 63 ) )
{ print OUT; next; };
if( /^end/ )
{
print STDERR " .. closed" if $debug;
print OUT;
close OUT;
next file;
}
( &reject(0), next ) unless /^[ -`]+.?\n$/;
# Now some hairy heuristics
$bytes = unpack('c',$_) - 32;
$bytes = 0 if $bytes == 64;
# Total number of chars expected including the prefix and newline
$chars = int( ( $bytes + 2 )/3 )*4 + 2;
print STDERR ">$_< $bytes $chars ",length($_),"\n" if $debug;
( &reject(1) , next ) if $chars != length($_) && $chars != length($_)-1;
( &reject(2), next ) if $chars > 61;
( &reject(3), next ) if $chars < 0;
( &reject(4), next ) if /^ +/;
if ( /^ \n$/ )
{
# This could be spurious, or a genuine penultimate line
$_ = <>;
print OUT " \n" if /^end/;
#DEBUG# print STDERR "Single blank followed by '$_'\n";
redo line;
}
print STDOUT "Short line: accepted $_\nUnpacked:",join(' ',unpack('c*',$_)) if $rejects;
# OK but short
print OUT $_;
}
}
--
Ian Phillipps, Unipalm Ltd, 216 Science Park, Phone +44 223 420002
Milton Road, Cambridge, CB4 4WA, England. Phax +44 223 426868
PIPEX is a division of Unipalm Ltd. - phone 0223 424616.
Re: Concatenate, uudecode in nn?
Author: Sven Guckes
Date: Tue, 06 Apr 1993 14:45
Date: Tue, 06 Apr 1993 14:45
11 lines
1063 bytes
1063 bytes
nestabro@nova.gmi.edu (Noel Estabrook) writes: >I know you can concatenate and uudecode files in nn to save a lot of time, > but how? Mark all parts of a uuencoded file and type ":decode". Then follow the jumping ball. ;-) For additional info look for ":decode" in the man page. Sven@news.software.nn :)
Re: Concatenate, uudecode in nn?
Author: Fuzzy Fox
Date: Tue, 06 Apr 1993 18:14
Date: Tue, 06 Apr 1993 18:14
15 lines
1503 bytes
1503 bytes
In <nestabro.734094572@nova> nestabro@nova.gmi.edu (Noel Estabrook) writes: >I _know you can concatenate and uudecode files in nn to save a lot of >time, but how? Can someone help? Select the articles and give the command :decode The articles need to appear in order on the selection screen. If they don't, then give the :sort lexical command. -- David DeSimone | Rules of Creative Research: fox@convex.com | 1) Never draw what you can copy. If I said it, it | 2) Never copy what you can trace. must be my opinion | 3) Never trace what you can cut out and paste down.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads