Copy first word of line

Usually I find the answers to my beginner-script-problems here in this forum but this time I had no luck so far...:frowning:

I want to modify a Japanese vocabulary file to import it into granule. Every line looks like this:

I would like to have it like this:

The lenght of the words always differ, but there is a bracket "(" in every line, so the part before the bracket should be copied and inserted with a trailing ";" at the beginning of the same line again.

How could this be done?

Thanks for any help!:slight_smile:

If "word" in your example never has space characters or your locale's equivalent of spaces) in it:

awk '{ printf ("%s%s %s\n", $1, ";", $0); } ' inputfile > outputfile

It works!

Thanks a lot!!!