Since you're dealing with xml files, you should use an xml parser like xmlstarlet. Consider this xml file:
$ sudo cat /.snapshots/2831/info.xml
<?xml version="1.0"?>
<snapshot>
<type>pre</type>
<num>2831</num>
<date>2023-02-28 17:07:56</date>
<description>pacman -S -u --config /etc/pacman.conf -- endeavouros/eos-translations e</description>
<cleanup>number</cleanup>
</snapshot>
This example will pull the description from a snapshot:
$ sudo xmlstarlet select --template --value-of /snapshot/description /.snapshots/2831/info.xml
pacman -S -u --config /etc/pacman.conf -- endeavouros/eos-translations e
Change the --value-of entry to get other values. For example, to get the date, use --value-of /snapshot/date. Now you can assign variables to the results and display them as required.
Now, since xmlstarlet is not available on the standard Arch ISO, I'll show an example with grep (NOTE: this will need to be run at root):
#!/usr/bin/env bash
SNAPSHOT_DIR="/.snapshots"
export MYFILES=$(ls "$SNAPSHOT_DIR"/*/info.xml)
for name in $MYFILES
do
echo $name: $(grep -r '<date>' $name) $(grep -r '<description>' $name)
done
Sample output:
/.snapshots/2836/info.xml: <date>2023-02-28 17:45:05</date> <description>pacman -R -c -s --config /etc/pacman.conf -- linux-lts515 linux-lts515-h</description>
/.snapshots/2837/info.xml: <date>2023-02-28 17:45:06</date> <description>linux-lts515 linux-lts515-headers</description>
/.snapshots/2838/info.xml: <date>2023-02-28 17:51:52</date> <description>pacman -R -c -s --config /etc/pacman.conf -- chaotic-keyring chaotic-mir</description>
/.snapshots/2839/info.xml: <date>2023-02-28 17:51:53</date> <description>chaotic-keyring chaotic-mirrorlist</description>
/.snapshots/2855/info.xml: <date>2023-03-01 08:57:46</date> <description>timeline</description>
/.snapshots/2866/info.xml: <date>2023-03-01 20:08:03</date> <description>pacman -S -u --config /etc/pacman.conf -- endeavouros/eos-translations e</description>
/.snapshots/2867/info.xml: <date>2023-03-01 20:08:08</date> <description>babl dbus-python eos-translations ethtool ffmpeg fuse-common fuse3 gst-l</description>
/.snapshots/2868/info.xml: <date>2023-03-01 20:08:18</date> <description>pacman -U --noconfirm --config /etc/pacman.conf -- /home/ajgringo619/.ca</description>
/.snapshots/2869/info.xml: <date>2023-03-01 20:08:19</date> <description>pandoc-bin</description>
/.snapshots/2879/info.xml: <date>2023-03-02 05:08:38</date> <description>pacman -U --noconfirm --config /etc/pacman.conf -- /home/ajgringo619/.ca</description>
/.snapshots/2880/info.xml: <date>2023-03-02 05:09:39</date> <description>linux-lts-515-git linux-lts-515-git-headers</description>