I have a .txt file that looks like this:
image1.jpg, 15234
image2.jpg, 8752
logo.gif, 1402
blank.png, 120
But it's long, very long. The number after the image is it's size.
What I need to be able to do:
Find all the lines that end in .jpg and output them to my screen (the filenames, not the actual images). I don't want to see the filesize and I don't want any gifs, pngs, bmps, etc.
Basically, I know how to put each line into an array, check to see if it ends in .jpg, and output if it does or not, but I don't know how to do this with multiple lines in a .txt file.
Basically I need to know the syntax for "read the first line" "check for .jpg" "check the next line."
I know how to check to see if it's jpg, just not how to go to the next line. I hope that makes sense 🙂