From: mmccaws2 on
My users are will be uploading a file from unix. I'm trying to save a
step by formatting the file while in unix so they don't have to format
it with

"perl -p -e 's/\r/\r\n/' < $infile > $dosfile"

The resulting file after copied to windows did not have a readable
format. Is this a process that can only be done after the file
transfer?

Mike
From: Joost Diepenmaat on
mmccaws2 <mmccaws(a)comcast.net> writes:

> My users are will be uploading a file from unix. I'm trying to save a
> step by formatting the file while in unix so they don't have to format
> it with
>
> "perl -p -e 's/\r/\r\n/' < $infile > $dosfile"
>
> The resulting file after copied to windows did not have a readable
> format. Is this a process that can only be done after the file
> transfer?

No, you're doing it wrong.

*ON UNIX*, you can do:

perl -p -e 's/\n/\r\n/' < $infile > $dosfile

Final results are dependent on the transfer protocol (i.e. do NOT
transfer those files with FTP in ASCII mode).

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
From: Colin B. on
mmccaws2 <mmccaws(a)comcast.net> wrote:
> My users are will be uploading a file from unix. I'm trying to save a
> step by formatting the file while in unix so they don't have to format
> it with
>
> "perl -p -e 's/\r/\r\n/' < $infile > $dosfile"
>
> The resulting file after copied to windows did not have a readable
> format. Is this a process that can only be done after the file
> transfer?

Unless I'm missing something, you should just be able to do:
$unix2dos $infile > $outfile

Colin
From: Rich Grise on
On Tue, 08 Apr 2008 22:12:18 +0200, Joost Diepenmaat wrote:

> mmccaws2 <mmccaws(a)comcast.net> writes:
>
>> My users are will be uploading a file from unix. I'm trying to save a
>> step by formatting the file while in unix so they don't have to format
>> it with
>>
>> "perl -p -e 's/\r/\r\n/' < $infile > $dosfile"
>>
>> The resulting file after copied to windows did not have a readable
>> format. Is this a process that can only be done after the file
>> transfer?
>
> No, you're doing it wrong.
>
> *ON UNIX*, you can do:
>
> perl -p -e 's/\n/\r\n/' < $infile > $dosfile
>
> Final results are dependent on the transfer protocol (i.e. do NOT
> transfer those files with FTP in ASCII mode).

What's wrong with
$ todos < $infile > $dosfile
?

Thanks,
Rich


From: mmccaws2 on
On Apr 8, 1:54 pm, Rich Grise <r...(a)example.net> wrote:
> On Tue, 08 Apr 2008 22:12:18 +0200, Joost Diepenmaat wrote:
> > mmccaws2 <mmcc...(a)comcast.net> writes:
>
> >> My users are will be uploading a file from unix. I'm trying to save a
> >> step by formatting the file while in unix so they don't have to format
> >> it with
>
> >> "perl -p -e 's/\r/\r\n/' < $infile > $dosfile"
>
> >> The resulting file after copied to windows did not have a readable
> >> format. Is this a process that can only be done after the file
> >> transfer?
>
> > No, you're doing it wrong.
>
> > *ON UNIX*, you can do:
>
> > perl -p -e 's/\n/\r\n/' < $infile > $dosfile
>
> > Final results are dependent on the transfer protocol (i.e. do NOT
> > transfer those files with FTP in ASCII mode).
>
> What's wrong with
> $ todos < $infile > $dosfile
> ?
>
> Thanks,
> Rich

we're using scp that comes on HPUX. The results did seem to change.

Mike