You can use sprintf/snprintf to first store a line in a text buffer and next print that text buffer. The below demonstrates using serial monitor.
// text buffer; size is for 16 characters plus terminating '\0'
static int counter = 0x7FFF;
snprintf(buffer, sizeof(buffer), "'%-5s' '%6d'", "txt", counter++);
This will print as shown below. For clarity, the code wastes some space. %-5s will print a text with a minimum of 5 characters, left aligned. %6d prints a signed integer with a minimum of 6 positions; reason for 6 positions is that a signed integer is a maximum of 5 digits and a minus sign. You can start the counter at 0 to see the effect.
'txt ' ' 32767'
'txt ' '-32768'
'txt ' '-32767'
'txt ' '-32766'
The total length should not exceed 20 characters or the result will be truncated at the end.; I’ve wasted tome space with the single ticks and the additional space.