Is there a way (in a one-liner) to confine find and replace to within a specific column of a tab-delimited .txt file?
For example:
perl -pe 's/A/B/g;'
But which only finds and replaces 'A' with 'B' within column-2 and ignores all other instances of A, converting this:
1 A A2
2 A A
3 B B1
4 A B
5 A A
6 B A3
7 A A
8 C A
9 E B
10 D B
11 A C6
12 A G
13 B L
14 A E
15 B A
16 A A
Into:
1 B A2
2 B A
3 B B1
4 B B
5 B A
6 B A3
7 B A
8 C A
9 E B
10 D B
11 B C6
12 B G
13 B L
14 B E
15 B A
16 B A