Eliminate space between fields in a mail merge document if a field is blank

I am doing a mail-merge document with fields similar to this:

<Field 1> <Field 2>

There is a space between the two fields and what I would like to do is eliminate the space if <Field 2> is empty.

Any assistance would be appreciated.

What kind is the underlying database filling the mail merge fields?

It’s a Calc spreadsheet.

In this case, I would nail down the problem with a Calc formula, merging <Field 1> and <Field 2> in the right ways.