In FILES, find matching string in fields and only show one

I have several files which can have the same word into a same field.
I would like to look through the files and to display this word but only once.
As if the string is the same into the field of an other file, it just appear once (by choosing the first occurrence let say).
This is for an index.

Instead of having a list with:
John Doe
John Doe
John Doe
Bob bob

Just have :
John Doe
Bob bob

This solution displays indeed the similar content of the field artist of all the files.

<?php foreach($page->files() as $item): ?>
     <?php echo $item->artist()->kirbytext() ?>
<?php endforeach ?>

If anyone would have a starting point for me that would be great!
Thanks you!

Have a look at the pluck() method.

$files = $page->files();
$artists = $files->pluck('artist', null, true);
foreach($artists as $artist) {
  echo $artist;

thank you Texnixe !! seems to work!

<?php foreach($page->files()->pluck('artist', null, true) as $item): ?>
    <li><?php echo $item->kirbytext() ?></li>
<?php endforeach ?>