#!/usr/bin/perl # http://perlmonks.org/?node_id=1140995 use strict; use warnings; $_ = <<END; id|Name|app1|app2 1|abc|234|231| 2|xyz|123|215| 1|abc|265|321| 3|asd|213|235| END 1 while s/^(\d+\|\w+\|)\K([\d,|]+\n)(.*)^\1([\d|]+)\n/ my ($gap, @tmp) = ($3, split m{\|}, $4); $2 =~ s#(?=\|)#',' . shift @tmp#ger . $gap /mes; print;
hehehe :)
In reply to Re: appending values based on criteria
by Anonymous Monk
in thread appending values based on criteria
by logeshwaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |