Hello All,
I have a challenge that I think that split or explode will handle, but unfortunately I am not smart enough to figure it out.
I have a form (Jotform) that users submit a variable number of video and image clips for each scene of a video that I produce automatically.
The CSV that I receive is Double-quoted and contains the content the user uploaded.
It looks like this:
“SubmissionDate”,“Scene1”,“Scene2”,“Scene3”
“2015-12-09 08:39:18”,“[1.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566858f1f12151.mp4 [23.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566858f993e7623.mp4 [25.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590b787b525.mp4 [IMLS98596647-15.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590e75119IMLS98596647-15.jpg [IMLS98596647-16.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590fb9572IMLS98596647-16.jpg [IMLS98596647-17.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668591105af2IMLS98596647-17.jpg [IMLS98596647-18.jpg] [url=https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685912387b8IMLS98596647-18.jpg,]https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685912387b8IMLS98596647-18.jpg","[/url][20.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566858f16bb2720.mp4 [21.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566858fc51d5b21.mp4 [22.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590a2e51222.mp4 [IMLS98596647-7.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590c81858IMLS98596647-7.jpg [IMLS98596647-8.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590dc1e87IMLS98596647-8.jpg [IMLS98596647-9.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590f0ff18IMLS98596647-9.jpg [IMLS98596647-10.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685910836dcIMLS98596647-10.jpg [IMLS98596647-11.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685912158efIMLS98596647-11.jpg [IMLS98596647-12.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566859138e67bIMLS98596647-12.jpg [IMLS98596647-13.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566859150d977IMLS98596647-13.jpg [IMLS98596647-14.jpg] [url=https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685916e9115IMLS98596647-14.jpg,]https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685916e9115IMLS98596647-14.jpg","[/url][18.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566858f22530018.mp4 [17.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566858fec7fca17.mp4 [16.mp4] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668590d8e99316.mp4 [IMLS98596647-1.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/5668591035666IMLS98596647-1.jpg [IMLS98596647-2.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685911cfbe2IMLS98596647-2.jpg [IMLS98596647-3.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566859134cb5aIMLS98596647-3.jpg [IMLS98596647-4.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685914ddbcbIMLS98596647-4.jpg [IMLS98596647-5.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/566859168ffbbIMLS98596647-5.jpg [IMLS98596647-6.jpg] https://s3.amazonaws.com/jotformWidgets/dragDropUpload/53346332689968/56685918354d3IMLS98596647-6.jpg”
Can anyone point me in the right direction? I would like to count the mp4’s and images of each scene and access them individually for processing.
I use grep “[[^]]*]” to remove the brackets and contents and replace with a pipe delimiter, but it also places one at the beginning of the string.
I feel that explode is the way to go, but I am having problems even starting this process.
Thank you all in advance.