Dear All I have a text file with more than 300000 of lines like the following: 1 E E E 2 C D 3 B E D 4 C E D 5 D E I am looking for an automatic way of transforming my text file into another one with the format 1 E 1 E 1 E 2 C 2 C 3 B 3 B 3 D 4 C 4 C 4 D 5 E Any ideas? Thanks in advance, Paul