in reply to Replace bits

perl -pe 's/^(..)H/${1}1/; s/^(.{7})L/${1}0/;' input > output

The output is different on line 4, it prints

HH1HHHHH

Explanation:

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Replace bits
by newbiecali (Initiate) on Mar 30, 2015 at 23:30 UTC
    can it take text file "file1.txt"
    and spit out the output in "output.txt"
    something like that

      Exactly like that. Take  input in choroba's command line above and replace it with  file1.txt and replace  output with  output.txt likewise.


      Give a man a fish:  <%-(-(-(-<