[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

\r verses \r\n

Is there a standard way to translate text files
that contain the unix verse "dos" line feed return
difference?

line one\rline two\r\rParagraph start

to

line one\r\nline two\r\n\r\nParagraph start

Thanks
0
hank1
Asked:
hank1
1 Solution
 
ahoffmannCommented:
perl -pe 'BEGIN{ $/="\012"; $\="\015\012"} chomp' dosfile >unixfile
perl -pe 'BEGIN{ $/="\015\012"; $\="\012"} chomp' unixfile >dosfile
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now