How to read columns from spreadsheet?
I have text based spreadsheet files containing several columns of data (previously collected data written to file by "write to spreadsheet file" function). Each column is separated by a tab character.
I need to plot each column on a separate waveform chart. I am trying to use the "read data from spreadsheet" function to do this, which I understand reads in the spreadsheet file as a 2D array.
I cannot figure out how to separate each column from the 2D array which is the output of the "read data from spreadsheet" function. For each column in the spreadsheet, I need a 2D array, the first row of which is a series of numbers (1, 2, 3, 4, 5, 6 etc) representing arbitrary time points, and the second row is the act
ual data from ONE column of the spreadsheet. I could then wire this 2D array to a waveform chart. I would need a separate 2D array for each column in the spreadsheet.
Could someone suggest how this can be done? Better yet, is there example code available somewhere that shows how to do it?
Thanks.
Array indexing in LabVIEW version 6i can be confusing.
I include an example code that you can study to see how it is done in your case.
Basically, you need to disable the row index when using the ArrayIndex function. In earlier versions of LabVIEW this was done by right clicking on the index-input and selecting disable/enable input but with the new version this is no longer needed. Just wire what you have and the other port will be disabled automatically. However, if you are using version 6i, make sure you wire the array to the ArrayIndex first. You should then get a 2D version of the Indexing function automatically. In older versions you had to manually drag it to a bigger dimension. Attached are two files. One data file, data.txt, with three rows and three co
lumns, and one VI, ColumnIndexing.vi, that reads out a specific column from that text file.
This example code is compatible with LabVIEW 4.1 and up.
Hope this helps. /Mikael
Attachments:
data.txt 1 KB
columnindexing.vi 21 KB
Similar Messages
-
How to read data from spreadsheet as a look up table
Hello Can anybody please help me out in this..??
I want to read data from a spreadsheet file as it is a look up table.
I want to create a program which lets the user enter an element which is be found in the data in the spreadsheet file and gives back the number which is to the adjoining column of the element in the spreadsheet file.
Example i have the following data in spreadsheet file:
Range Count
2 10
4 49
6 60
Etc.
If i enter 2 to search the data in the spreadsheet file, i do expect the program replies back with the answer 10 and so on...
Can anyone please help out...
Thanks in advance...apok wrote:
Why autoindex the output? You should only have 1 output. Besides, the Search 1D Array is simpler (no loop needed).
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Lookup Table.png 11 KB -
How to read data from a file that was formatted by excel?
Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?
http://jakarta.apache.org/poi/hssf/index.html
HSSF stands for Horrible Spreadsheet Format, but it still works! -
Vc++ how to read column header of cursor
How to fetch the Column name or header of the stored procedure which is using a cursor as the output.
P_out out sys_refcursor
need to read the column name of this output.
I am using Vc++ code to reterive the data, in Vc++ how to read column header of cursorYou haven't provided much detail to go on. How are you reading data from the ref cursor? Do you already have a reader from it?
Maybe this helps.
Greg
create or replace procedure proc1 (v1 out sys_refcursor) as
begin
open v1 for select * from emp;
end;
using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
public class RefCur
public static void Main()
using (OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl"))
con.Open();
using (OracleCommand cmd = new OracleCommand("proc1", con))
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new OracleParameter("v1", OracleDbType.RefCursor, ParameterDirection.Output));
cmd.ExecuteNonQuery();
using (OracleDataReader reader = ((OracleRefCursor)cmd.Parameters[0].Value).GetDataReader())
for (int i=0;i<reader.FieldCount;i++)
Console.WriteLine(reader.GetName(i)); -
[Urgent] How to read files from different directories?
I am new to Java Programming, I would like to know how to read files from directories other than the current one? (example as follows)
ProjectDirectory
|--MainDirectory
|--MainProgram.java
|--SupplementDirectory
|--SupplementProgram.java
|--Pictures
|--Image.gif
What should I write in the MainProgram.java so that I can use the supplementProgram.java from MainProgram and read the Image.gif file from the MainProgram.java?
ThanksRun through the I/O tutorial here. It should get you up to speed on this sort of thing...
-
How to read data from a CLUSTER STRUCTURE not cluster table.
Hi,
how to read data from a CLUSTER STRUCTURE not cluster table.
regards,
Usha.Hello,
A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
Regards,
Mansi. -
How to read data from a router by using labview
I am a beginner labview. How to read data from a router by using labview ?
What kind of data are you trying to read?
Does the router behave like a webserver that you log into? If so, search the forums for threads discussing HTML. -
How to read data from a connected modem
any one can help me? how to read data from a connected modem. The modem received real-time data from other server. The data is in text format. I can see this text when I used hyperterminal for dial up and the data is accumulated such as:
@aa1235678
@bb2135647
@cc5214367
since it is real-time data, I want to read one line each time instantly when it arrives.You need to use the Java Communications API. (http://java.sun.com/products/javacomm/index.html)
-
How to read data from a zipped MS Access file?
How to read data from a zipped MS Access file?
RPJ,
You do not need to use the Close Zip File.vi when you unzip a folder. This VI is used when you are creating a zip folder.
As for examples, I found a couple of ActiveX based MS Access examples. These programs look to be pretty basic. For more in depth example I would search Microsoft Developers Network
http://zone.ni.com/devzone/cda/epd/p/id/2188
http://zone.ni.com/devzone/cda/epd/p/id/1694
Regards,
Jon S.
National Instruments
LabVIEW R&D -
How to read data from an internal table into a real table?
Hello experts,
I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created. I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider. I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created. Please see code below.
TABLES MULTITAB.
DATA:
query_name TYPE RSZCOMPID,
s_cubename TYPE RSINFOPROV,
t_cell_data TYPE RRWS_T_CELL,
t_axis_data TYPE RRWS_THX_AXIS_DATA,
t_axis_info TYPE RRWS_THX_AXIS_INFO,
wa_t_cell_data like line of t_cell_data,
wa_t_axis_data like line of t_axis_data,
w_corp_tab like line of t_cell_data.
s_cubename = 'CORP_MPO1'.
query_name = 'Z_corp_test'.
CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
EXPORTING
i_infoprovider = s_cubename
i_query = query_name
i_t_parameter = query_string_tab
IMPORTING
e_cell_data = t_cell_data
e_axis_data = t_axis_data
e_axis_info = t_axis_info.
If anyone has any information to help me, I would greatly appreciate it. Thanks.Hi,
<li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
<li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
LOOP AT t_cell_data INTO wa_t_cell_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
LOOP AT t_axis_data INTO wa_t_axis_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
Thanks
Venkat.O -
How to read HyperLinks from pdf file??
hi developer's,
I am in PDF processing... I am having doubt in that Processing.
How to read Hyperlinks from PDF file?
I can able to set the hyperlink.. But i cant able to get the hyperlinks..
The following example program will set the hyperlink to the PDF file using lowagie API..
import com.lowagie.text.Anchor;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.HtmlWriter;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;
public class Argu1 {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter pdf = PdfWriter.getInstance(document,
new FileOutputStream("PageLink.pdf"));
PdfReader pdf_read=new
document.open();
document.add(new Paragraph("Hi Everbody....!"));
Anchor pdfRef = new Anchor("Click Me");
pdfRef.setReference("www.java2s.com");
Anchor rtfRef = new Anchor("Touch Me");
rtfRef.setReference("www.sun.com");
System.out.println(rtfRef.reference());
document.add(pdfRef);
document.add(Chunk.NEWLINE);
document.add(rtfRef);
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
document.close();
Help me how to read the Hyperlinks from the PDF file using java ...
Thanks in advance,
With Regards,
J.ImranInstead of cross-posting unformatted code you could have taken a look at the API, because there you might have come across a method named getLinks...Even though it's not documented, I really suspect that it will return the Hyperlinks on a given page.
-
Help me, How to read data from USB ???
Help me, How to read data from USB ???
If its a disk on key or some portable hard drive than once its connected to the usb and recognized by the system you can access it through java like you would access your hard drive.
-
How to read values from DMM4040
Hi,
I am using DMM4040, NI PXI 6509 device.
I need to make some port pins high which i have already done and now i have to read value captured by DMM then i have to make my port pins low if my value is within limits.
Can u suggest me how to read values from DMM and then by notification i ll make my port pins low.
'' A professional is someone who can do his best work when he doesn't feel like it''...........What language are you using? If using LabVIEW, you use the NI-DMM API to communicate with the 4040. Just take your reading, do your limit comparison, and set your lines based on the comparison results.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
JTable, how to read Data from it when enter is pressed
How to read Data from JTable on Return or lost focus from cell.
Also please tell me which listener I should should.
thx for helpYou should read the tutorial about tables, cell editors and models.
Also you should not [url http://forum.java.sun.com/thread.jsp?thread=472677&forum=57&message=2186815]crosspost
Mike -
How to read data from a file in OSB
hi guys,
Recently, I've got a problem with reading file from specific location. I've actually followed this post OSB 11g - Read or Poll File in OSB - Oracle Fusion Middleware Blog, and then
I know how to read a file. However, it does not as expected. Because, I've found no way to read data from the file. Therefore, no chance to manipulate the data like assigning to a variable, or extracting ....
Hence, is there any way to read data from file by using proxy service in OSB ??? No Java code ???
by the way, supposed that there is no way to read data from a file in OSB. So, What purposes will the way in the post above be used for?
Many thanks in advancehttp://jakarta.apache.org/poi/hssf/index.html
HSSF stands for Horrible Spreadsheet Format, but it still works!
Maybe you are looking for
-
Illustrator CS6 opening and saving problem. Please help
Hello I have Illustrator CS6 installed on windows 8.1. Every time I save a file as ai. format, it will automatically create a copy on the desktop. When I deleted the copy and try opening the original file, the error message "The file is an unknown fo
-
New to SAP XI BPM scenario File -- RFC -- File
Hi All, I am new to SAP XI BPM, My Scenario is : the input parameter for the RFC is sent through a file and the response from the RFC comes into XI which is then written into a file. Here my dought is How many Container I have to create... and tell m
-
ITunes is evil like the ouijia board...
I keep throwing it away, but it keeps coming back!! I'm a little scared. All the trouble started when I downloaded iTunes 7. I went to buy a video, and iTunes informed me I couldn't buy it w/o updating. So I figured, cool, they realized they have a c
-
Opening a Modal window from another Modal window
Hi All, I am opening a Modal window from a Modal window which has applets in it. But when the child modal window opens up from parent modal window, the applets on the child modal window are not loading properly. But when I change the child modal wind
-
My phone would randomly turn off and take awhile to turn back on. I usually have to manually turn it on but sometimes it doesn't work. Any reason for the cause of this? And options to fix it?