Hi, Gurus,
I have a requirement as following:
source data:
103,8,25
I want to get
103 8 25 1_8
103 8 25 9_16
103 8 25 17_24
103 8 25 25_32
103 8 25 33_40
103 8 25 41_48
103 8 25 49_56
103 8 25 57_64
103 8 25 65_72
103 8 25 73_80
103 8 25 81_88
103 8 25 89_96
103 8 25 97_104
103 8 25 105_112
103 8 25 113_120
103 8 25 121_128
103 8 25 129_136
103 8 25 137_144
103 8 25 145_152
103 8 25 153_160
103 8 25 161_168
103 8 25 169_176
103 8 25 177_184
103 8 25 185_192
103 8 25 193_200
103 8 25 201>
It is 26 records, last record is 201>
currently, I am using following command
awk -F',' '{for(i=1; i<=$3+1; i++)print $1","$2","$3","((i-1)*$2+1)"_"$2*i}'
i got most of it, only last record is
103, 8, 25, 201_208.
:wall:
can anyone help me out.
Thanks in advance.