in reply to In-place search and replace confined to a specific column

You're using the wrong operator. You are assigning to $F[0] instead of using regex binding.

perl -pi -w -lane '$F[0] =~ s/AAA/BB/;' *.txt

could work.

Replies are listed 'Best First'.
Re^2: In-place search and replace confined to a specific column
by Anonymous Monk on Jan 29, 2016 at 09:55 UTC
    I did try this originally, but unlike '=', '=~' fails to replace anything at all unless -w and -pi are removed - but that then prevents me from batch processing all .txt files.
      hello, are not -p and -n togheter, a nonsense?

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.