PDA

View Full Version : Comparing two text files


shadow29
06-22-2005, 05:17 PM
I have two computers, a laptop and a desktop. I have iTunes on both computers and I had thought that I had transferred all of the files over. However, there is about a 20 song discrepancy.

Is there a way for a computer to compare two exported library lists and tell me what is different between the two text documents? I am pretty sure that you can do this with Excel, but these are .txt files.

Or if there's another way, let me know.

Thanks.

tinhat
06-22-2005, 05:23 PM
[ QUOTE ]
I have two computers, a laptop and a desktop. I have iTunes on both computers and I had thought that I had transferred all of the files over. However, there is about a 20 song discrepancy.

Is there a way for a computer to compare two exported library lists and tell me what is different between the two text documents? I am pretty sure that you can do this with Excel, but these are .txt files.

Or if there's another way, let me know.

Thanks.

[/ QUOTE ]

I take it no linux or GNU tools? Either "uniq" or "diff" would tell you (GNU tools are available for windows). "uniq" tells you what's in one file and not the other and "diff" compares the lines of each file...

Mike

shadow29
06-22-2005, 05:28 PM
[ QUOTE ]
I take it no linux or GNU tools? Either "uniq" or "diff" would tell you (GNU tools are available for windows). "uniq" tells you what's in one file and not the other and "diff" compares the lines of each file...

Mike

[/ QUOTE ]

Sounds like uniq is what I need. I have Win XP Home. Is there a website to download it?

tinhat
06-22-2005, 05:37 PM
http://gnuwin32.sourceforge.net/packages/textutils.htm

I scanned the page and see windows nomenclature ("setup program")...

Mike

I take it back. You want "comm" instead but it's a part of the pkg I pointed you to. The command is "comm -3 file1 file2" if windows usage is similar to linux and it will suppress lines that appear in both files showing you only lines that appear in just one or the other.

stabn
06-22-2005, 07:01 PM
windiff (http://www.grigsoft.com/windiff.zip)

rlr
06-22-2005, 08:33 PM
I like Examdiff (http://www.prestosoft.com/ps.asp?page=edp_examdiff)

crego20
06-22-2005, 10:45 PM
I opened mine up in Excel with no problem. Looks like a standard tab delimited file to me. If you are comfortable with Excel, I would just use that.

To open the file in Excel just right click->open with->choose program->Excel

shadow29
06-23-2005, 12:04 AM
Yeah, well this isn't exactly working.

The problem is that the exported library files have last date played and location. And those are obviously different.

Any solutions?

crego20
06-23-2005, 12:10 AM
Sorry, I thought you where pretty sure how to do this with Excel.

I would bring the 2 files in as seperate spreadsheets, copy the songname column from each to a 3rd sheet, sort both and you should see what you are missing pretty quick.

shadow29
06-23-2005, 01:17 AM
[ QUOTE ]
Sorry, I thought you where pretty sure how to do this with Excel.

[/ QUOTE ]

Yeah, I knew you could do it, just didn't know how. /images/graemlins/grin.gif

I would bring the 2 files in as seperate spreadsheets, copy the songname column from each to a 3rd sheet, sort both and you should see what you are missing pretty quick.

[/ QUOTE ]

Yeah, the problem is it looks like this:

Desolation Row Bob Dylan Bob Dylan Highway 61 Revisited Rock 16414216 683 1 1 9 9 1965 3/28/2005 8:51 PM 4/16/2005 1:11 PM 192 44100 MPEG audio file 5 6/15/2005 11:55 PM C:\Documents and Settings\John\My Documents\My Music\iTunes\iTunes Music\Bob Dylan\Highway 61 Revisited\09 Desolation Row.mp3


So it's not very user friendly. /images/graemlins/mad.gif Oh well.

tinhat
06-23-2005, 11:09 AM
[ QUOTE ]

Yeah, the problem is it looks like this:

Desolation Row Bob Dylan Bob Dylan Highway 61 Revisited Rock 16414216


[/ QUOTE ]

If every entry has a field like what I bolded, email me the two files and I'll do it for you ("perl/sed" can strip off everything leaving the music info, "sort" will arrange what's left and "comm" will tell you which is not in one file or the other. This is much simpler than that sounds).

These are fun little exercises in text processing that windows just isn't able to do (or handle simply) so I'm doing this more for my entertainment than helping you. Your only risk is everyone finding out you like ABBA...

Mike

crunchy1
06-23-2005, 03:10 PM
If you can get your data into columns in Excel the vlookup function will do what you need.

shadow29
06-23-2005, 03:12 PM
I took tinhat up on his offer. /images/graemlins/grin.gif

Thanks guys!

JoePro
06-23-2005, 08:28 PM
Windiff is good, but Araxis Merge For Windows runs circles around it. You can get a 30-day demo here: araxis (http://www.araxis.com)

edit=fixed url