Re: Q: Mass Text convert Linux-DOS?
Jonathan Gift wrote: ... I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. ... for file in ~/documents; do recode latin1..ibmpc $file done find ~/documents -type f -exec recode latin1..ibmpc '{}' \; see man find don't forget to backup before you experiment! erik
Re: Q: Mass Text convert Linux-DOS?
On Fri, Mar 30, 2001 at 08:07:43AM +0200, Jonathan Gift wrote: Hi, I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. I tried the following but it only acted on the top level of directories and not the files and subdirectories below. Any help greatly appreciated: - Snip - for file in ~/documents; do recode latin1..ibmpc $file done - Snip - Something like: find ~/documents -type f -exec recode latin1..ibmpc \{} \; No backups are made with this incantation! Others may have nicer scripts... -- Eric G. Miller egm2@jps.net
Re: Q: Mass Text convert Linux-DOS?
On Fri, Mar 30, 2001 at 08:07:43AM +0200, Jonathan Gift wrote: I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. You should try todos and fromdos in the sysutils package. I tried the following but it only acted on the top level of directories and not the files and subdirectories below. Any help greatly appreciated: - Snip - for file in ~/documents; do recode latin1..ibmpc $file done - Snip - find ~/documents -exec todos {} \; man find. Learn all about find. Rob -- Good day to avoid cops. Crawl to school.
Re: Q: Mass Text convert Linux-DOS?
On Thu, 29 Mar 2001, Erik Steffl wrote: Jonathan Gift wrote: ... I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. ... for file in ~/documents; do recode latin1..ibmpc $file done find ~/documents -type f -exec recode latin1..ibmpc '{}' \; see man find don't forget to backup before you experiment! erik You can also recursively *zip* into directories using the the zip LF CR conversion options, then unzip. This is not really what zip is for and it is a problem if you are short on disk disk space but it a way to do what you want. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Q: Mass Text convert Linux-DOS?
On Fri, 30 Mar 2001, Christopher Mosley wrote: On Thu, 29 Mar 2001, Erik Steffl wrote: Jonathan Gift wrote: ... I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. ... for file in ~/documents; do recode latin1..ibmpc $file done find ~/documents -type f -exec recode latin1..ibmpc '{}' \; see man find don't forget to backup before you experiment! erik You can also recursively *zip* into directories using the the zip LF CR conversion options, then unzip. This is not really what zip is for and it is a problem if you are short on disk disk space but it a way to do what you want. Just woke up. This of course for line endings, not character conversion. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
RE: Q: Mass Text convert Linux-DOS?
Jonathan, The command /usr/vin/fromdos will convert text files from/to dos. I think it might be easier to use than recode. Good luck. -mk -Original Message- From: Christopher Mosley [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2001 12:18 PM To: Erik Steffl Cc: Debian List Subject: Re: Q: Mass Text convert Linux-DOS? On Thu, 29 Mar 2001, Erik Steffl wrote: Jonathan Gift wrote: ... I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. ... for file in ~/documents; do recode latin1..ibmpc $file done find ~/documents -type f -exec recode latin1..ibmpc '{}' \; see man find don't forget to backup before you experiment! erik You can also recursively *zip* into directories using the the zip LF CR conversion options, then unzip. This is not really what zip is for and it is a problem if you are short on disk disk space but it a way to do what you want. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Q: Mass Text convert Linux-DOS?
On Fri, Mar 30, 2001 at 08:07:43AM +0200, Jonathan Gift wrote: Hi, I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. I tried the following but it only acted on the top level of directories and not the files and subdirectories below. Any help greatly appreciated: - Snip - for file in ~/documents; do recode latin1..ibmpc $file done - Snip - this'll preserve your original files under the new names *.unix, creating dos-like rc/lf line-endings in the new instances... perl -i.unix -pe 's:\n:\r\n:' * subdir*/*files*/*yada* -- does a brain cell think? [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!
Re: Q: Mass Text convert Linux-DOS?
On Fri, Mar 30, 2001 at 05:02:27PM -0600, will trillich wrote: On Fri, Mar 30, 2001 at 08:07:43AM +0200, Jonathan Gift wrote: I have a great many text files I have to convert from Linux to DOS format. I tries recode by hand once but it took hours. There has to be an automatic way. I tried the following but it only acted on the top level of directories and not the files and subdirectories below. Any help greatly appreciated: - Snip - for file in ~/documents; do recode latin1..ibmpc $file done - Snip - this'll preserve your original files under the new names *.unix, creating dos-like cr/lf line-endings in the new instances... perl -i.unix -pe 's:\n:\r\n:' * subdir*/*files*/*yada* and for catching all occurrences in all subdirectories recursively, try find . -type f -print0 | xargs -0 perl -i.x -pe 's:\n:\r\n:' `find` is wonderful. especially with `xargs`. NOTE -- this adds CR before any LF, even if there's already one there. hopefully it won't reformat your root partition. use at your own risk. play nice with others. learn a musical instrument. -- does a brain cell think? [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!