<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Reading a CSV file ... extra rows ?? in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769233#M1061997</link>
    <description>&lt;P&gt;&amp;nbsp;I am trying to read a CSV file created with Excel 2010 on a WIN10 laptop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the rows always wrong... the CSV file was originally having 17 rows and now has data only in 10 rows. I want to be able to read and report only 10 rows. If you the code display&amp;nbsp; mode of the read CSV data, you will see spaces appearing in the empty file. How to over come this ? I tried deleting the contents of the empty rows in Excel but nothing helps. Any idea how to handle such a situation [or] how to REALLY empty the rows without data in Excel ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CSV_Read.png" style="width: 345px;"&gt;&lt;img src="https://ip1.i.lithium.com/99050dadbd61f00aa94f7a7f31c80c5a4a6eed5a/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323439303969373146324341344137353335313231382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="CSV_Read.png" alt="CSV_Read.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CSV DataRead.PNG" style="width: 863px;"&gt;&lt;img src="https://ip1.i.lithium.com/377aa6f44854fbf1cc6f3dbd0c6f0d47997eeb15/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323439313069444643324530443346333344383936382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="CSV DataRead.PNG" alt="CSV DataRead.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 12:19:17 GMT</pubDate>
    <dc:creator>MogaRaghu</dc:creator>
    <dc:date>2018-03-19T12:19:17Z</dc:date>
    <item>
      <title>Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769233#M1061997</link>
      <description>&lt;P&gt;&amp;nbsp;I am trying to read a CSV file created with Excel 2010 on a WIN10 laptop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the rows always wrong... the CSV file was originally having 17 rows and now has data only in 10 rows. I want to be able to read and report only 10 rows. If you the code display&amp;nbsp; mode of the read CSV data, you will see spaces appearing in the empty file. How to over come this ? I tried deleting the contents of the empty rows in Excel but nothing helps. Any idea how to handle such a situation [or] how to REALLY empty the rows without data in Excel ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CSV_Read.png" style="width: 345px;"&gt;&lt;img src="https://ip1.i.lithium.com/99050dadbd61f00aa94f7a7f31c80c5a4a6eed5a/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323439303969373146324341344137353335313231382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="CSV_Read.png" alt="CSV_Read.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CSV DataRead.PNG" style="width: 863px;"&gt;&lt;img src="https://ip1.i.lithium.com/377aa6f44854fbf1cc6f3dbd0c6f0d47997eeb15/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323439313069444643324530443346333344383936382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="CSV DataRead.PNG" alt="CSV DataRead.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 12:19:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769233#M1061997</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2018-03-19T12:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769242#M1062002</link>
      <description>&lt;P&gt;Edit the file in a text editor such as Notepad.&amp;nbsp; Excel can never seem to get a CSV right for me either.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 12:33:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769242#M1062002</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2018-03-19T12:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769273#M1062011</link>
      <description>&lt;P&gt;What happens if you delete the rows and not just clear the cell contents?&amp;nbsp; It looks like you may have some type of formatting rule that is creating the extra spaces.&amp;nbsp; Clearing cell contents doesn't remove formatting rules.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 13:31:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769273#M1062011</guid>
      <dc:creator>aputman</dc:creator>
      <dc:date>2018-03-19T13:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769280#M1062012</link>
      <description>&lt;P&gt;As an experiment, you can:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;create a blank workbook&lt;/LI&gt;
&lt;LI&gt;highlight the first 5 rows and columns&lt;/LI&gt;
&lt;LI&gt;right click and format&lt;/LI&gt;
&lt;LI&gt;change the number format to something other than General (I think anything other than General will work.&amp;nbsp; I didn't try them all.)&lt;/LI&gt;
&lt;LI&gt;export to a CSV file&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;When you open the CSV file with a text editor, you'll get 5 rows that each contain 5 commas, even though no data is written in the cells.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 13:42:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769280#M1062012</guid>
      <dc:creator>aputman</dc:creator>
      <dc:date>2018-03-19T13:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769285#M1062015</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Raghunathan&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to copy the 10 rows and paste it in the new excel file.&lt;/P&gt;
&lt;P&gt;Delete the old file and rename the new file by the name of the old file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Fred.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;STRONG&gt;Kudos are welcome!&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://ni.lithium.com/i/smilies/16x16_smiley-wink.gif" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 13:45:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769285#M1062015</guid>
      <dc:creator>Fred19ni</dc:creator>
      <dc:date>2018-03-19T13:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769288#M1062016</link>
      <description>&lt;P&gt;Those extra rows have spaces in them.&amp;nbsp; You say you are deleting the data, but are you sure?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just delete the actual rows.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 13:49:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769288#M1062016</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2018-03-19T13:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769297#M1062020</link>
      <description>&lt;P&gt;There are several different flavors of CSV files in Excel.&amp;nbsp; Which one did you use to save it with?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To t-shoot this issue, I'd open up the original file in something like notepad++ (or even just plain ol' notepad) so you can see exactly what you have in that file.&amp;nbsp; Odds are there's something wrong with the file.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 14:00:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769297#M1062020</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2018-03-19T14:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769338#M1062031</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/5539"&gt;@MogaRaghu&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I am trying to read a CSV file created with Excel 2010 on a WIN10 laptop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the rows always wrong... the CSV file was originally having 17 rows and now has data only in 10 rows. I want to be able to read and report only 10 rows. If you the code display&amp;nbsp; mode of the read CSV data, you will see spaces appearing in the empty file. How to over come this ? I tried deleting the contents of the empty rows in Excel but nothing helps. Any idea how to handle such a situation [or] how to REALLY empty the rows without data in Excel ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This won't fix what is wrong with your file but of you only need the first 10 rows why don't you:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Only read the first 10 rows instead of the entire file&lt;/LI&gt;
