• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

AWK> Useful examples

May26
2011
Written by Scott Rowley

Just a starter page that will grow as I find useful awk commands to share.

Convert Linux .txt to Windows .txt
Replace the end of a line with a carriage. Useful for converting .txt files from Linux to Windows.

awk 'sub("$", "\r")' linuxfile.txt > windowsfile.txt

Convert Windows .txt to Linux .txt
And the reverse. Useful for converting .txt files from Windows to Linux.

awk '{ sub("\r$", ""); print }' windowsfile.txt> linuxfile.txt
Posted in BASH - Tagged awk, convert, example, linux, list, sub, txt, Windows
« osTicket> View headers for original email message
» Web Dev> Password protect webpage(s) with PHP & LDAP

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top