Thanks Bradly and Matt, but I think I've misexplained myself.
I know how to deal with the problem at hand manually, but I need the
file itself to be ready to go when it's offered for download. The file
is to be read by a piece of software that most likely won't appreciate
non-Windows newlines (testing this tomorrow morning to see if I have a
problem at all), so I need it done by the webapp.
Facts that might help:
- I'm using Rails, in case it has some awesome way of dealing with it.
- I _could_ run a shell command on it, as the webapp will be running on
a Linux/BSD webserver with all the common tools (Perl, sed, etc.), and
I'd be happy to install something if need be.
Thanks a bunch, guys!
Nik Kantar
Web Engineer
MIPS Computation
[EMAIL PROTECTED]
7964-C Arjons Drive
San Diego, Ca 92126-4392
tel +1 858/530.0400 x24
fax +1 858/530.2226
Bradly wrote:
Also, If you are downloading the file via FTP/SFTP and before opening
in Notepad, be sure you aren't transfering the file as binary. When
you transfer a file as ASCII, most clients will convert line endings
for you.
-Bradly
On 4/30/07, *Matt Bosworth* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
From the vim manual :
You can use the 'fileformat' option to convert from one file format to
another. Suppose, for example, that you have an MS-DOS file named
README.TXT
that you want to convert to UNIX format. Start by editing the MS-DOS
format
file:
vim README.TXT
Vim will recognize this as a dos format file. Now change the file
format to
UNIX:
:set fileformat=unix
:write
The file is written in Unix format.
http://www.vim.org/htmldoc/usr_23.html
unix, dos, and mac are the options available for fileformat
Hope that helps,
-Matt
On Apr 30, 2007, at 6:51 PM, Nik Kantar wrote:
> Hey all,
>
> I'm doing something similar to a cart, but instead of a checkout
> process I'm saving things to a file on the server and offering it
> for download. The problem is that the newlines aren't quite what I
> need them to be.
>
> When the created file is opened in Gvim, all looks well, but when I
> try the same with Notepad, there's an ugly symbol (a capital V
> above a capital T) at the end of every line.
>
> This apparently has to do with the differences between Unix and Dos
> newlines (\n vs \r\n, respectively), but I've been unable to figure
> it out.
>
> Advice?
>
> Thanks in advance.
>
> --
> Nik Kantar
> Web Engineer
> MIPS Computation
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> 7964-C Arjons Drive
> San Diego, Ca 92126-4392
> tel +1 858/530.0400 x24
> fax +1 858/530.2226
>
> _______________________________________________
> Sdruby mailing list
> [email protected] <mailto:[email protected]>
> http://lists.sdruby.com/mailman/listinfo/sdruby
>
_______________________________________________
Sdruby mailing list
[email protected] <mailto:[email protected]>
http://lists.sdruby.com/mailman/listinfo/sdruby
------------------------------------------------------------------------
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby