I'm attempting to use a CSV to bulk upload listings however the image urls are in columns.
I'm using Amazon S3 to host the images and PowerShell to retrieve the keys of each file. However I am unsure how to group by their related files and then use something like text to columns to split?
The files have a consistent naming structure:
C2-123-1.JPG
C2-123-2.JPG
C2-123-3.JPG
C3-333-1.JPG
C3-333-2.JPG
In the example above C2-123 has three photos, C2-333 has only two so I'm looking to receive an outcome like below.
|Image Link 1| Image Link 2| Image Link 3| Image Link 4| |C2-123-1.JPG| C2-123-2.JPG| C2-123-3.JPG| | |C3-333-1.JPG| C3-333-2.JPG| | |
This should work, you should replace
$data
for the output you get from AWS.$data
for testing:-
and the.jpg
extension:Group
arrayswhile
loop with$max
as reference to cast[pscustomobject]
Result would be:
To see the
regex
explanation you can use https://regex101.com/r/kARr39/1