in reply to Re^2: one liner to capture value of field and insert in another field
in thread one liner to capture value of field and insert in another field

The problem with split is that by default, trailing empty fields are discarded. You can specify a negative count to prevent that, but you need to be more explicit in such a case:
perl -lne '@F = split /\|/, $_, -1; $F[10] = $F[7] ; print join "|", +@F'
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re^3: one liner to capture value of field and insert in another field
  • Download Code

Replies are listed 'Best First'.
Re^4: one liner to capture value of field and insert in another field
by Anonymous Monk on Jan 28, 2015 at 16:45 UTC
    I was just about to say that! :) It took me a while to figure out what dirtdog is saying about his file.