Remove newline characters from text

/ Published in: Perl
Save to your folder(s)

This Perl one-liner will remove all newline characters from a text file, replacing them with a space. In the source, all newline characters in the file gear_list.xml are replaced with spaces, and the original file is saved as gear_list.xml.bak

Copy this code and paste it in your HTML
  1. $ perl -i.bak -pe 'chomp; print " ";' gear_list.xml


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.