Feb-26-2021, 09:48 AM
If statement does not separate between Albums from List. When ran it all prints Yes and when I used not equal all printed no. Why is it not checking to see if the Album is NT and print Yes and all others print No?
newtracks = List of updated file names from folder, filezto = List that was used to update files which is list newtracks. Album=List of Albums(OT and NT Only). With the exception of the list newtracks all were taken from a spreadsheet. What I am seeking to accomplish is to have it compare the files(newtracks) and (filezto) and check if the album is NT and if so print Yes else print No. The other last piece of the puzzle is to move those files that match to selected folders based upon a list from the spreadsheet . for ex file 01 Gen00 album: NT move to folders 1-GEN Gene, etc.
newtracks = List of updated file names from folder, filezto = List that was used to update files which is list newtracks. Album=List of Albums(OT and NT Only). With the exception of the list newtracks all were taken from a spreadsheet. What I am seeking to accomplish is to have it compare the files(newtracks) and (filezto) and check if the album is NT and if so print Yes else print No. The other last piece of the puzzle is to move those files that match to selected folders based upon a list from the spreadsheet . for ex file 01 Gen00 album: NT move to folders 1-GEN Gene, etc.
nt = 0 ft = 0 for alb in range(len(albm)): while nt < len(newtracks): while ft < len(filezto): if albm[alb] == 'NT' and newtracks[nt] == filezto[ft] : print('Yes', newtracks[nt] ,' ft', filezto[ft]) else: print('No', newtracks[nt], 'ft',filezto[ft]) nt = nt +1 ft = ft +1