Home All Groups Group Topic Archive Search About

Converting File Formats (Unix to Windows)

Author
7 Jun 2006 9:35 PM
VC
Hi,
Greetings. Not sure if this is the right forum..... In case I should visit
some other forum please let me know.

Does Dot.NET provide a quick method/way to convert a UNIX text file to DOS
format?

Cheers!!!
V

Author
7 Jun 2006 9:40 PM
Kevin Spencer
The short and sweet of it is, Unix text files use "\n" (LineFeed) for CRLFs.
Windows uses "\r\n" (CarriageReturn-LineFeed). Simplest explanation is,
replace "\n" with "\r\n".

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

Show quote
"VC" <letters***@yahoo.com> wrote in message
news:eJaMVpniGHA.4204@TK2MSFTNGP02.phx.gbl...
> Hi,
> Greetings. Not sure if this is the right forum..... In case I should visit
> some other forum please let me know.
>
> Does Dot.NET provide a quick method/way to convert a UNIX text file to DOS
> format?
>
> Cheers!!!
> V
>
Author
7 Jun 2006 9:50 PM
bcaller
Yep, just open the file and replace each \n with \r\n
______________
Compilr the online C, C#, VB.NET, Fortran compiler
http://www.caller.me.uk/Compilr
Author
7 Jun 2006 10:49 PM
VC
Thanks for your time Caller and Kevin. Appreciate it much.
I guess I have to do it the "Simple" way.... and replace "\n" with "\r\n"...

Cheers!!!
V!
<bcal***@gmail.com> wrote in message
Show quote
news:1149717042.925211.311300@h76g2000cwa.googlegroups.com...
> Yep, just open the file and replace each \n with \r\n
> ______________
> Compilr the online C, C#, VB.NET, Fortran compiler
> http://www.caller.me.uk/Compilr
>
Author
8 Jun 2006 1:04 AM
GhostInAK
Hello Kevin,

I'm commenting here without testing... but:
I do believe the StreamReader.ReadLine() function will read a single line
from a unix-encoded text file.  So open the unix filestream in Read mode..
open an output filestream in Write mode.. and then in a loop do something
like: 
Writer.WriteLine(Reader.ReadLine())

-Boo

Show quote
> The short and sweet of it is, Unix text files use "\n" (LineFeed) for
> CRLFs. Windows uses "\r\n" (CarriageReturn-LineFeed). Simplest
> explanation is, replace "\n" with "\r\n".
>
> Kevin Spencer
> Microsoft MVP
> Professional Chicken Salad Alchemist
> A lifetime is made up of
> Lots of short moments.
> "VC" <letters***@yahoo.com> wrote in message
> news:eJaMVpniGHA.4204@TK2MSFTNGP02.phx.gbl...
>
>> Hi,
>> Greetings. Not sure if this is the right forum..... In case I should
>> visit
>> some other forum please let me know.
>> Does Dot.NET provide a quick method/way to convert a UNIX text file
>> to DOS format?
>>
>> Cheers!!!
>> V
Author
8 Jun 2006 10:46 AM
Kevin Spencer
Yes, you are correct. The ReadLine() function detects the type of line feed
used by the file, and reads the line excluding the line feed. This is also
an excellent way to accomplish the task.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

Show quote
"GhostInAK" <ghosti***@gmail.com> wrote in message
news:be1391bf48148c8586b8301ffd8@news.microsoft.com...
> Hello Kevin,
>
> I'm commenting here without testing... but:
> I do believe the StreamReader.ReadLine() function will read a single line
> from a unix-encoded text file.  So open the unix filestream in Read mode..
> open an output filestream in Write mode.. and then in a loop do something
> like:  Writer.WriteLine(Reader.ReadLine())
>
> -Boo
>
>> The short and sweet of it is, Unix text files use "\n" (LineFeed) for
>> CRLFs. Windows uses "\r\n" (CarriageReturn-LineFeed). Simplest
>> explanation is, replace "\n" with "\r\n".
>>
>> Kevin Spencer
>> Microsoft MVP
>> Professional Chicken Salad Alchemist
>> A lifetime is made up of
>> Lots of short moments.
>> "VC" <letters***@yahoo.com> wrote in message
>> news:eJaMVpniGHA.4204@TK2MSFTNGP02.phx.gbl...
>>
>>> Hi,
>>> Greetings. Not sure if this is the right forum..... In case I should
>>> visit
>>> some other forum please let me know.
>>> Does Dot.NET provide a quick method/way to convert a UNIX text file
>>> to DOS format?
>>>
>>> Cheers!!!
>>> V
>
>
Author
8 Jun 2006 10:46 AM
Leon Lambert
Try textimp from
http://whiskeyclone.sourceforge.net/downloads.php

It a simple fast little utility that adds a shell extention. Once
installed you just right click on a file in windows explorer and chooses
  Win -> Unix or Win <- Unix

Hope this helps
Leon Lambert

VC wrote:
Show quote
> Hi,
> Greetings. Not sure if this is the right forum..... In case I should visit
> some other forum please let me know.
>
> Does Dot.NET provide a quick method/way to convert a UNIX text file to DOS
> format?
>
> Cheers!!!
> V
>
>

AddThis Social Bookmark Button