{"id":55753,"date":"2008-04-18T01:10:00","date_gmt":"2008-04-18T01:10:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2008\/04\/18\/hey-scripting-guy-how-can-i-store-arrays-within-another-array\/"},"modified":"2008-04-18T01:10:00","modified_gmt":"2008-04-18T01:10:00","slug":"hey-scripting-guy-how-can-i-store-arrays-within-another-array","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-store-arrays-within-another-array\/","title":{"rendered":"Hey, Scripting Guy! How Can I Store Arrays Within Another Array?"},"content":{"rendered":"<p><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" height=\"34\" alt=\"Hey, Scripting Guy! Question\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\" \/> <\/p>\n<p>Hey, Scripting Guy! I need to read in data from a text file and store each line as a separate item in an array. However, the data in each line must also be stored as an array; in other words, I need an array made up of other arrays. I tried creating a multidimensional array, but I can\u2019t get it to work. Can you help?<br \/>&#8212; PA<\/p>\n<p><img decoding=\"async\" height=\"5\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" border=\"0\" \/><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" height=\"34\" alt=\"Hey, Scripting Guy! Answer\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\" \/><a href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><img decoding=\"async\" class=\"farGraphic\" title=\"Script Center\" height=\"288\" alt=\"Script Center\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" align=\"right\" border=\"0\" \/><\/a> <\/p>\n<p>Hey, PA. As you probably know, on the planet Vulcan there\u2019s an old saying, \u201cOne does not thank logic.\u201d What does that have to do with creating a multidimensional array? Well, now that we think about it, we have no idea; in fact, we\u2019re having problems figuring out what that has to do with <i>anything<\/i>. But, then again, as the <a href=\"http:\/\/blog.myspace.com\/index.cfm?fuseaction=blog.ListAll&amp;friendID=11422989\" target=\"_blank\"><b>Scrolls of Saruk<\/b><\/a> so eloquently state, \u201cThose who hate and fight must stop, otherwise, it is not stopped.\u201d <\/p>\n<p>In other words, if you don\u2019t stop then you won\u2019t stop. No wonder those Vulcans are considered so dang smart. <\/p>\n<table class=\"dataTable\" id=\"EFD\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p><b>Interesting Vulcan Note:<\/b> Although humans often admire and respect Vulcans, Vulcans aren\u2019t necessarily impressed by humans. However, Vulcans are somewhat <i>perplexed<\/i> by humans: \u201cWe don&#8217;t know what to do about Humans. Of all the species we&#8217;ve made contact with, yours is the only one we can&#8217;t define. You have the arrogance of Andorians, the stubborn pride of Tellarites. One moment you&#8217;re as driven by your emotions as Klingons, and the next, you confound us by suddenly embracing logic.&#8221;<\/p>\n<p>The arrogance of Andorians! As far as the Scripting Guy who writes this column is concerned, those are fighting words!<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>Of course, as far as the Scripting Guy who writes this column\u2019s <i>manager<\/i> is concerned, the Scripting Guy who writes this column should actually try writing this column. You know what? That\u2019s the problem with managers at Microsoft: they\u2019re always making impossible demands of their employees. <\/p>\n<p>But, then again, as Surak said, \u201cThings are only impossible until they are not.\u201d (Is it just us, or is anyone else beginning to wonder if <a href=\"http:\/\/www.yogiberra.com\/yogi-isms.html\" target=\"_blank\"><b>Yogi Berra<\/b><\/a> is actually a Vulcan?\u201d So <i>is<\/i> it impossible to find a solution to PA\u2019s question? Well, you know what they say: You can\u2019t find out until you find out.<\/p>\n<table class=\"dataTable\" id=\"EEE\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Note<\/b>. Actually, we made that last saying up ourselves. Not bad, eh?<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>Of course, before we can do that we need to explain PA\u2019s scenario. (As he noted in his email, \u201cI know this is confusing; at least it was typing it out.\u201d) PA has a text file with data similar to this:<\/p>\n<pre class=\"codeSample\">1.      192.168.10.101  00188B22BE77    SAO002331       Ken Myer\n2.      192.168.10.104  0019D2C841D7    SAO002339       Ken Myer (Laptop)\n3.      192.168.10.113  00121B44CW77    SAO002361       Pilar Ackerman\n4.      192.168.10.116  001CE5C92108    SAO002385       Pilar Ackerman (Laptop)\n<\/pre>\n<p>What PA needs to do is read in this data, storing each line as an item in an array; in other words, the first item in the array will correspond to the first item in the text file:<\/p>\n<pre class=\"codeSample\">1.      192.168.10.101  00188B22BE77    SAO002331       Ken Myer\n<\/pre>\n<p>That\u2019s easy. Except there\u2019s a catch: PA would actually like the information extracted from line 1 to <i>also<\/i> be stored as an array. In other words, he\u2019d like the first item in the array to be <i>another<\/i> array, an array containing these items:<\/p>\n<table class=\"\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n<tbody>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>1. <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>192.168.10.101 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>00188B22BE77 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>SAO002331 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>Ken Myer<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>And that\u2019s a problem. As PA noted, he tried creating a multidimensional array but immediately ran into problems. That doesn\u2019t surprise us; with the possible exception of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Spock\" target=\"_blank\"><b>Mr. Spock<\/b><\/a>, no being in the universe truly understands \u2013 or can make full use of \u2013 multidimensional arrays. And yes, that includes the Scripting Guys. (While it\u2019s true that the Scripting Guy who writes this column always wears a baseball hat, that isn\u2019t because he\u2019s trying to hide his Vulcan ears. That\u2019s just because he has absolutely no fashion sense whatsoever.) To be perfectly honest, the Scripting Guys find multidimensional arrays to be more trouble than they\u2019re worth; because of that we have no desire to even <i>try<\/i> to come up with a solution that relies on multidimensional arrays.<\/p>\n<table class=\"dataTable\" id=\"ESF\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p><b>Star Trek Trivia Note<\/b>: According to <a href=\"http:\/\/www.startrek.com\/startrek\/view\/series\/TOS\/character\/1112508.html\" target=\"_blank\"><b>StarTrek.com<\/b><\/a> Mr. Spock\u2019s actual Vulcan name is \u201cunpronounceable.\u201d Other sources, however, suggest that his Vulcan family name is Xtmprsqzntwlfd. That\u2019s a bit of a mouthful, but, to be honest, it doesn\u2019t seem any more difficult to pronounce than Tsaltas or Costantini.<\/p>\n<p>By the way, if you <i>do<\/i> try to pronounce Tsaltas remember that the <i>Ts<\/i> is pronounced like <i>Ch<\/i>; if you try to pronounce Xtmprsqzntwlfd remember that the <i>q<\/i> is silent. As for Costantini, don\u2019t worry too much about it. As long as you\u2019re handing out free food Peter is guaranteed to show up no matter <i>what<\/i> you call him.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>So, PA, does this mean that we aren\u2019t going to answer your question? Let\u2019s put it this way: this is going to be by far the least interesting <i>Hey, Scripting Guy!<\/i> column ever written.<\/p>\n<p>Nevertheless, we <i>are<\/i> going to answer your question:<\/p>\n<pre class=\"codeSample\">Const ForReading = 1\n\nSet objFSO = CreateObject(\"Scripting.FileSystemObject\")\nSet objFile = objFSO.OpenTextFile(\"C:\\Scripts\\Test.txt\")\n\ni = 0\n\nDo Until objFile.AtEndOfStream\n    ReDim Preserve arrLines(i)\n\n    strLine = objFile.ReadLine\n    strItem1 = Trim(Mid(strLine, 1, 8))\n    strItem2 = Trim(Mid(strLine, 9, 16))\n    strItem3 = Trim(Mid(strLine, 25, 16))\n    strItem4 = Trim(Mid(strLine, 41, 15))\n    strItem5 = Trim(Mid(strLine, 57, 21))\n\n    arrLines(i) = Array(strItem1, strItem2, strItem3, strItem4, strItem5)\n    i = i + 1\nLoop\n\nobjFile.Close\n\nintLine = InputBox(\"Please enter a line number:\")\nintLine = intLine - 1\n\narrInfo = arrLines(intLine)\nWscript.Echo \"IP address: \" &amp; arrInfo(1)\nWscript.Echo \"MAC address: \" &amp; arrInfo(2)\n<\/pre>\n<p>Let\u2019s see if we can explain how this script works. As you can see, we start things off by defining a constant named ForReading and setting the value to 1; we\u2019ll use this constant when we open the text file C:\\Scripts\\Test.txt. After defining the constant we create an instance of the <b>Scripting.FileSystemObject<\/b> object, then use this line of code to open Test.txt for reading:<\/p>\n<pre class=\"codeSample\">Set objFile = objFSO.OpenTextFile(\"C:\\Scripts\\Test.txt\")\n<\/pre>\n<p>As soon as the file is open we assign the value 0 to a counter variable named <i>i<\/i>. And once we\u2019ve done <i>that<\/i> we\u2019re ready to get down to business.<\/p>\n<table class=\"dataTable\" id=\"ENH\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p><b>Note<\/b>. Actually, we\u2019re ready to relate another bit of Vulcan trivia: every 7 years Vulcans face an overpowering mating drive known as <a href=\"http:\/\/en.wikipedia.org\/wiki\/Pon_farr\" target=\"_blank\"><b>pon farr<\/b><\/a>; during this time Vulcans must have \u2026 contact \u2026 with someone lest they go insane or even <i>die<\/i>.<\/p>\n<p>And no, we have no comment on that. Like Fox News, we report; you decide.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>Now, back to the script. After we configure out counter variable we set up a Do Until loop designed to loop until our text file\u2019s <b>AtEndOfStream<\/b> property is True; that simply means that we want to keep reading from the file until there\u2019s nothing left to read. Inside this loop, the first thing we do is use the <b>ReDim Preserve<\/b> command to redimension our array to the value of the counter variable i:<\/p>\n<pre class=\"codeSample\">ReDim Preserve arrLines(i)\n<\/pre>\n<p>The first time through the loop i is equal to 0; that means we\u2019re creating an array of size 0. That, of course, means that we\u2019re creating an array capable of containing 1 item. Arrays always hold 1 more item than their size. Which, in addition to our arrogance, is yet another reason Vulcans find humans so perplexing.<\/p>\n<p>After we redimension our array our next step is to use the <b>ReadLine<\/b> method to read the first line in the text file, storing that information in a variable named strLine:<\/p>\n<pre class=\"codeSample\">strLine = objFile.ReadLine\n<\/pre>\n<p>Of course, as we noted earlier, we\u2019d prefer that this line be stored as an array; in other words, we\u2019d like to chop the value into its constituent pieces and then store those pieces as separate items. That\u2019s what this block of code is for:<\/p>\n<pre class=\"codeSample\">strItem1 = Trim(Mid(strLine, 1, 8))\nstrItem2 = Trim(Mid(strLine, 9, 16))\nstrItem3 = Trim(Mid(strLine, 25, 16))\nstrItem4 = Trim(Mid(strLine, 41, 15))\nstrItem5 = Trim(Mid(strLine, 57, 21))\n<\/pre>\n<p>What\u2019s going on here? Well, PA has a fixed-width text file; that is, the separate fields in his text file take up a specified amount of space. For example, take a look at the beginning of line 1:<\/p>\n<table class=\"dataTable\" id=\"EWAAC\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\">1<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">2<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">3<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">4<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">5<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">6<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">7<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">8<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">9<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">10<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">11<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">12<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">13<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">14<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">15<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">16<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\">1<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">.<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">&nbsp;<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">&nbsp;<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">&nbsp;<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">&nbsp;<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">&nbsp;<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">&nbsp;<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">1<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">.<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">9<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">2<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">.<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">1<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">6<\/p>\n<\/td>\n<td class=\"\">\n<p class=\"lastInCell\">8<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>As you can see, the first field (the line number) starts in character position 1; the second field (the IP address) doesn\u2019t start until character position 9. That means that the first field starts at character position 1 and continues through character position 8, even though some (in this case, most) of those character spots end up as blank spaces. The command <b>Mid(strLine, 1, 8)<\/b> simply tells the script to take the value of strLine, start with character 1, and grab the next 8 characters. That\u2019s going to make strItem1 equal to this, with the dashes representing blank spaces:<\/p>\n<pre class=\"codeSample\">1.------\n<\/pre>\n<p>Needless to say, we don\u2019t really need the blank spaces on the end of this value. Therefore, we also use the <b>Trim<\/b> function to delete any blank spaces from the beginning and end of the string. That makes the final value of strLine equal to this:<\/p>\n<pre class=\"codeSample\">1.\n<\/pre>\n<p>See how that works? We then repeat the process 4 times, methodically grabbing the values for each field in the text file. It\u2019s a little confusing, but it works.<\/p>\n<p>So what do we do with these field values once we\u2019ve gotten hold of them? This:<\/p>\n<pre class=\"codeSample\">arrLines(i) = Array(strItem1, strItem2, strItem3, strItem4, strItem5)\n<\/pre>\n<p>As you can see, there\u2019s nothing fancy here. We\u2019re simply assigning an array to item i in the \u201cmaster\u201d array arrLines. That means that the first item in arrLines will be another array. And that\u2019s fine; if you want to store an array inside an array, well, who is VBScript to question that? After all, he that walks with logic shall be logical.<\/p>\n<table class=\"dataTable\" id=\"ELEAC\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Note<\/b>. Based on the recent weather, if he walks in Seattle he\u2019ll also be soaked unless he walks both with logic <i>and<\/i> an umbrella.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>From there we increment the value of i by 1, then return to the top of the loop and repeat the process with the next line in the text file. When we\u2019re all done, the first item in the array arrLines will be another array, an array containing these elements:<\/p>\n<table class=\"\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n<tbody>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>1. <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>192.168.10.101 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>00188B22BE77 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>SAO002331 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>Ken Myer<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The second item in the array arrLines will be yet another array, this one containing <i>these<\/i> elements:<\/p>\n<table class=\"\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n<tbody>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>2. <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>192.168.10.104 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>0019D2C841D7 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>SAO002339 <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"listBullet\" vAlign=\"top\">\u2022<\/td>\n<td class=\"listItem\">\n<p>Ken Myer (Laptop)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Etc., etc.<\/p>\n<p>After closing the text file we then \u2013 per PA\u2019s needs \u2013 prompt the user to enter a line number:<\/p>\n<pre class=\"codeSample\">intLine = InputBox(\"Please enter a line number:\")\n<\/pre>\n<p>As soon as we get the line number we immediately subtract 1 from it:<\/p>\n<pre class=\"codeSample\">intLine = intLine - 1\n<\/pre>\n<p>What\u2019s the point of that? Well, we assume that the user is going to enter one of the actual line numbers shown in the text file (e.g., line 3). That\u2019s fine, except for one thing: because the first item in an array is item 0 that means that line 3 will actually be array item <i>2<\/i>. If the user wants to work with line 3 that means they want to work with item 2 in the array. Hence we need to subtract 1 from the line number.<\/p>\n<p>If that hurts your brain, well, join the crowd. But that\u2019s just the way arrays work.<\/p>\n<p>That brings us to our final block of code:<\/p>\n<pre class=\"codeSample\">arrInfo = arrLines(intLine)\nWscript.Echo \"IP address: \" &amp; arrInfo(1)\nWscript.Echo \"MAC address: \" &amp; arrInfo(2)\n<\/pre>\n<p>All we\u2019re doing here is grabbing the requested item from the array arrLines and assigning it to yet <i>another<\/i> array. <\/p>\n<table class=\"dataTable\" id=\"EJGAC\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td class=\"\">\n<p class=\"lastInCell\"><b>Note<\/b>. Is this a world record for the most arrays ever used in a single script? We hope not. At the moment the Scripting Guys hold the world\u2019s record for fewest world records held. If we accidentally set a new world\u2019s record then we\u2019ll lose the only world\u2019s record we actually hold.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>After assigning a value to arrInfo we can then \u2013 again, per PA\u2019s needs \u2013 report back the IP address (item 1 in the array arrInfo) and the MAC address (item 2 in the array arrInfo). If the user really did request the information for line 3 then the output should look like this:<\/p>\n<pre class=\"codeSample\">IP address: 192.168.10.113\nMAC address: 00121B44CW77\n<\/pre>\n<p>And there you have it, PA; live long and prosper. Or, as Surak himself would say, &#8220;Once you have thrown away your pach-te, you have found the true center, the golden river, the lifeblood of the world.&#8221;<\/p>\n<p>So true, so very, very true.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! I need to read in data from a text file and store each line as a separate item in an array. However, the data in each line must also be stored as an array; in other words, I need an array made up of other arrays. I tried creating a multidimensional array, [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[18,3,4,5],"class_list":["post-55753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-arrays-hash-tables-and-dictionary-objects","tag-scripting-guy","tag-scripting-techniques","tag-vbscript"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! I need to read in data from a text file and store each line as a separate item in an array. However, the data in each line must also be stored as an array; in other words, I need an array made up of other arrays. I tried creating a multidimensional array, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/55753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=55753"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/55753\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=55753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=55753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=55753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}