|
| |||||||||
| Tags: convert, diswin, easiest, text, unixlinux |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| What is the easiest way to convert unix/linux text files to DIS/Win text files?
As well known the line endings/carriage returns in text files under Unix/linux differ from those under DOS/WinXP. Assume I got a text file with unix style line feeds. What is the easiest way to convert all line endings to WinXP style ? Eugen |
|
#2
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Win text files?
Unix2Dos tool: http://www.google.com/search?hl=en&q=unix2dos JS "Eugen Austermann" <aussie@hotmail.com> wrote in message news:476be747$0$16581$9b4e6d93@newsspool1.arcor-online.net... > As well known the line endings/carriage returns in text files under > Unix/linux differ from > those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. > What is the easiest way to convert all line endings to WinXP style ? > > Eugen > |
|
#3
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Wintext files?
Autoit @LF > @LFCR (get autoit from the authors web site) Eugen Austermann wrote: > As well known the line endings/carriage returns in text files under Unix/linux differ from > those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. > What is the easiest way to convert all line endings to WinXP style ? > > Eugen > |
|
#4
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Win text files? "Eugen Austermann" <aussie@hotmail.com> wrote in message news:476be747$0$16581$9b4e6d93@newsspool1.arcor-online.net... > As well known the line endings/carriage returns in text files under > Unix/linux differ from > those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. > What is the easiest way to convert all line endings to WinXP style ? > > Eugen AFAIR, Unix has an option to write text files with CRLF at the end of each line. Alternatively you could open the file with Word, then save it as a text file. You will be prompted to specify the EOL string, i.e. CRLF. |
|
#5
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Win text files?
I have a VBScript file that I leave on my Desktop. Unix has one variation. Some Windows files (like Word docs) have another variation. The standard in Windows is to end the line with ASCII characters 13-10. (Carriage return - line feed) If you paste the following text to Notepad and save it as a .vbs file, you can just drop any file onto it and have it fixed. (Note that in some cases on XP you may need to adjust security to run a .vbs file.) '---------------- start text of vbs file ------------ Dim fso, ts, s, arg, fil, fpath, s1 Set fso = CreateObject("Scripting.FileSystemObject") arg = WScript.arguments.item(0) Set ts = fso.OpenTextFile(arg, 1, False) s = ts.ReadAll ts.Close Set ts = Nothing s1 = Replace(s, vbCrLf, vbCr, 1, -1, 0) s1 = Replace(s1, vbLf, vbCr, 1, -1, 0) s1 = Replace(s1, vbCr, vbCrLf, 1, -1, 0) Set ts = fso.CreateTextFile(arg, True) ts.Write s1 ts.Close Set ts = Nothing Set fso = Nothing MsgBox "All done", 64, "File fixed" ' -------- end vbs file --------------- Another variation, if you want to save the edited text to a different file, replace the line: Set ts = fso.CreateTextFile(arg, True) with: Set ts = fso.CreateTextFile(arg & ".txt", True) > As well known the line endings/carriage returns in text files under Unix/linux differ from > those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. > What is the easiest way to convert all line endings to WinXP style ? > > Eugen > |
|
#6
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files toDIS/Win text files?
On Fri, 21 Dec 2007 16:18:19 +0000, Eugen Austermann wrote: > As well known the line endings/carriage returns in text files under > Unix/linux differ from those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. What is the easiest > way to convert all line endings to WinXP style ? > Eugen, after a quick search for Unix2Dos, I found a utility here http://www.bastet.com/ If you are going back and forth from Unix to Windows, checkout Unix utilities for Windows http://unxutils.sourceforge.net/ -- Mark |
|
#7
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Wintext files?
Pegasus (MVP) wrote: > "Eugen Austermann" <aussie@hotmail.com> wrote in message > news:476be747$0$16581$9b4e6d93@newsspool1.arcor-online.net... >> As well known the line endings/carriage returns in text files under >> Unix/linux differ from >> those under DOS/WinXP. >> >> Assume I got a text file with unix style line feeds. >> What is the easiest way to convert all line endings to WinXP style ? >> >> Eugen > > AFAIR, Unix has an option to write text files with CRLF at the > end of each line. > It mainly depends on the app that writes it. > > Alternatively you could open the file with Word, then save it > as a text file. You will be prompted to specify the EOL string, > i.e. CRLF. > That's neat. Cheers, Cliff -- Have you ever noticed that if something is advertised as 'amusing' or 'hilarious', it usually isn't? |
|
#8
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Wintext files?
Eugen Austermann wrote: > > As well known the line endings/carriage returns in text files under > Unix/linux differ from those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. What is the > easiest way to convert all line endings to WinXP style ? > Eugen, If you just want to *read* them (and print them) open them in WordPad. Cheers, Cliff -- Have you ever noticed that if something is advertised as 'amusing' or 'hilarious', it usually isn't? |
|
#9
| |||
| |||
| Re: What is the easiest way to convert unix/linux text files to DIS/Win text files? aussie@hotmail.com (Eugen Austermann) wrote in news:476be747$0$16581$9b4e6d93@newsspool1.arcor-online.net: > As well known the line endings/carriage returns in text files > under Unix/linux differ from those under DOS/WinXP. > > Assume I got a text file with unix style line feeds. > What is the easiest way to convert all line endings to WinXP style > ? > > Eugen > > Unix2Dos and/or Dos2unix <http://www.freedownloadscenter.com/Utilities/Misc__Utilities/DOS2UNIX_UNIX2DOS.html> HTH, John |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "What is the easiest way to convert unix/linux text files to DIS/Win text files?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to convert image text into a text file | Wadee | Windows Software | 5 | 02-12-2010 06:33 PM |
| How to protect text files with password? | Level8 | Operating Systems | 3 | 20-11-2009 12:09 PM |
| Vba import text files | Naval | Software Development | 1 | 25-03-2009 12:35 AM |
| How to encrypt & decrypt text or files in Vb dot net? | ArunJ | Software Development | 4 | 27-02-2009 09:01 PM |
| Convert MP3 to text with Speech to text in Word. | wish I wuz smart! | MS Office Support | 0 | 26-01-2009 10:47 AM |