PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > fixing .txt files sent from a MS$ user
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

fixing .txt files sent from a MS$ user

Réponse
 
LinkBack Outils de la discussion
Vieux 04/04/2008, 16h50   #1
Douglas A. Tutty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut fixing .txt files sent from a MS$ user

Hello all,

My niece sends some of her schoolwork to my wife (e.g. essays) for her
to read. First she sent .doc files which I can't access properly (no, I
do no run OO) although I could get the jist. I then suggested that she
send plain text.

I don't run any locales but have LANG=C.

Her plain-text files are fine, except that apostrophies (singel-quote)
(') are replaced with "\222", opening quotes (") with "\223", and
closing quotes (") with "\224".

Other than writing a python script, can someone give me a simple command
to fix this so that it is not so distracting? Ideally, I'd put it into
an executable file and pipe the file through it on it's way to lpr.

e.g.
$ cool-writing.txt | antiAJ | lpr -Pepson

Thanks,

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 16h50   #2
André César de Sá
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

Use dos2unix.

//Megatron

On 04/04/2008, Douglas A. Tutty <dtutty@porchlight.ca> wrote:
> Hello all,
>
> My niece sends some of her schoolwork to my wife (e.g. essays) for her
> to read. First she sent .doc files which I can't access properly (no, I
> do no run OO) although I could get the jist. I then suggested that she
> send plain text.
>
> I don't run any locales but have LANG=C.
>
> Her plain-text files are fine, except that apostrophies (singel-quote)
> (') are replaced with "\222", opening quotes (") with "\223", and
> closing quotes (") with "\224".
>
> Other than writing a python script, can someone give me a simple command
> to fix this so that it is not so distracting? Ideally, I'd put it into
> an executable file and pipe the file through it on it's way to lpr.
>
> e.g.
> $ cool-writing.txt | antiAJ | lpr -Pepson
>
> Thanks,
>
> Doug.
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>



--
Regards,
//Megatron


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 16h50   #3
Douglas A. Tutty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

On Fri, Apr 04, 2008 at 11:39:55AM -0400, Douglas A. Tutty wrote:
> My niece sends some of her schoolwork to my wife (e.g. essays) for her
> to read. First she sent .doc files which I can't access properly (no, I
> do no run OO) although I could get the jist. I then suggested that she
> send plain text.
>
> I don't run any locales but have LANG=C.
>
> Her plain-text files are fine, except that apostrophies (singel-quote)
> (') are replaced with "\222", opening quotes (") with "\223", and
> closing quotes (") with "\224".
>
> Other than writing a python script, can someone give me a simple command
> to fix this so that it is not so distracting? Ideally, I'd put it into
> an executable file and pipe the file through it on it's way to lpr.
>
> e.g.
> $ cool-writing.txt | antiAJ | lpr -Pepson


Here is a sample line from one of the files:


inside. I’m tired of the term “Best Friends” because what does it

I see in vim that \222 is ~R, \223 is ~S, and \224 is ~T. It is on the
printout (lpd/apsfilter/enscript) that the numbers come out.

Thanks,

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 17h00   #4
Douglas A. Tutty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

On Fri, Apr 04, 2008 at 04:42:28PM +0100, Andr? C?sar de S? wrote:

> On 04/04/2008, Douglas A. Tutty <dtutty@porchlight.ca> wrote:
> > Hello all,
> >
> > My niece sends some of her schoolwork to my wife (e.g. essays) for her
> > to read. First she sent .doc files which I can't access properly (no, I
> > do no run OO) although I could get the jist. I then suggested that she
> > send plain text.
> >
> > I don't run any locales but have LANG=C.
> >
> > Her plain-text files are fine, except that apostrophies (singel-quote)
> > (') are replaced with "\222", opening quotes (") with "\223", and
> > closing quotes (") with "\224".
> >
> > Other than writing a python script, can someone give me a simple command
> > to fix this so that it is not so distracting? Ideally, I'd put it into
> > an executable file and pipe the file through it on it's way to lpr.
> >
> > e.g.
> > $ cool-writing.txt | antiAJ | lpr -Pepson


>> Use dos2unix.


Doesn't that just change CR/LF?

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 17h00   #5
Nelson Castillo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

> Other than writing a python script, can someone give me a simple command
> to fix this so that it is not so distracting? Ideally, I'd put it into
> an executable file and pipe the file through it on it's way to lpr.
>
> e.g.
> $ cool-writing.txt | antiAJ | lpr -Pepson


I use recode.

cp cool-writing.txt tmp.txt

recode dos..latin1 tmp.txt

Check if it works. Recode is in the official Debian repository.

N.-

--
http://arhuaco.org


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 17h20   #6
John Hasler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

Douglas writes:
> My niece sends some of her schoolwork to my wife (e.g. essays) for her to
> read. First she sent .doc files which I can't access properly (no, I do
> no run OO)


Try Abiword.
--
John Hasler


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 17h40   #7
Sven Joachim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

On 2008-04-04 17:57 +0200, John Hasler wrote:

> Douglas writes:
>> My niece sends some of her schoolwork to my wife (e.g. essays) for her to
>> read. First she sent .doc files which I can't access properly (no, I do
>> no run OO)

>
> Try Abiword.


s/b/nt/ :-)

No complex library dependencies, no X necessary, startup time close to
zero, and the text from your M$ document is displayed just fine.
Antiword can also generate Postscript or HTML output.

Sven


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 04/04/2008, 18h00   #8
Kevin B. McCarty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

Douglas A. Tutty wrote:

> Hello all,
>
> My niece sends some of her schoolwork to my wife (e.g. essays) for her
> to read. First she sent .doc files which I can't access properly (no, I
> do no run OO) although I could get the jist. I then suggested that she
> send plain text.
>
> I don't run any locales but have LANG=C.
>
> Her plain-text files are fine, except that apostrophies (singel-quote)
> (') are replaced with "\222", opening quotes (") with "\223", and
> closing quotes (") with "\224".
>
> Other than writing a python script, can someone give me a simple command
> to fix this so that it is not so distracting? Ideally, I'd put it into
> an executable file and pipe the file through it on it's way to lpr.
>
> e.g.
> $ cool-writing.txt | antiAJ | lpr -Pepson


Use tr? It's a very simple program meant for exactly this kind of task.
The first argument is the list of characters to replace, and the second
is the list of characters (in order) to replace them with.

tr "\222\223\224" \'\"\" < cool-writing.txt | lpr -Pepson

N.B. the ' and " characters need to be escaped from the shell in the
second argument on the command line above.

tr is even in "coreutils" so you don't have to install anything extra.

best regards,

--
Kevin B. McCarty <kmccarty@gmail.com>
WWW: http://www.starplot.org/
WWW: http://people.debian.org/~kmccarty/
GPG: public key ID 4F83C751


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH9lw4fYxAIk+Dx1ERAuDMAKDCVigOsgyQaobAwdkXlI 8cdyiGFgCgulIc
16RLuWh7zgePqFdY8lPjmxo=
=M11d
-----END PGP SIGNATURE-----

  Réponse avec citation
Vieux 04/04/2008, 18h40   #9
Mumia W..
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

On 04/04/2008 10:47 AM, Douglas A. Tutty wrote:
> On Fri, Apr 04, 2008 at 11:39:55AM -0400, Douglas A. Tutty wrote:
>> My niece sends some of her schoolwork to my wife (e.g. essays) for her
>> to read. First she sent .doc files which I can't access properly (no, I
>> do no run OO) although I could get the jist. I then suggested that she
>> send plain text.
>>
>> I don't run any locales but have LANG=C.
>>
>> Her plain-text files are fine, except that apostrophies (singel-quote)
>> (') are replaced with "\222", opening quotes (") with "\223", and
>> closing quotes (") with "\224".
>>
>> Other than writing a python script, can someone give me a simple command
>> to fix this so that it is not so distracting? Ideally, I'd put it into
>> an executable file and pipe the file through it on it's way to lpr.
>>
>> e.g.
>> $ cool-writing.txt | antiAJ | lpr -Pepson

>
> Here is a sample line from one of the files:
>
>
> inside. I’m tired of the term “Best Friends†because what does it
>
> I see in vim that \222 is ~R, \223 is ~S, and \224 is ~T. It is on the
> printout (lpd/apsfilter/enscript) that the numbers come out.
>
> Thanks,
>
> Doug.
>
>


That seems to be in Microsoft code page 1250 (cp1250). Install 'recode'
and do this:

recode cp1250..ascii < email.txt

I hope that s! :-)



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 05/04/2008, 01h30   #10
Douglas A. Tutty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

On Fri, Apr 04, 2008 at 06:33:27PM +0200, Sven Joachim wrote:
> On 2008-04-04 17:57 +0200, John Hasler wrote:
>
> > Douglas writes:
> >> My niece sends some of her schoolwork to my wife (e.g. essays) for her to
> >> read. First she sent .doc files which I can't access properly (no, I do
> >> no run OO)

> >
> > Try Abiword.

>
> s/b/nt/ :-)
>
> No complex library dependencies, no X necessary, startup time close to
> zero, and the text from your M$ document is displayed just fine.
> Antiword can also generate Postscript or HTML output.


I know about antiword and have it. It still misses some things which is
why I asked her to send plain text.

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 05/04/2008, 02h10   #11
Douglas A. Tutty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: fixing .txt files sent from a MS$ user

On Fri, Apr 04, 2008 at 12:29:44PM -0500, Mumia W.. wrote:
> On 04/04/2008 10:47 AM, Douglas A. Tutty wrote:
> >On Fri, Apr 04, 2008 at 11:39:55AM -0400, Douglas A. Tutty wrote:
> >>My niece sends some of her schoolwork to my wife (e.g. essays) for her
> >>to read. First she sent .doc files which I can't access properly (no, I
> >>do no run OO) although I could get the jist. I then suggested that she
> >>send plain text.


> That seems to be in Microsoft code page 1250 (cp1250). Install 'recode'
> and do this:
>
> recode cp1250..ascii < email.txt


Thanks, I had an "ambiguous" error re linefeeds and just tried the other
cp's and found that cp1258 works fine.

thanks.

doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h24.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17509 seconds with 19 queries