Windows Newline: Carriage Return char(13) ή 0Dh + Line Feed char(10) ή 0Ah.
Unix Newline: Line Feed char(10) ή 0Ah.
Mac OS X Newline: Line Feed char(10) ή 0Ah.
Mac OS up to ver9: Carriage Return char(13) ή 0Dh.
Σε unix ή Windows με cygwin με χρήση sed/perl μπορούμε να μετατρέψουμε txt αρχείο:
sed -e 's/$/\r/' inputfile > outputfile # UNIX to DOS (adding CRs)
sed -e 's/\r$//' inputfile > outputfile # DOS to UNIX (removing CRs)
perl -p -e 's/(\r\n|\n|\r)/\r\n/g' inputfile > outputfile # Convert to DOS
perl -p -e 's/(\r\n|\n|\r)/\n/g' inputfile > outputfile # Convert to UNIX
perl -p -e 's/(\r\n|\n|\r)/\r/g' inputfile > outputfile # Convert to old Mac
Link: en.wikipedia article about Newline.
Programming links:
20071127
Newline terminator in Unix/Linux, Windows and Mac (+convertion methods).
Εγγραφή σε:
Σχόλια ανάρτησης (Atom)
Πληροφορίες
Αρχειοθήκη ιστολογίου
-
►
2010
(5)
- ► Σεπτεμβρίου (1)
- ► Φεβρουαρίου (2)
-
►
2008
(14)
- ► Δεκεμβρίου (3)
- ► Φεβρουαρίου (1)
- ► Ιανουαρίου (5)
-
▼
2007
(40)
- ► Δεκεμβρίου (4)
-
▼
Νοεμβρίου
(11)
- Newline terminator in Unix/Linux, Windows and Mac ...
- Convert a tab delimited file to CSV format using R...
- Remove all "^M" characters from a file using vi.
- Convert all new lines to tab delimited using regex...
- Regular expressions links/briefly.
- Λεξικά για Firefox/Thunderbird, Open Office για Ελ...
- C++: Defining/initializing static member(s) within...
- C++: Example of class with ctor, increment operato...
- C++: difference between prefix and suffix incremen...
- Visual Studio .NET 2005: Static library creation/u...
- C++ Boost: Reading all the text files of directory...
Ετικέτες
- C++ (25)
- Unix/Linux (9)
- SuSE 10.2 (8)
- boost (7)
- regex (6)
- Windows (5)
- Windows Vista (4)
- functions (4)
- vim (4)
- Visual Studio .NET 2005 (3)
- firefox (3)
- Windows 7 (2)
- asus eee 901 (2)
- open office (2)
- thunderbird (2)
- video tools (2)
- LaTeX (1)
- Praat Script (1)
- adobe cs4 (1)
- apache (1)
- files (1)
- laptop repair (1)
- php/MySQL (1)
- ubuntu 10.04 (1)
- ubuntu 12.04 (1)
- ubuntu 9.04 (1)
- ubuntu eee (1)
- western digital (1)
- wordpress (1)

Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου