|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Converting File Formats (Unix to Windows)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 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". -- Show quoteHTH, 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 > 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 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 > 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 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. -- Show quoteHTH, Kevin Spencer Microsoft MVP Professional Chicken Salad Alchemist A lifetime is made up of Lots of short moments. "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 > > 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 > > |
|||||||||||||||||||||||