---
title: "printf function in Strata | Oplema"
description: "Format text with printf placeholders, such as %s for a string and %d for a whole number. Write it as printf(format, ...) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/printf"
updated: "2026-11-04"
---

# printf

Build text from a template with placeholders, such as %s for text and %d for whole numbers.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
printf('Benchmark "%s" took %d seconds', 'CSV', 42)
```

### Result

```
'Benchmark "CSV" took 42 seconds'
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | Benchmark "CSV" took 42 seconds |

## Arguments and types

```
printf(format, ...)
```

**format**

Text

Supported signatures (1)

```
printf(format: VARCHAR, ...: ANY) → VARCHAR
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[format

Fill {} placeholders in text with values, as in format('{} and {}', 'a', 1).

](https://oplema.com/docs/strata/functions/format)[array\_extract

Get one item from a list or one character from text by position, where 1 is the first. For a struct, choose a field by name, or by position in an unnamed struct.

](https://oplema.com/docs/strata/functions/array-extract)[ilike\_escape

Check whether text matches a LIKE pattern, ignoring uppercase and lowercase. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/ilike-escape)[like\_escape

Check whether text matches a LIKE pattern, treating uppercase and lowercase as different. The escape character lets the pattern search for a literal % or \_.

](https://oplema.com/docs/strata/functions/like-escape)

[Browse text](https://oplema.com/docs/strata/functions#text) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#printfformat)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
