{"id":2025,"date":"2016-05-02T16:34:54","date_gmt":"2016-05-02T21:34:54","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/?p=2025"},"modified":"2016-05-23T12:44:31","modified_gmt":"2016-05-23T17:44:31","slug":"making-a-matlab-script-to-compare-two-long-lists-of-strings-from-excel","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2016\/05\/02\/making-a-matlab-script-to-compare-two-long-lists-of-strings-from-excel\/","title":{"rendered":"Making a MATLAB Script to Compare Two Long Lists of Strings from Excel"},"content":{"rendered":"<p>I often need to compare long lists of strings, usually URLs. If I have less than a few thousand, and the data is already in Excel, I will use the MATCH and INDEX functions in Excel to do this. However, if the lists are in the order of tens of thousands or hundreds of thousands, Excel struggles. Here, I write a very simple MATLAB script to input two lists of strings from Excel spreadsheets, compare using setdiff, and intersect and write the results back.<\/p>\n<p>This video uses the <a href=\"https:\/\/blogs.mathworks.com\/videos\/2015\/10\/29\/matlab-code-along-videos\/\">code-along<\/a> style.<\/p>\n<p><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"4832646849001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/p>\n<p>Play the video in full screen mode for a better viewing experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/videos\/2016\/05\/02\/making-a-matlab-script-to-compare-two-long-lists-of-strings-from-excel\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/5e80abfa-e7d5-4511-aae1-9368dcb70d94\/7c1a1259-4674-4a8d-875d-c2242b831773\/1280x720\/match\/image.jpg\" onError=\"this.style.display ='none';\"\/><\/p>\n<div class=\"overlay_container\">\n      <span class=\"icon-video icon_color_null\"><time class=\"video_length\">36:19<\/time><\/span>\n      <\/div>\n<p>      <\/a><\/div>\n<p>I often need to compare long lists of strings, usually URLs. If I have less than a few thousand, and the data is already in Excel, I will use the MATCH and INDEX functions in Excel to do this&#8230;. <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2016\/05\/02\/making-a-matlab-script-to-compare-two-long-lists-of-strings-from-excel\/\">read more >><\/a><\/p>\n","protected":false},"author":133,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[27,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/2025"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/users\/133"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/comments?post=2025"}],"version-history":[{"count":8,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/2025\/revisions"}],"predecessor-version":[{"id":2257,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/2025\/revisions\/2257"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=2025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=2025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=2025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}