Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sat Mar 25, 2023 11:02 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - PERL: How to replace non-ascii characters/bytes in a file
Author Message
Post subject: PERL: How to replace non-ascii characters/bytes in a file  |  Post Posted: Fri Apr 10, 2015 8:58 am

To remove a non-ascii 9B byte in a file:


Code:
perl -i.bak -pe 's/\x9B//g' file.txt


To replace a non-ascii 9B byte with a new line:


Code:
perl -i.bak -pe 's/\x9B/\x0A/g' file.txt
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO