awk - Replicate a string names x times and ascribe replication number -


i replicate key names x number of times , have separate column indicate replication number, e.g. let's have 3 key names follows:

101 102 103 

so, each of above numbers (names) replicated 3 times , have separate identifier number equal 4 characters. therefore this:

101  0001 101  0002 101  0003 102  0001 102  0002 102  0003 103  0001 103  0002 103  0003 

i guess genered relatively straight forward awk script? *edit: not specify names replicate in script - should "replicate names in text file", there lot of them (~400) , variable name types.

thank in advance!

in bash

echo {101,102,103}" "{01,02,03}  101 01 101 02 101 03 102 01 102 02 102 03 103 01 103 02 103 03 

following fedorqui's advice newlines

printf "%s\n" {101,102,103}" "{01,02,03}  101 01  101 02  101 03  102 01  102 02  102 03  103 01  103 02  103 03 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -