How to plot a graph from text file?

This is driving me nuts!
I would like to plot a list of numbers in a text file to a graph. Each munber is on a new line, like this -
345
356
378
379
345
etc.
I managed to import the file and split it with the 'Spreadsheet to array' function but can't get much further than that.
Help would be much appriciated.
Ben H

You just need to use the Read From Spreadsheet function and wire a 'True' to the transpose input. Wire the 1D array output to a graph.
Message Edited by Dennis Knutson on 10-20-2006 12:40 PM
Attachments:
Read From Spreadsheet.PNG ‏28 KB

Similar Messages

  • How to find largest number from text file

    I am using the "Read from text file" block to read the data from my .txt file into labview.  It is now in string format.  I have many numbers in the file.  
    For example:
    0.45
    0.35
    0.12
    1.354
    1.56
    2.89
    5.89
    0.56
    That is what a text file might look like.  I want to find which of these numbers is largest, and do calculations with that number.  I am having trouble with strings/number formats/arrays, etc.  Thanks
    Solved!
    Go to Solution.

    The spreadsheet functions and VIs typically work on strings representing numbers separated by delimiters.  This is a typical way to save a "spreadsheet" (of numbers) to a text file, for example .csv files.  These are quite versatile and powerful functions.  Spend a bit of time becoming familiar with them because you may find yourself using them a lot.
    Lynn

  • Continual plotting of data from text file

    I would like help with automated plotting of multiple sets of data on one axis. The file attached shows a sample of the data where the first number (eg 405) is the reference and the next two are the date and time. The data after that all needs to be plotted in a different color. The A.A.. (or .....) does not need to be plotted, the N/A's can be assumed to have either no reading or the same as the previous day. The data needs to be read from a text file and then graphed. The sample shows only a few variations and the reference number is incremented by 1 (I have shown random data) everytime the data is obtained from the source. Is this possible. If it is possible, the system will then need to be expandable to be able to updat
    e the graphs daily as the new data is obtained (although this is not so important at the moment). Can anyone please help me with detailed instructions if possible. All help will be greatly appreciated.
    Thanks
    Nath
    Attachments:
    SAMPLE.txt ‏1 KB

    I have written a rough vi for you in LV 6.0. Basically it shows how to open a file and write the string to an indicator. Then create an array from the numerical parts of the string which are plotted in a graph. I have assumed that the date/time and ref numbers will always be of the same format on each line of text.
    I'm not sure if i have done exactly what you want, but should give you an idea of what to do. Let me know if you have any problems..
    Kim
    Attachments:
    Create_graph_from_string.vi ‏51 KB
    sample.txt ‏1 KB

  • How to plot XY graph from 2 input of dynamic array ? ...

    I have 2 problem when I plot XY graph with 2 dynamic array :
    - I want to make the graph look like sweep chart. But it's seem not possible to use waveform graph?
    - The graph shoul move from left to right , then right to left, then left to right,.....
    Any one can give me some hints?  Thanks alot.
    Attachments:
    U1.PNG ‏21 KB
    XY radom value input.vi ‏147 KB

    I have to make Y change  from 0-10, then 10-0,.... Any one can help me to make it better?
    - How I shift the graph?
    Attachments:
    working_increse_decrease.vi ‏20 KB

  • How to read long line from text file

    Hi,
    I just faced problem when reading a big text file.
    BufferedReader br = new BufferedReader(new FileReader("D:\\afile.txt"));
    String str;
    int i;
    while ((str = br.readLine())!=null)
    i++;
    //do some work here...
    ...This code throws exception:
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap spaceSo I thought file line is very long. When I opened it in FAR it only displays no more than 4096 characters as a line.
    Help me to read a text file that's line is very long?

    try,
    $ java -X
    -Xmixed mixed mode execution (default)
    -Xint interpreted mode execution only
    -Xbootclasspath:<directories and zip/jar files separated by ;>
    set search path for bootstrap classes and resources
    -Xbootclasspath/a:<directories and zip/jar files separated by ;>
    append to end of bootstrap class path
    -Xbootclasspath/p:<directories and zip/jar files separated by ;>
    prepend in front of bootstrap class path
    -Xnoclassgc disable class garbage collection
    -Xincgc enable incremental garbage collection
    -Xloggc:<file> log GC status to a file with time stamps
    -Xbatch disable background compilation
    -Xms<size> set initial Java heap size
    -Xmx<size> set maximum Java heap size
    -Xss<size> set java thread stack size
    -Xprof output cpu profiling data
    -Xrunhprof[:help]|[:<option>=<value>, ...]
    perform JVMPI heap, cpu, or monitor profiling
    -Xdebug enable remote debugging
    -Xfuture enable strictest checks, anticipating future default
    -Xrs reduce use of OS signals by Java/VM (see documentation)
    -Xcheck:jni perform additional checks for JNI functions
    The -X options are non-standard and subject to change without notice.

  • Convert a line read from text file into string

    how to convert a line from text file into string?
    i know how to convert to numbers,
    private int  parseLine1(String line) {
              StringTokenizer tokenizer = new StringTokenizer(line);
                  value1 = Integer.valueOf(tokenizer.nextToken()).intValue();
                  value2 = Integer.valueOf(tokenizer.nextToken()).intValue();
                 return value1;
                     }but what about charactrs?

    ok, here is my problem, i have a file with a bunch of Xs in it but position function doesn't return a correct value, what's going wrong?
    private int positioni(){
           int i=0;
           int j=0;
           int b=0;
           String line="";
            while(line!= null){
                for(int a=0; a<line.length(); a++){
                    if(line.charAt(a)=='X'){
                        i=a;}
                b++;
                j=b;
                t=line.length();
                line=read(gridFileN);
           return i;
    private String read(String ggridFileN){
             TextStreamReader ggridFile = new TextStreamReader(ggridFileN);
             return ggridFile.readLine();

  • Read from text file and plot in real time

    Hello to everybody,
    I recently started using labview and so I know very few features, I apologize for any crap I'm about to write.
    My problem is as follows:
    _ A wireless node is sampling, with a known frequency, the voltage and the current of an electronic device
    _ These data are sent to a coordinator connected to the PC
    _ Each packet sent includes a single column with: Letter V followed by voltage samples, Letter I followed by current samples (all in a single column as in the attached example)
    _ The coordinator saves it in a .txt file
    I want to do a labview application that:
    _ Reads that file (continuosly update by the coordinator)
    _ Plots on two different graphs the values (over the time) of current and voltage
    Thanks for your help
    Danilo
    Attachments:
    TextData.txt ‏1 KB

    There are File IO examples that ship with LV which show you how to write to red from a file . A more fundamental question though is why have the file at all? Is it serving strictly as a data communication channel, or will it be used for something else?
    The "coordinator" that you mention, can it be accessed directly? Serial IO? TCP/IP? Telnet? ActiveX? .NET? Anything?
    If so, that would be the preferred way to handle this situation.
    Mike...
    PS: Sorry for the next bit, but I used to be a magazine editor and my grandmother was a school teacher so I am just a tiny bit anal retentive about word usage: In English "data" is a funny word in that while it is a singular form, it is (depending upon context) often understood to referring to multiple things and so can be sort of plural. Consequently, it is proper to say: "This data is sent.. " or "The data indicates...", but not, "The data are showing..". Likewise it is always incorrect to try to make it plural by saying "datas".
    PPS: The same goes for the word "code" when used as a noun. It can also be a verb, but that's a whole different rant...
    PPPS: Also be aware that many of the people who know me well would object to the "tiny bit" part...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to open saved files using 'read from text file' function

    Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?
    Here are some screenshots on part of my program  
    let me know if you guys would need more information / screenshots thank you!
    Attachments:
    ss_save.jpg ‏94 KB
    ss_open.jpg ‏94 KB
    modified_writetotextfile.jpg ‏99 KB

    Ohmy, thanks altenbach. oh yeah i forgot about those sub VIs. will upload them now. Was rather demoralized after reading the comments and really struck me on how weak i'm at on labview really hope to get this done. But of course i have to study through and see how it works. Actually i am going to replace those 'signal generators sub vi' with ThoughtTechonology's sample code so i can obtain data waveforms real-time using Electrocardiography (ECG) ,Electromyography (EMG ) and Electroencephalography (EEG) hopefully i can find out how to connect the sample code.
    ( ps . cant connect it now unless my program is working otherwise labview will crash ) 
    ( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose )
    The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project
    Attachments:
    frequency detactor.vi ‏53 KB
    signal generator.vi ‏13 KB
    attachment.ashx.vi ‏40 KB

  • How to create PDF from text file with specific layout?

    I wanted to create the pdf from text file in specific layout - Landscape orientation and JIS B3 Page size while at Adobe Acrobat Pro.
    In past, I could do a right click on a text file (desktop area) and select print to print out the document into .pdf BUT only if I set the Adobe PDF to Landscape and JIS B3 Page size BEFORE.  And I could only do 15 text documents at once.
    I wanted to see if I could do the create the pdf from text file with specific layout in Adobe Acrobat without having to go to Control Panel to preset the Adobe PDF to specific layout at every time.   I would have to set Adobe PDF back to normal layout after I'm done with these pdf print outs.  I do lots of pdfs in normal layout.  Sometimes I would forget to do that.
    So, How do I do that?

    No such luck.  It would output the contents in letter size even in JIS B3 Page layout at MS word. 
    Is there a script or action where I could set the orientation and page size before creating PDF on these text files?

  • Where are these unix executable files coming from and how do I recover the original text file?

    where are these unix executable files coming from and how do I recover the original text file?

    When you upgraded to Lion did you have AppleWorks installed on your mac?
    Most of the AW documents can be opened by Pages 09 or Numbers 09 with most of the orginal format in tact. (I do not know if previouse verision will work) just open the AW file with both and see which one works best.
    Text Edit will also open most of the AW files as well but will require a lot of work to restore them to their orginal format.
    If you have AW Database documents then they are not supported. 
    These document show up as "exec icons", Kind: Unix Executagle File.
    They also will show up as .cwk file if they are small files. I have a couple that were under 1mb that are shown as " Kind: AppleWorks Document" but will not open.
    The only option to open AW database is to have AW installed on a mac with a pre-Lion OS to recover the file.

  • How to plot waterfall graph in vb6 from offline data

    How to plot waterfall graph in vb6 from offline data?The data load from SQL Server Database.Thanks.

    asrol,
    If you look at the Plot Styles example in the folder I mentioned in the previous post there is a section of code there that you might want to refer to in order to recreate your data.
    '=============================================================================
    ' Plot Curve Button Handler
    '=============================================================================
    Private Sub PlotCurve_Click()
        ' Create curve data
        Dim x(40)
        Dim y(40)
        Dim z(40)
        For i = 0 To 40
            x(i) = Sin(i / 3#)
            y(i) = Cos(i / 3#)
            z(i) = i
        Next i
    In this example they create 3 arrays to represent the three dimensions of the array. For your case if you were to plug your data into two of the array (axes) that would give you the data for the channels, then you can simply input a constant for the third array it would produce a single line of your data as shown in your example GIF.  You can then repeat this process for each set of data, with a new constant value for that third axis, and it should manually create a graph that will look something like you desire.
    John B.
    Applications Engineer
    National Instruments

  • How to Send Multiple Plot XY Graph from LabVIEW to Microsoft Excel

    The link below describes exactly what I would like to do, however the link to the solution/work around does not work.
    Has anyone got an alternative solution?
    http://digital.ni.com/public.nsf/allkb/CFD30D5E9C01AB5386256CFB0082AF3E

    Please check the link again as it seems to be working fine now.
    How to Send Multiple Plot XY Graphs from LabVIEW to Microsoft Excel:
    http://digital.ni.com/public.nsf/allkb/CFD30D5E9C01AB5386256CFB0082AF3E
    The standard Excel Insert Graph.vi cannot insert multiple XY Graphs to Microsoft Excel, so you will need to use the Report Generation Toolkit for Microsoft Office.  You will find a link to an example program at the bottom of the page.  I have also attached it below.
    Attachments:
    example.zip ‏35 KB

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • How can we read a column from text file

    hai,
    the Text file contains :
    m1 m2 m4 89
    m1 m2 m4 89
    m0 m4 m2 90
    I need one array for each column
    m[0]= m1,m1,m0 (first column from text file)
    m[1]= m2,m2,m2 (second column from text file)
    m[2]= 89,89,90 (third column from text file)
    andvance thanks

    If a 2D array is OK (instead of 4 separate arrays), try something like this
    import java.io.*;
    import java.util.ArrayList;
    class FileReadColumns
      public static void main(String args[]) throws IOException, FileNotFoundException
        String line;
        ArrayList lines = new ArrayList();
        BufferedReader in = new BufferedReader(new FileReader("data.txt"));
        while ((line = in.readLine()) != null) lines.add(line);
        String bits[];
        bits = lines.get(0).toString().split(" ");
        String grid[][] = new String[bits.length][];
        for(int i=0;i<grid.length;i++)grid[i] = new String[lines.size()];
        for(int i = 0; i < lines.size(); i++)
          bits = lines.get(i).toString().split(" ");
          for(int ii = 0; ii < bits.length; ii++) grid[ii] = bits[ii];
    for(int i = 0; i < grid.length; i++)
    for(int ii=0;ii<grid[i].length;ii++)System.out.print(grid[i][ii]+" ");
    System.out.println();
    System.exit(0);

  • How to plot waterfall graph in vb6.Attach​ed sample graph for your reference.

    Thanks John for your answer. Attached file the sample graph what i really want to plot it.Any body can help me.Thanks.
    Attachments:
    waterfall.gif ‏81 KB

    Hello asrol,
    Please try to post replies under the same thread so that it is easier for everyone to keep track of your issue. Thanks!
    Original thread: How to plot waterfall graph in vb6 from offline data
    John B.
    Applications Engineer
    National Instruments

Maybe you are looking for