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

Similar Messages

  • How to find PO number from ORDRSP Idoc.

    Hi,
    Can  anybody let me know how to find the PO number from the Idoc ORDRSP.
    Scenario is as below:
    SAP system1 will send PO to SAP system2.(Idoc type ORDRS05).
    When SO is created in SAP system2, it will send a confirmatory Idoc of message type ORDRSP.
    From this I have to find  the PO number as I can find only VBLNR.
    Points assured for workful solutions.
    -B S B

    Hi BSB,
    CHECK THIS CODE
    DATA : BEGIN OF itab_status OCCURS 0,
              idoc           LIKE edids-docnum,
              date_stauus    LIKE edids-logdat,
              status_counter LIKE edids-countr,
              status         LIKE edids-status,
              descrp(70),
              ponumber       LIKE ekpo-ebeln,
              mess           LIKE edidc-mestyp,
    END OF itab_status.
    DATA: text111        LIKE e1mbxyi.
    DATA: text11         LIKE e1edp02.
    IF itab_status-MESS = 'WMMBXY'.
       select single * from edid4  INTO ITAB where segnam = 'E1MBXYI' AND
                     HLEVEL = '02' AND DOCNUM = itab_status-idoc.
    MOVE  : ITAB-SDATA  TO TEXT111 ,
    text111-EBELN TO itab_status-ponumber.
    ELSE.
    YOUR CASE FALLS IN THIS CATEGORY****
    select single * from edid4  INTO ITAB where segnam = 'E1EDP02' AND
                     HLEVEL = '03' AND DOCNUM = itab_status-idoc.
    MOVE  : ITAB-SDATA  TO TEXT11 ,
    text11-BELNR TO itab_status-ponumber.
    ENDIF.
    endif.
    LET ME KNOW IF YOU NEED ANYTHING ELSE.
    THANKS
    VENKI

  • Extracting number from text files for variable

    Hello again,
    I have several different types of text files all with the line
    # NPTS=32768  DT=0.005
    somewhere in the file.  The numerical values are different for each file and I need to pull them out to assign as a variable for a program I am running.
    How can I search a file and pull out each of these two numbers?
    Thank you

    Procyon's sed script assumes that the NPTS number and the DT number will both always have a period in them. In the original, the NPTS number doesn't have a period, and I don't know whether the DT number may lack a period.
    You could try this instead (replacing the 's~....~p' part of Procyon's script):
    's~# NPTS=\([0-9.]*\) *DT=\([0-9.]*\)~\1,\2~p'
    That may let in stuff you want to exclude, for instance, it would let in:
    NPTS=0.0.0.0.0 DT=1.1.1.1.1
    and:
    NPTS=....... DT=
    and so on. But it's a tradeoff: if you know your data doesn't include anything like that, you can go with a simpler sed script. If you need to be fussier about what you're matching, then your sed script will need to be more complex.
    EDIT: What I said in first paragraph is wrong. I overlooked the '*' after the '\.' in Procyon's script. What he's got will permit but not require a period. My final point still applies, though, to both of our suggestions. His script and my script would both match the second of my bad cases.
    Last edited by Profjim (2008-09-17 21:31:34)

  • 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

  • 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.

  • Find line number in text file

    Hi all,
    I need to find the line numbers on a file where a particular string matches.
    for example:
    A lazy cat
    A strong cat and it is black
    Black is not good
    So I will match for the word black and it will give the numbers say line 2 and 3 it found the match.
    I am using the code:
    try{
        // Open the file that is the first
        // command line parameter
          FileInputStream fstream = new FileInputStream("c:\\test.log");
        // Get the object of DataInputStream
          DataInputStream in = new DataInputStream(fstream);
          BufferedReader br = new BufferedReader(new InputStreamReader(in));
          String strLine;
         String[] arr= null;
        //Read File Line By Line
       String regex = "black";
       while ((strLine = br.readLine()) != null)   {
        // Split the sentence into strings based on space
           arr = strLine.split("\\s");
       if (arr[0].equalsIgnoreCase("black"))
          System.out.print("match found");
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(strLine);Thanks in advance.

    camellia wrote:
    I need to find the line numbers on a file where a particular string matches. Then declare a variable for line count. Find where you read in a line. Finally increment this variable each time a line is read.
    It isn't rocket science.
    Mel

  • How to find number from text string??

    Hi All,
    Can you tell me how to find/ fetch number from string?
    is there any function module  for this.?
    for example , I have string like "+++++1000000589+++"
    and I need to fetch the invoice no 1000000589 from the above string..then  How to do that? Letters may come first or number may come first and latter text...
    Regards,
    Mrunal

    You can do like this.
    The below mentioned is code separate material
        DO 18 TIMES.
          LV_C = LV_C + 1.
          LV_C1 = LV_C - 1.
          IF  GW_MATNR-MATNR+LV_C1(1) CN '0,1,2,3,4,5,6,7,8,9' .
            IF ( ( LV_MAT EQ SPACE ) ) ."  and ( lv_prefix eq space ) ) .
              LV_PREFIX = 'X'.
              CONCATENATE GW_TEMP-PREFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-PREFIX.
            ELSE.
              LV_SUFFIX = 'X'.
              CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-SUFFIX.
            ENDIF.
          ELSEIF ( ( LV_SUFFIX EQ SPACE ) ) .
            LV_MAT = 'X'.
            CONCATENATE GW_TEMP-MATNR1 GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-MATNR1.
          ELSEIF ( ( LV_MAT EQ 'X' ) ) .
            CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-SUFFIX.
          ENDIF.
        ENDDO.

  • 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();

  • 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 find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to find the number of occurance of a string in text field of Infopath form?

    Hi All,
    In Infopath text field, How to find the number of occurrence of a particular string in that field?
    Thanks in advance!

    You can check to see if it contains a string once by using the contains function, but there isn't a very clean way to do what you want. If you wanted to guess at the maximum number of occurrences, then you could:
    Box A has your initial. Set Box B to do a concat of string-before and string-after of Box A where it copies Box A minus the string we're looking for. Then we have Box C that does the same thing to Box B. Repeat as many times as you see necessary.
    Example:
    String: "1"
    Box A - "123451234512345"
    Box B - "23451234512345"
    Box C - "2345234512345"
    Box D - "234523452345"
    etc.
    We then have a field that has nested ifs looking backwards from Z -> A looking for a non-blank. Based on that, we return the number of occurrences. Again, this isn't clean, but it will work if you think there's a predefinable maximum.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • How to find the number of fetched lines from select statement

    Hi Experts,
    Can you tell me how to find the number of fetched lines from select statements..
    and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
    Thanks in advance
    santosh

    Hi,
    Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
    For ex:
    data: itab type mara occurs 0 with header line.
    Select * from mara into table itab.
    Write: Sy-tabix.
    This will give you the number of entries that has been selected.
    I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
    Hope this helps,
    Sudhi
    Message was edited by:
            Sudhindra Chandrashekar

  • How to find the number of users  connected to database from OS level(Linux)

    Hi All,
    Could anyone know , how to find the number of users connected to database without connecting with sql*plus
    is there any command to find it?
    example we have 10 databases in one server, how to find the number of users connected to particular database without connecting to database(v$session)?
    oracle version:- 10g,11g
    Operating System:- OEL4/OEL5/AIX/Solaris
    any help will be appreciated.
    Thanks in advance.
    Thank you.
    Regards,
    Rajesh.

    Excellent.
    Tested, works as long as you set the ORACLE_SID first ( to change databases )
    ps -ef | grep $ORACLE_SID | grep "LOCAL=NO" | awk '{print $2}' | wc -l
    Thanks!
    select OSUSER
        from V$SESSION
    where AUDSID = SYS_CONTEXT('userenv','sessionid')
        and rownum=1;Best Regards
    mseberg

  • 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 to find out who's texting you from an iCloud email address?

    how to find out who's texting you from an icloud email address?

    OK after a bit of research I found a way to achieve this.
    I simply looked up the email address in ADUC, then did a search in SP with the display name. I could locate the list and manually confirm it was configured with the incoming email address I was looking for.
    I also found the below script on Stackoverflow, but got "The 'using' keyword is not supported in this version of the language." when I tried to run it. Any idea how to fix that? I'd like to have a script to link a library to an email address istead of the
    manual approach described above.
    http://stackoverflow.com/questions/4974110/sharepoint-how-do-i-find-a-mail-enabled-list-if-i-only-have-the-email
    $SiteCollection = ""
    $EmailAddress = "" # only the part before the @
    # Load SharePoint module if not done yet
    if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {Add-PSSnapin Microsoft.SharePoint.PowerShell;}
    cls
    using System;
    using Microsoft.SharePoint;
    namespace FindListByEmail
    class Program
    {a
    static void Main(string[] args)
    string siteUrl = $SiteCollection;
    string email = $EmailAddress;
    using (SPSite site = new SPSite(siteUrl))
    foreach (SPWeb web in site.AllWebs)
    try
    foreach (SPList list in web.Lists)
    if (list.CanReceiveEmail)
    if (list.EmailAlias != null && list.EmailAlias.Equals(email, StringComparison.InvariantCultureIgnoreCase))
    Console.WriteLine("The email belongs to list {0} in web {1}", list.Title, web.Url);
    Console.ReadLine();
    return;
    finally
    if (web != null)
    web.Dispose();

Maybe you are looking for