&lt;LI&gt;Or split the array at row 10 and forget about the rest?&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 19 Mar 2018 14:42:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769338#M1062031</guid>
      <dc:creator>RTSLVU</dc:creator>
      <dc:date>2018-03-19T14:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769507#M1062087</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11171"&gt;@RTSLVU&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This won't fix what is wrong with your file but of you only need the first 10 rows why don't you:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Only read the first 10 rows instead of the entire file&lt;/LI&gt;
&lt;LI&gt;Or split the array at row 10 and forget about the rest?&lt;/LI&gt;
&lt;/OL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Another option:&lt;/P&gt;
&lt;P&gt;1. Read the entire file as a string (Read From Text File).&lt;/P&gt;
&lt;P&gt;2. Use Trim Whitespace.&amp;nbsp; This will clear out all of the spaces, tabs, end of lines, etc at each end of the file.&lt;/P&gt;
&lt;P&gt;3. Use Spreadsheet String To Array to convert to a 2D array.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 17:45:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769507#M1062087</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2018-03-19T17:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769516#M1062088</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/75897"&gt;@crossrulz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11171"&gt;@RTSLVU&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This won't fix what is wrong with your file but of you only need the first 10 rows why don't you:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Only read the first 10 rows instead of the entire file&lt;/LI&gt;
&lt;LI&gt;Or split the array at row 10 and forget about the rest?&lt;/LI&gt;
&lt;/OL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Another option:&lt;/P&gt;
&lt;P&gt;1. Read the entire file as a string (Read From Text File).&lt;/P&gt;
&lt;P&gt;2. Use Trim Whitespace.&amp;nbsp; This will clear out all of the spaces, tabs, end of lines, etc at each end of the file.&lt;/P&gt;
&lt;P&gt;3. Use Spreadsheet String To Array to convert to a 2D array.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exactly!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what has been missed here is the csv file in question is NOT the problem, well it is but... Your program should be robust enough to deal with a few extra blank lines and/or display an error message that the incoming file is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I rwrote a program that end users create "test scripts" using Excel. But I also provide a detailed Excel template (.xltx) that tells then exactly how to enter their parameters and exactly what format to save the file in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Upon loading the test scrip (a .csv file) first all of the "extra stuff" from the template (directions, notes, etc) are removed, then it is checked for basic errors (formatting, columns all filled in, etc), and finally all of the entered parameters are checked against a config file to ensure test parameters are within the range of the equipment and instruments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If any of this fails I popup an error dialog telling the user that the test script has errors.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 18:02:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769516#M1062088</guid>
      <dc:creator>RTSLVU</dc:creator>
      <dc:date>2018-03-19T18:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769594#M1062120</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11171"&gt;@RTSLVU&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/75897"&gt;@crossrulz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11171"&gt;@RTSLVU&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This won't fix what is wrong with your file but of you only need the first 10 rows why don't you:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Only read the first 10 rows instead of the entire file&lt;/LI&gt;
