DelphiFAQ Home Search:

InterBase, MS-SQL, mysql, Oracle
C#, C++, Delphi, Java,
JavaScript, perl, php, Visual Basic, VBScript
Apache, Network, Shell
Web Publishing
JavaScript, perl CGI, VBScript, Web Hosting
Apache, File Types, Internet Explorer,
Network, Printing, Processes
Outside the Cube
Auto, Computer Hardware,
Finances, Dating Scams,
Household, Male Dating Scammers,
Other Scams, Travel

Featured Article

Save a text file in Unix dos style or unix style


I've got a DOS style text file on my Linux box, when I open it in vi and save it, vi reports 'saved (dos)'. How can I make vi save it in unix style?


VI automatically detects the format of a text file (DOS, Unix, Mac) and it tells that at the command line. To change the format use the :set fileformat= command and write the file then as shown below. If you have multiple control-Ms at the end of a line that you want to be removed, try the search and replace command (see below).

// Change from <CR><LF> (DOS) to just <LF> (Unix):
 :set fileformat=unix 
 // change back to Carriage Return + Line Feed for DOS
 :set fileformat=dos 
 // writing for apple computers:
 :set fileformat=mac 
 // remove multiple (repeated) Carriage Returns using search and replace	

Generated 8:01:58 on May 31, 2020