Source file data.txt
A
B
.
.
.
Z
Source file contain A to Z write each character in one line each.
Result Need
A_01
A_02
.
.
.
A_26
B_01
.
.
B_26
.
.
.
Z_01
.
.
Z_26
Note: from the source file we need to count the no.of line and add that number to each split character.
I got a Solution But I need to do in one for statement.
end=`wc -l data.txt | awk '{print $1}'`
for i in $(cat data.txt )
do
for j in `seq $end`
do
echo "$i"_"$j"
done
done
[bash], so please add a tag for your shell of preference. Search your shell's documentation for math operations. Good luck.A..Zare example values, you don't wantprintf "%s\n" {A..Z}_{01..26}.$()notation is preferred see some here