キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

how to get specific range of data from csv file

Hello

i have a CSV file that im importing with a read delimiter spreadsheet 

the file contains more than 100 rows and 6 columns and i want to access every row 4, 5, and 6 cols.

its all in numbers and no string involved 

how can i do this?

thanks

 

0 件の賞賛
メッセージ1/6
3,289件の閲覧回数

 

  1. Read the entire file into a numeric Array 
  2. Index the rows/columns you are interested in out of the Array
========================
=== Engineer Ambiguously ===
========================
0 件の賞賛
メッセージ2/6
3,278件の閲覧回数

hello 

i understand the idea but i don't know how to do it

i used index array and tried to set the indexes of each row and column by using a for loop but it didn't work.

0 件の賞賛
メッセージ3/6
3,273件の閲覧回数

@DMR12 wrote:

hello 

i understand the idea but i don't know how to do it

i used index array and tried to set the indexes of each row and column by using a for loop but it didn't work.


Well without seeing your code all I can says is, you are doing it wrong...

========================
=== Engineer Ambiguously ===
========================
0 件の賞賛
メッセージ4/6
3,267件の閲覧回数

A CSV file is nothing by one long string. In order to get numbers, you need to parse it and LabVIEW has all the tools you need for that. Seems you are unsig read from spreadsheet file and that's not the problem. Are the number floating point or integers?

 

This leaves us with a smallish 2D array that you want to process in some way, but it is not clear at all.

 

What do you mean by "access"? That's a very ambiguous term! If you just want the 2D array containing only rows 4,5,6, you don't even need a loop.

 


@DMR12 wrote:

i used index array and tried to set the indexes of each row and column by using a for loop but it didn't work.


There a millions of ways something does not work and probably hundreds of ways where it works perfectly. You are not really narrowing down the problem. Typically you would auto-index the full array, then get the three column elements, either with index array resized to three output, or as a subset with three element. Again, it all depends what you mean by "access".

 

To get help, do the following two things:

 

  1. Exactly define what you are trying to do.
  2. Attach your failed attempt, preferably not in the newest LabVIEW version. Make sure we have a typical array, e.g. as diagram constant.

 

0 件の賞賛
メッセージ5/6
3,243件の閲覧回数

You should explore the 'Read Delimited Spreadsheet.vi' that is built into LabVIEW.

data csv.png

 

0 件の賞賛
メッセージ6/6
3,207件の閲覧回数