Yes, I tried what you suggested, I've changed my looping structure to this:<br><br>&nbsp;&nbsp;&nbsp; count = 0<br>&nbsp;&nbsp;&nbsp; for itemLine in lineList:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for itemDirectory in directoryList:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if itemLine == itemDirectory:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print match.ljust(20) + itemLine.ljust(20) + itemDirectory.ljust(20)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print fail.ljust(20) + itemLine.ljust(20) + itemDirectory.ljust(20)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #os.rename(pathName + item, pathName + LineList[count])
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count = count + 1<br><br>I'm just trying to figure out where to put the break(s), but I need to verify this is working since I'll be using it to rename files.. my old structure did EXACTLY what I wanted (I replied to my original post with more details and screen captures) as far as renaming the files.. but the display was screwed up. 
<br><br><div><span class="gmail_quote">On 10/18/06, <b class="gmail_sendername">Luke Paireepinart</b> &lt;<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Chris Hengge wrote:<br>&gt; Ok the example I gave here wasn't written as I had it in my head.. you<br>&gt; are right, the example only had 1 sentence.<br>&gt;<br>&gt; Inputs:<br>&gt; List1 ['a.exe','b.exe',c.exe']<br>&gt; List2 ['
A.exe',B.eXe',c.EXE']<br>&gt;<br>&gt; for item in List1:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if item in List2:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print item + &quot; &quot; + list2thing that matched.<br>&gt;<br>&gt; I can't force to upper or lower, that would break the already working
<br>&gt; code..<br>&gt;<br>&gt; Its just this darn output for list2 that isn't working.<br>&gt;<br>&gt; I tried the suggested list.index(item) but that wont work if there<br>&gt; isn't a match.<br>Well,&nbsp;&nbsp;yeah, but it won't go into the if statement if there isn't a
<br>match so what does that matter?<br>&gt; Right now my code works when there is a match, and if there isnt'...<br>&gt; It also works for renaming the actual file to match the file call from<br>&gt; the document.<br>&gt;
<br>&gt; I'm about to take the display out, since I dont honestly care that it<br>&gt; works, but now that I've been working with it I'm being stubborn and<br>&gt; want the darn thing to show me =P<br>Did you try my example yet?
<br>It should work just fine.<br>just iterate over both of the lists...<br>for item1 in List1:<br>&nbsp;&nbsp;&nbsp;&nbsp;for item2 in List2:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if item1 == item2: #this is equivalent to 'if item1 in List2'<br>except will match ALL occurrences of item1 in List2.&nbsp;&nbsp;if you want to
<br>only match the first, add a break.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print item1+ ' ' + item2<br></blockquote></div><br>