&lt;LI&gt;Or split the array at row 10 and forget about the rest?&lt;/LI&gt;
&lt;/OL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Another option:&lt;/P&gt;
&lt;P&gt;1. Read the entire file as a string (Read From Text File).&lt;/P&gt;
&lt;P&gt;2. Use Trim Whitespace.&amp;nbsp; This will clear out all of the spaces, tabs, end of lines, etc at each end of the file.&lt;/P&gt;
&lt;P&gt;3. Use Spreadsheet String To Array to convert to a 2D array.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exactly!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what has been missed here is the csv file in question is NOT the problem, well it is but... Your program should be robust enough to deal with a few extra blank lines and/or display an error message that the incoming file is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I rwrote a program that end users create "test scripts" using Excel. But I also provide a detailed Excel template (.xltx) that tells then exactly how to enter their parameters and exactly what format to save the file in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Upon loading the test scrip (a .csv file) first all of the "extra stuff" from the template (directions, notes, etc) are removed, then it is checked for basic errors (formatting, columns all filled in, etc), and finally all of the entered parameters are checked against a config file to ensure test parameters are within the range of the equipment and instruments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If any of this fails I popup an error dialog telling the user that the test script has errors.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My interpretation of what was missed here is that there are supposed to be 17 lines of meaningful data, but it is only displaying ten lines and the other seven are missing data.&amp;nbsp; That's where I went wrong.&amp;nbsp; Upon more careful reading, I see that the file has 17 lines total, of which only the first ten are of interest.&amp;nbsp; This "new" understanding of mine makes the whole problem a lot simpler.&amp;nbsp; Kind of like what you guys suggested.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 20:02:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769594#M1062120</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2018-03-19T20:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769688#M1062142</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/135106"&gt;@billko&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;There are several different flavors of CSV files in Excel.&amp;nbsp; Which one did you use to save it with?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To t-shoot this issue, I'd open up the original file in something like notepad++ (or even just plain ol' notepad) so you can see exactly what you have in that file.&amp;nbsp; Odds are there's something wrong with the file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This post has been a great learning. I will try to answer all of the suggestions&amp;nbsp; :&lt;/P&gt;
&lt;P&gt;1. Excel edited CSV files do have some formatting data that is not required. After all Excel does warn about this when saving. But i never listen !!&lt;/P&gt;
&lt;P&gt;2. Deleting unwanted rows or clearing contents in Excel still leaves some formatting data behind.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. This CSV file is created by user and the number of rows is not known before i read it and so i cannot read "fixed"number of rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. The suggestion to read it as a Text string and trimming white char is an option i can try.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5. For now i opened the CSV file in a Notepad and could immediately see the spaces after the 10th row. Just deleted them and used back space till i reached the last comma and then ran the VI.&amp;nbsp;It brought up an exact 10 rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SO now i will ask the user to create the CSV in Notepad.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to all of the folks who posted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/16736"&gt;@ps&lt;/a&gt; : The&amp;nbsp;idea that worked is &lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/123807"&gt;@Bilko&lt;/a&gt; and that should have been marked as solution but i thought of summarizing all other posts so that it will be of use to someone in future and marked this as solution.... the rest of posts are kudoed !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 22:31:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769688#M1062142</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2018-03-19T22:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769737#M1062161</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/5539"&gt;@MogaRaghu&lt;/a&gt; wrote:
&lt;P&gt;PS : The&amp;nbsp;idea that worked is @bilko and that should have been marked as solution but i thought of summarizing all other posts so that it will be of use to someone in future and marked this as solution.... the rest of posts are kudoed !!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can mark more than one solution...&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 02:36:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769737#M1062161</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2018-03-20T02:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769991#M1062257</link>
      <description>&lt;HR /&gt;
&lt;P&gt;wrote:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;This post has been a great learning. I will try to answer all of the suggestions&amp;nbsp; :&lt;/P&gt;
&lt;P&gt;1. Excel edited CSV files do have some formatting data that is not required. After all Excel does warn about this when saving. But i never listen !!&lt;/P&gt;
&lt;P&gt;2. Deleting unwanted rows or clearing contents in Excel still leaves some formatting data behind.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. This CSV file is created by user and the number of rows is not known before i read it and so i cannot read "fixed"number of rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. The suggestion to read it as a Text string and trimming white char is an option i can try.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5. For now i opened the CSV file in a Notepad and could immediately see the spaces after the 10th row. Just deleted them and used back space till i reached the last comma and then ran the VI.&amp;nbsp;It brought up an exact 10 rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SO now i will ask the user to create the CSV in Notepad.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to all of the folks who posted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS : The&amp;nbsp;idea that worked is @bilko and that should have been marked as solution but i thought of summarizing all other posts so that it will be of use to someone in future and marked this as solution.... the rest of posts are kudoed !!&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually more modern versions of Excel do not leave such things behind, as I have Office 2014 and tried to recreate your issue yesterday. I tried both cut, delete, and clear contents&amp;nbsp;but my version of Excel did not leave empty cells or cells containing spaces behind&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the file in an array check each cell for invalid entries, empty strings, spaces, and delete them or pop-up an error message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As much as you can stress to end users to only use Notepad, you know someone along the way is going to use Excel or some other program to make the .csv files.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 14:19:54 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3769991#M1062257</guid>
      <dc:creator>RTSLVU</dc:creator>
      <dc:date>2018-03-20T14:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file ... extra rows ??</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3770006#M1062262</link>
      <description>&lt;P&gt;I wonder that the user is using a template where they inadvertently added all those extra lines and spaces themselves and when they edit and "save as..." the extra lines get saved along with everything else.&amp;nbsp; I cannot imagine that even ancient versions of Excel would put such stuff in something clearly saved with the CSV extension selected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another possibility is that they cut and paste from data to file without realizing they are cutting and pasting a bunch of invisible stuff along with the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this is a human-generated file, I would do a whole bunch of format checking, just as many people here had suggested.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 14:35:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reading-a-CSV-file-extra-rows/m-p/3770006#M1062262</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2018-03-20T14:35:57Z</dc:date>
    </item>
  </channel>
</rss>

