Search Results

Search: Posts Made By: bashamsc
1,600
Posted By itkamaraj
$ nawk -F\|...
$ nawk -F\| '{for(i=4;i<=NF;i++){a[i]=$1"|"$2"|"$i}{for(i in a){print a[i]}}}' sample.txt
12345|Hema|English
12345|Hema|Hindi
4567|Basha|Engligh
4567|Basha|Hindi
4567|Basha|Telegu
1,600
Posted By clx
Another way $ awk 'BEGIN {FS=OFS="|"}{for...
Another way

$ awk 'BEGIN {FS=OFS="|"}{for (i=4;i<=4+($3-1);i++) {print $1,$2,$i}}' file
12345|Hema|English
12345|Hema|Hindi
4567|Basha|Engligh
4567|Basha|Hindi
4567|Basha|Telegu
$
1,600
Posted By birei
Hi bashamsc, Try with this perl script: ...
Hi bashamsc,

Try with this perl script:

$ cat infile
12345|Hema|02|English|Hindi
4567|Basha|03|Engligh|Hindi|Telegu
$ cat script.pl
use warnings;
use strict;

die qq[Usage: perl $0...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy