Thread View: news.software.readers
6 messages
6 total messages
Started by Tomasz Tatar
Wed, 17 Nov 1999 00:00
slrn/slrnpull - CR/LF at end of line
Author: Tomasz Tatar
Date: Wed, 17 Nov 1999 00:00
Date: Wed, 17 Nov 1999 00:00
17 lines
1233 bytes
1233 bytes
Hello! I'm using slrn on Linux at home. I used to download news with slrnpull for Linux and bring them home to read off-line. Now, I have to use slrnpull for Windows, which works fine, but changes end of line in articles - adds CR (^M, dec(13)), which is useless for later reading on Linux. Do you know how could I make slrnpull not to do it (configuration, recompilation)? I'm using slrn precompiled for Windows by Chin Huang. Thanks in advance, regards! -- Tomasz Tatar
Re: slrn/slrnpull - CR/LF at end of line
Author: Sylvan Butler
Date: Wed, 17 Nov 1999 00:00
Date: Wed, 17 Nov 1999 00:00
22 lines
1869 bytes
1869 bytes
On Wed, 17 Nov 1999 10:10:34 GMT, Tomasz Tatar <tatar@comarch.pl> wrote:
>Now, I have to use slrnpull for Windows, which works fine, but
>changes end of line in articles - adds CR (^M, dec(13)), which
>is useless for later reading on Linux. Do you know how could
>I make slrnpull not to do it (configuration, recompilation)? I'm
Probably needs recompile to use "binary" file open. Not worth it.
I'd recommend using linux to simply strip the CR from the line endings.
This might be as simple as "tr -d '\r'" (but that will remove every CR,
not just those on line endings... usually you will be fine with that).
sdb
--
| Sylvan Butler | Not speaking for Hewlett-Packard | sbutler-boi.hp.com |
| Watch out for my e-mail address. Thank UCE. #### change ^ to @ #### |
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. --Benjamin Franklin, 1759
"Don't Tread On Me!"
Re: slrn/slrnpull - CR/LF at end of line
Author: John E. Davis
Date: Thu, 18 Nov 1999 00:00
Date: Thu, 18 Nov 1999 00:00
14 lines
1309 bytes
1309 bytes
On Thu, 18 Nov 1999 16:07:15 GMT, Tomasz Tatar <tatar@comarch.pl> wrote: >But tr has to be run for each file and moreover with redirecting to >other file and changing name. When getting 1000 or more articles, >it's a bit confusing. Does exist something like tr or sed, but working >on multiple files (tr * or (better) tr news/* news/*/* news/*/*/* or (best) >tr -R news)? Maybe find -exec? But it's still a bit complicated... How are you transferring the files? If you use zip, then you can control the line endings via a zip/unzip parameter. --John
Re: slrn/slrnpull - CR/LF at end of line
Author: Tomasz Tatar
Date: Thu, 18 Nov 1999 00:00
Date: Thu, 18 Nov 1999 00:00
22 lines
1571 bytes
1571 bytes
Sylvan Butler wrote: >Probably needs recompile to use "binary" file open. Not worth it. > >I'd recommend using linux to simply strip the CR from the line endings. >This might be as simple as "tr -d '\r'" (but that will remove every CR, >not just those on line endings... usually you will be fine with that). > But tr has to be run for each file and moreover with redirecting to other file and changing name. When getting 1000 or more articles, it's a bit confusing. Does exist something like tr or sed, but working on multiple files (tr * or (better) tr news/* news/*/* news/*/*/* or (best) tr -R news)? Maybe find -exec? But it's still a bit complicated... Regards, -- Tomasz Tatar
Re: slrn/slrnpull - CR/LF at end of line
Author: Sylvan Butler
Date: Thu, 18 Nov 1999 00:00
Date: Thu, 18 Nov 1999 00:00
41 lines
2632 bytes
2632 bytes
On Thu, 18 Nov 1999 16:07:15 GMT, Tomasz Tatar <tatar@comarch.pl> wrote:
>Sylvan Butler wrote:
>>I'd recommend using linux to simply strip the CR from the line endings.
>>This might be as simple as "tr -d '\r'" (but that will remove every CR,
>>not just those on line endings... usually you will be fine with that).
>>
>But tr has to be run for each file and moreover with redirecting to
>other file and changing name. When getting 1000 or more articles,
Or redirecting to a temporary file and moving the result back to replace
the original if it succeeds.
>it's a bit confusing. Does exist something like tr or sed, but working
>on multiple files (tr * or (better) tr news/* news/*/* news/*/*/* or (best)
>tr -R news)? Maybe find -exec? But it's still a bit complicated...
That's what scripts are for. Something like:
tr-news-article:
#!/bin/bash
echo "Processing $1"
tr -d '\r' < $1 > /tmp/tr.$$ && mv -f /tmp/tr.$$ $1
called by (possibly in another script):
find news -type f -exec tr-news-article \{\} \;
(I wrote all that on the fly with no testing. YMMV)
If you keep older articles in the tree, you may want to add some
date/time checking into find as an optimization to prevent processing
the same articles multiple times.
sdb
--
| Sylvan Butler | Not speaking for Hewlett-Packard | sbutler-boi.hp.com |
| Watch out for my e-mail address. Thank UCE. #### change ^ to @ #### |
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. --Benjamin Franklin, 1759
"Don't Tread On Me!"
Re: slrn/slrnpull - CR/LF at end of line
Author: Matthew Malthouse
Date: Mon, 22 Nov 1999 00:00
Date: Mon, 22 Nov 1999 00:00
37 lines
1820 bytes
1820 bytes
On Sun, 21 Nov 1999 22:35:34 -0800 Gary Jones wrote: } On Wed, 17 Nov 1999 10:10:34 GMT, Tomasz Tatar wrote: } > Now, I have to use slrnpull for Windows, which works fine, but } > changes end of line in articles - adds CR (^M, dec(13)), which } > is useless for later reading on Linux. } } Isn't there a gizmo for doing just this sort of file conversion? I vaguely } remember seeing one when I was installing RH the other week. Recode: from the info... GNU `recode' ************ `recode' converts files between character sets and usages. When exact transliterations are not possible, it may get rid of the offending characters or fall back on approximations. This program recognizes or produces nearly 150 different character sets and is able to transliterate files between almost any pair. Most RFC 1345 character sets are supported. The current `recode' release is 3.4.1. I have aliases for # alias dos2unix='recode ibmpc:lat1' # alias unix2dos='recode lat1:ibmpc' Matthew -- "Nice boy, but about as sharp as a sack of wet mice." -- Foghorn Leghorn http://www.calmeilles.demon.co.uk
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