{"id":14129,"date":"2017-08-28T15:19:46","date_gmt":"2017-08-28T15:19:46","guid":{"rendered":"http:\/\/learnexcelmacro.com\/wp\/?p=14129"},"modified":"2017-09-20T06:53:11","modified_gmt":"2017-09-20T06:53:11","slug":"vba-tutorial-to-read-data-from-text-files","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/","title":{"rendered":"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2"},"content":{"rendered":"

[fusion_text]D<\/span>ear Friends,<\/p>\n

I am back with the second part of the tutorial- VBA Guide to Interact with Text Files \u2013 Part \u2013 1 of 2<\/a><\/em>. This is the final part of this tutorial.
\nIn previous article, mainly we learn about How to Open a Text File and How to write to Text File using VBA code. There were some other stuff as well which we discussed in detail. I would recommend to read my previous article before reading this article.<\/p>\n

Topics covered in this Article<\/h1>\n

Click on the below links to directly jump to that section…<\/p>\n

\n
\n

<\/i>  Read data from Text File using VBA Code – Input <\/em><\/strong>Statement<\/a><\/h2>\n

<\/i>  Read data from Text File using VBA Code – Line Input<\/strong><\/em> Statement<\/a><\/h2>\n

<\/i>  What is EOF() function ? and What is its use here while interacting with text Files?<\/a><\/h2>\n<\/div>\n<\/div>\n

<\/a><\/p>\n

1. Read data from Text File using VBA Code – Input <\/em><\/strong>Statement<\/h1>\n

As I mentioned in my previous article, to read a Text File, we should open the existing Text File in Input Mode.<\/em><\/strong>. To know more about How to open Text Files in Excel VBA, read this article. <\/a><\/p>\n

<\/i> This is very important to know that, <\/strong> Input statement is used to read a Text File which is produced or written by Write statement<\/em> while writing it via VBA code. As you know from the previous article, Write statement, writes the data in Text file in comma separated columns. Therefore, you will see that while reading the data from Text file, each comman separated data is stored in each variable specified in the below Syntax.<\/em><\/p>\n

Let see the syntax of Input Statement which is used to read an existing Text File..<\/p>\n

Syntax of Input Statement to Read data from Text File in Excel VBA<\/h2>\n

Input #FileNumber<\/em>, DataInput1, DataInput2, DataInput3<\/em>…<\/strong><\/p>\n

Where:<\/h2>\n

#FileNumber :<\/h2>\n

When Text files are opened then windows recognize them by a unique integer value. Valid range of Integers for this parameter is between 1 to 511.
\nAs I mentioned above, it should be a unique integer, it is challenging for you to give a fixed number here in case you are dealing with multiple text files. To overcome this challenge you can use a function called FreeFile(). Click here to know more about
FreeFile()<\/a> Function.<\/p>\n

DataInput 1, 2, 3.. etc<\/h2>\n

Comma separated data which is stored in the Text file gets stored automatically in these DataInput variables provided.
\nNote:<\/strong> You can use one or more than one variables in this statement based how many comma separated data you want to read from the Text File. Therefore it is possible that there are 100s of columns are there in each rows in a TextFile but you can read only one or more specific data using Line statement.<\/p>\n

Example:<\/h1>\n

Let’s take an example and understand how Input statement works for reading data from a Text File.<\/p>\n

This is the text file which we want to read the data from and put it in to Excel.
\n\"VBA<\/p>\n

using the below code, we will read this text file and store all data row by row in an excel sheet. (Lat’s say Input sheet)<\/p>\n

\r\n\r\nSub ReadTextFileUsingInputStatement()\r\n\r\nDim sFilePath As String\r\nDim iRow As Integer\r\nDim OrderDate As Date\r\nDim OrderPriority As String\r\nDim OrderQuantity As Integer\r\nDim Discount As Double\r\nDim ShipMode As String\r\nDim CustomerName As String\r\nDim ShipDate As Date\r\n    \r\n    iRow = 2\r\n    sFilePath = "C:\\Users\\vmishra\\Desktop\\LEM.txt"\r\n    ' unique file number to access the file uniquely\r\n    filenumber = FreeFile\r\n    ' to check if file name LEM.txt exists\r\n    ' if not, end the program\r\n    If (VBA.Len(VBA.Dir(sFilePath))) = 0 Then MsgBox "File Does not exists": End\r\n    ' Open the TextFile in Input mode\r\n    ' in order to write in something\r\n    Open sFilePath For Input As #filenumber\r\n    \r\n    ' Now using do while loop, traverse the Text file\r\n    ' till it finds the End of the file.\r\n    Do\r\n    ' Now read the Text file data in each of the corresponding\r\n    ' variables. As soon as below statement gets executed,\r\n    ' corresponding data like OrderDate, ShipMode etc gets\r\n    ' stored in the respective variables\r\n    Input #filenumber, OrderDate, OrderPriority, OrderQuantity, Discount, ShipMode, ShipDate\r\n    ' Now store these data in excel columns for each row.\r\n    With Sheets("Input")\r\n        .Cells(iRow, 1).Value = OrderDate\r\n        .Cells(iRow, 2).Value = OrderPriority\r\n        .Cells(iRow, 3).Value = OrderQuantity\r\n        .Cells(iRow, 4).Value = Discount\r\n        .Cells(iRow, 5).Value = ShipMode\r\n        .Cells(iRow, 6).Value = CustomerName\r\n        .Cells(iRow, 7).Value = ShipDate\r\n    End With\r\n    ' go to the next row in Excel sheet\r\n    iRow = iRow + 1\r\n    ' Go one by one till the last line of the file\r\n    Loop Until EOF(filenumber)\r\n    \r\n    ' Close the file once all data\r\n    ' is written in text file\r\n    Close #filenumber\r\nEnd Sub\r\n<\/code><\/pre>\n

<\/a>
\nIn the above code you can see, I have used a function called EOF<\/strong>. Let’s have a quick look what this function is and why is it important to use?<\/p>\n

What is EOF <\/em>Function<\/h1>\n

EOF() is a Boolean type function which checks if control has reached to the end of the Text File while reading lines in the text file.<\/p>\n

Syntax of EOF File<\/h2>\n

EOF(FileNumber<\/em>)<\/strong>
\nWhere FileNumber is same as explained above. It is an integer type variable. <\/p>\n

This function returns a Boolean – True\/False. If control reaches to an end then, it returns True <\/strong>when it reaches to the end of the file. Till then it always returns False<\/strong><\/p>\n

Why EOF() is important to use? <\/h2>\n

In case you do not use EOF() to find the end of the text file – as soon as control reaches to the end of the text file, it tries to read something which does not exist and it gives a run time error – <\/p>\n

[highlight color=”yellow” rounded=”” class=”” id=””]Run time Error – 62 – Input past end of file.[\/highlight]<\/p>\n

After running the above code, this is what you get in your excel sheet
\n

\"Read

Read Text File in Excel VBA<\/p><\/div><\/p>\n

From the above example of Input statement, you can see, it is not reading the whole line at once. You can read specific data from a line. But what if you want to read the whole line at once? Yes, it is possible to do by using Line Input statement. Let’s learn about it.. <\/div>\n

<\/a><\/p>\n

2. Read data from Text File using VBA Code – Line Input <\/em><\/strong>Statement<\/h1>\n

As the name suggests, using this statement you can read the whole line at once and it gets stored in a single variable. Unlike Input statement, as explained above, you do not need to define multiple variable to store the data.
\nLine Input Statement should be, ideally, used to read the Text file which has different data which are separated by a delimiter. So that once you read the whole line by using Line Input statement and data is stored in a single variable then you can easily split data by using
Split function<\/a>.<\/p>\n

Let see the syntax of Line Input Statement<\/em> which is used to read an existing Text File..<\/p>\n

Syntax of Line Input Statement to Read data from Text File in Excel VBA<\/h2>\n

Line Input #FileNumber<\/em>, LineData<\/strong><\/p>\n

Where:<\/h2>\n

#FileNumber :<\/h2>\n

When Text files are opened then windows recognize them by a unique integer value. Valid range of Integers for this parameter is between 1 to 511.
\nAs I mentioned above, it should be a unique integer, it is challenging for you to give a fixed number here in case you are dealing with multiple text files. To overcome this challenge you can use a function called FreeFile(). Click here to know more about
FreeFile()<\/a> Function.<\/p>\n

LineData<\/h2>\n

Variable to store data of a line in Text file. It stores all data of a line.<\/p>\n

Example:<\/h1>\n

Let’s take an example and understand how Line Input statement works for reading data from a Text File.<\/p>\n

This is the text file which we want to read the data from and display a message with meaning full data after splitting it.
\nAs you can see in the below Text file, Name, Date of Birth, City and Role of a person in stored in a semicolon (;) delimited format.
\nLine Input statement will read the whole line in a single variable and then by using the
Split () function<\/a>., we will get all the parameters like name, date of birth etc.. separately.
\n\"Data<\/p>\n

using the below code, we will read this text file first line and display the data in a message box<\/p>\n

\r\nSub ReadTextFileUsingLineInputStatement()\r\n\r\nDim sFilePath As String\r\nDim lineData As String\r\nDim personalDetails\r\nDim message As String\r\n    \r\n    sFilePath = "C:\\Users\\vmishra\\Desktop\\PersonalDetails.txt"\r\n    ' unique file number to access the file uniquely\r\n    filenumber = FreeFile\r\n    ' to check if file name LEM.txt exists\r\n    ' if not, end the program\r\n    If (VBA.Len(VBA.Dir(sFilePath))) = 0 Then MsgBox "File Does not exists": End\r\n    ' Open the TextFile in Input mode\r\n    ' in order to write in something\r\n    Open sFilePath For Input As #filenumber\r\n    \r\n    ' Using Line Input statement\r\n    ' read the first line and whole\r\n    ' text will get stored in one variable - lineData\r\n    Line Input #filenumber, lineData\r\n    \r\n    ' Since data is stored in a semicolon delimited format\r\n    ' let's split it and store the data in an array formt\r\n    ' using split() function\r\n    personalDetails = Split(lineData, ";")\r\n    \r\n    ' using the array data create the meaning full\r\n    ' message which can be shown to the user.\r\n    message = "Name : " & Chr(9) & personalDetails(0) & vbNewLine\r\n    message = message & "DOB : " & Chr(9) & personalDetails(1) & vbNewLine\r\n    message = message & "City : " & Chr(9) & personalDetails(2) & vbNewLine\r\n    message = message & "Role : " & Chr(9) & personalDetails(3) & vbNewLine\r\n    MsgBox message\r\n    \r\n    ' Close the file once all data\r\n    ' is written in text file\r\n    Close #filenumber\r\nEnd Sub\r\n<\/code><\/pre>\n

Result: After running the above code<\/h1>\n

After running the above code, you will see the following message box.
\n\"Read<\/p>\n

\n

<\/i><\/p>\n

Last part of this tutorial- Complete guide to interact with Text Files using Excel VBA<\/em><\/strong> is ended here.<\/p>\n

I would really appreciate, if you provide your feedback. Do let me know by writing your comment here in the comment section of this article. If you would like more of these kind of detailed articles\/tutorials covering a specific topic.. do let me know.<\/p>\n

Thanks \ud83d\ude42<\/p>\n<\/div>\n

[sharing tagline=” Did you like this article? Then share it with your friends\u2026 spread knowledge…” tagline_color=”green” title=”Share” link=”” description=”Learn All about interacting with Text Files in Excel VBA like opening, creating, writing, reading etc. from Text Files using Excel VBA code” pinterest_image=”” icons_boxed=”yes” icons_boxed_radius=”4px” color_type=”brand” box_colors=”” icon_colors=”” tooltip_placement=”” backgroundcolor=”#fff3dd” class=”” id=””][\/sharing]<\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"

[fusion_text]ear Friends, I am back with the second part of the tutorial- VBA Guide to Interact with Text Files \u2013 Part \u2013 1 of 2. This is the final part of this tutorial. In previous article, mainly we learn about How to Open a Text File and How to write to Text File using VBA […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1246,1675],"tags":[],"yoast_head":"\nVBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2 - Let's excel in Excel<\/title>\n<meta name=\"description\" content=\"VBA code to read text file. Input and Line Input statements in VBA. What is EOF () function in excel VBA? VBA code to read delimited text files. Use of Split() function\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2\" \/>\n<meta property=\"og:description\" content=\"VBA code to read text file. Input and Line Input statements in VBA. What is EOF () function in excel VBA? VBA code to read delimited text files. Use of Split() function\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-28T15:19:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-09-20T06:53:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/learnexcelmacro.com\/wp\/wp-content\/uploads\/sites\/11\/2017\/08\/TextFile.jpg\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2\",\"datePublished\":\"2017-08-28T15:19:46+00:00\",\"dateModified\":\"2017-09-20T06:53:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\"},\"wordCount\":1299,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"articleSection\":[\"Excel Macro\",\"Excel Macro Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\",\"name\":\"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2 - Let's excel in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"datePublished\":\"2017-08-28T15:19:46+00:00\",\"dateModified\":\"2017-09-20T06:53:11+00:00\",\"description\":\"VBA code to read text file. Input and Line Input statements in VBA. What is EOF () function in excel VBA? VBA code to read delimited text files. Use of Split() function\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Macro Tutorial\",\"item\":\"https:\/\/vmlogger.com\/excel\/excel-macro-for-beginners\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/twitter.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2 - Let's excel in Excel","description":"VBA code to read text file. Input and Line Input statements in VBA. What is EOF () function in excel VBA? VBA code to read delimited text files. Use of Split() function","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/","og_locale":"en_US","og_type":"article","og_title":"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2","og_description":"VBA code to read text file. Input and Line Input statements in VBA. What is EOF () function in excel VBA? VBA code to read delimited text files. Use of Split() function","og_url":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2017-08-28T15:19:46+00:00","article_modified_time":"2017-09-20T06:53:11+00:00","og_image":[{"url":"http:\/\/learnexcelmacro.com\/wp\/wp-content\/uploads\/sites\/11\/2017\/08\/TextFile.jpg"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2","datePublished":"2017-08-28T15:19:46+00:00","dateModified":"2017-09-20T06:53:11+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/"},"wordCount":1299,"commentCount":4,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"articleSection":["Excel Macro","Excel Macro Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/","url":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/","name":"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2 - Let's excel in Excel","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"datePublished":"2017-08-28T15:19:46+00:00","dateModified":"2017-09-20T06:53:11+00:00","description":"VBA code to read text file. Input and Line Input statements in VBA. What is EOF () function in excel VBA? VBA code to read delimited text files. Use of Split() function","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2017\/08\/vba-tutorial-to-read-data-from-text-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Macro Tutorial","item":"https:\/\/vmlogger.com\/excel\/excel-macro-for-beginners\/"},{"@type":"ListItem","position":3,"name":"VBA Guide to Interact with Text Files \u2013 Part \u2013 2 of 2"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/twitter.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/14129"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=14129"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/14129\/revisions"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=14129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=14129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=14129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}