Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within GNU/Linux
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
GNU/Linux
how to remove '\n' and '\r' in the file by kshell
zb cong
Ranch Hand
Posts: 416
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hello dears,
who can tell me which command can remove the '\n' and '\r' in a file. so the contents in the file are linked to one line.
Thanks.
Ireneusz Kordal
Ranch Hand
Posts: 423
posted 12 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Hello,
use tr command:
$ for i in {1..5} ; do echo -e "${i} line1\r${i} line2\n${i} line3" ; done > test.txt $ cat test.txt 1 line2 1 line3 2 line2 2 line3 3 line2 3 line3 4 line2 4 line3 5 line2 5 line3 $ cat test.txt | tr --delete "\n\r" 1 line11 line21 line32 line12 line22 line33 line13 line23 line34 line14 line24 line35 line15 line25 line3 $
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
remove line feed and carriage return from a string
How to remove indents from xml?
How to remove indents from xml?
File upload and ^M chars
problem while moving the java project from windows environment to FreeBSD in ASCII mode.
More...