Read and sort values present in .ini file

Hi all,
I have a .ini file in which a set of modules with there order of execution is mentioned.I want to get all these values sorted as an array so that I can proceed with the execution of each in the order mentioned.The module list in the .ini file looks like this:
Here, digits represent the order of execution of module.
I should get output as an array with following values:
1 MNO
2 DEF
3 STU
4 PQR
5 GHI
6 VWZ
7 ABC
8 JKL
I know about config data and read key vis but since the module list is huge I dont know how to write an efficient code for this.All suggestions are welcome.
Thanks.
Solved!
Go to Solution.

The snippet below should be very close to what you want.

Similar Messages

  • Read and sort a semicolon seperated csv file

    Hi all,
    I need to sort the given csv file columnwise (alphabatically)... which means the corresponding row/rows also have to be sorted. need help.
    the csv file looks like:
    Wear;9;;;
    ;;;Image;1
    ;;;Area;2
    ;;;ner;3
    ;;;Content;1
    ;;;BContainer;1
    ;;;View;1
    VIEW;10;;;
    ;;;get;8
    ;;;ner;1
    ;;;View;1
    ACTIVE;21;;;
    ;;;Image;1
    ;;;get;7
    ;;;Area;4
    ;;;ner;1
    ;;;de.vw.mqbkombi.widgets.TransitionContainer;3
    ;;;Aget2;2
    ;;;ner2;1
    ;;;Sget;1
    ;;;iView;1
    The idea is to first sort Wear,VIEW, ACTIVE alphabatically (columnwise), making sure all the rows that they have are also moved.
    after that, alphabatically sort all the in-between rows.
    would appreciate the help from any expert on csv, excel table.

    doremifasollatido wrote:
    If you know that your columns never have embedded semicolons, you could call String.split to split each row at semicolons. Although you could leave the results in the arrays that String.split gives, you should probably create a Java class to represent each row. It will make your code easier to understand, and you could also more easily represent numeric values as numbers such as primitive int values (so that they sort correctly as numbers instead of as Strings). Then create a List of instances of that Java class, and sort the list using Collections.sort and a custom java.util.Comparator.Or indeed make it Comparable; but I'd agree this is definitely the way to go.
    Also, assuming that all your "secondary" rows, such as:
    ;;;Image;1
    ;;;Area;2
    refer to the preceding "primary" (Wear;9;;;), I'd suggest you fill in the unsupplied values for them. That will allow you to sort them all in one go. It might also be worth including a type in your "Row" class (maybe as an enum); alternatively you could have two different subclasses of a common Row class.
    Winston

  • Can we pass IT table name dynamically to READ and SORT stmt

    Hello All,
      i have a requirement in which i am passing table name using a variable and want to read the same table: so my question is can we execute read and sort stmt with dynamic IT name. please see below for explaination.
    v_itname = <it_2>.
    now read using variable
    READ table ( v_itname ) with key <field>.
    and
    SORT ( v_itname ) by (otab).
    thanks
    Mani

    Hi ,
    This can be done. Please refer to the  codes below. Please note that the code will work if the itabs are of type standard table else it may dump.
    You just need to replace the variables form the values from your internal table.
    DATA: v_table1(10) TYPE c VALUE 'I_MARA',
          v_field(10)  TYPE c VALUE 'MATNR',
          i_mara TYPE STANDARD TABLE OF mara.
    FIELD-SYMBOLS : <fs_tab>   TYPE STANDARD TABLE,
                    <fs_field> TYPE ANY.
    DATA: otab TYPE abap_sortorder_tab,
    oline TYPE abap_sortorder.
    SELECT * UP TO 10 ROWS
      FROM  mara
      INTO TABLE i_mara.
    IF sy-subrc = 0.
      ASSIGN (v_table1) TO <fs_tab>.
      IF sy-subrc = 0.
        oline-name = v_field.
        APPEND oline TO otab.
        SORT <fs_tab> BY (otab).
        READ TABLE <fs_tab>
        WITH KEY (v_field) = '000000000020000989' "
        BINARY SEARCH
        TRANSPORTING NO FIELDS.
        IF sy-subrc = 0.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    Dev.

  • Problem on reading and writing from from a *.txt file

    I get Problem on reading and writing from from a *.txt file. The following is the read() method...
    The software said the DataInputStream is depreciated. Can anyone help me please?
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        String str = "";
        try
          in = new BufferedReader(file);
          //in = new FileInputStream(file);
          for(;;)
            str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);
      }

    Thank you for your reply. I have made some change. However, there is an incompetable type found error.
    in = new BufferedReader(new InputStreamReader(in));The following are all of the code.
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        //BufferedReader in = null;
        String str = "";
        try
          in = new BufferedReader(new InputStreamReader(in));
          //in = new FileInputStream(file);
          for(;;)
            BufferedReader Bstr = new BufferedReader(new InputStreamReader(in));
            //str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • I want to read and assign value of ADF Table rows  with Java Script

    Hi,
    I want to read and assign value of ADF Table rows with Java Script, but I cant true index of current row , so I assign wrong value to anathor column of ADF Table.
    My Code;
    ADF Table items
    <af:column sortProperty="Adet" sortable="false"
    headerText="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.labels.Adet}"
    binding="#{backing_ucret.column2}" id="column2">
    <af:inputText value="#{row.Adet}"
    required="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.attrDefs.Adet.mandatory}"
    columns="10"
    binding="#{backing_ucret.inputText2}"
    id="inputText2" onchange="getTutar('#{bindings.voHarcamaOdeme1Iterator.rangeStart + bindings.voHarcamaOdeme1Iterator.currentRowIndexInRange + 1}','#{bindings.voHarcamaOdeme1Iterator.estimatedRowCount}','#{row.index}')">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.formats.Adet}"/>
    </af:inputText>
    </af:column>
    MY JAVA SCRIPT CODE
    <f:verbatim>
    <script language="javascript" type="text/javascript">
    function getTutar(rowkey,totalrow,currentRow){
    alert('rowkey--totalRow--currentRow-->'+rowkey+'--'+totalrow+'--'+currentRow);
    if (currentRow==0) {
    rowkey=totalrow-1;
    }else{
    var rw=totalrow-currentRow-1;
    rowkey=rw;
    alert(document.getElementById('form1:table1:'+rowkey+':inputText8').value);
    alert(document.getElementById('form1:table1:'+currentRow+':inputText8').value);
    var birim_ucret=document.getElementById('form1:table1:'+rowkey+':inputText8').value;
    var adet=document.getElementById('form1:table1:'+rowkey+':inputText2').value;
    document.getElementById('form1:table1:'+rowkey+':inputText3').value=birim_ucret*adet;
    document.getElementById('form1:inputText6').value=0;
    var t;
    var toplam=0;
    alert('before Sum');
    for (var i=0;i!=totalrow-1;i++){
    t = document.getElementById('form1:table1:'+i+':inputText3');
    toplam+=t.value*1;
    document.getElementById('form1:inputText6').value=toplam;
    </script>
    </f:verbatim>

    You can achieve the use case you describe with partial page rendering (PPR), a feature of the ADF Faces framework. Here are a few posts that achieve an interactive behavior using PPR. Off the top of my head I do not know of an exact example, but this should be a good starting point:
    http://thepeninsulasedge.com/blog/2006/09/12/adf-faces-aftableselectmany/
    http://thepeninsulasedge.com/blog/2006/08/31/adf-faces-working-with-aftableselectone-and-the-dialog-framework/
    --RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reading and Sorting from a CSV file

    I have an assignment to read a shopping list from a CSV file, sort the items and print or write the items to a text file. I have an idea though. I intend to use vectors to collect the items from the CSV file and then sort the list and write to a txt file. Someone tell me whether this is a right approach or suggest simpler approach. thank you.
    Derry

    Sounds reasonable.
    Rather than Vector, though, I'd use ArrayList (a very near replacement for Vector) or possibly LinkedList or even Set or Map. (Vector is a legacy class, kept around for backward compatibility.)
    http://java.sun.com/docs/books/tutorial/collections/
    Make sure each element in the List corresponds to one row in the file. Those elements should be a class you define whose member variables correspond to the columns in the file. (So if the file has Last, First, Bday columns, your class would have lastName, firstName, and birthday fields.)
    Make your class Comparable, or implement a Comparator, to make sorting straightforward.
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Comparable.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Comparator.html

  • DC noise values set from ini file

    Hello,
           I am trying to build a waveform generator with ( sine wave, triangle, saw tooth, square, DC,  random noise). I managed to get the waveform working using the NI waveform generator built in VI function. but I want to add the DC case which I manage to do. but I want the values (amplitude and frequency ) to be in an ini file. My idea is to manual set the values in the file, once I run the vi and select the DC noise case, it should read the file get the values and output the data and once I stop it, it saves the dc values before exiting.
         I am kind of stuck trying to figure how to do this. I hope I was clear enough. I don't have code to show since I havent started coding on that part yet. Please help.
    Solved!
    Go to Solution.

    Clearly enough explained.
    Have a look at the configuration file VIs, found in File I/O > Config File VIs. There are also plenty of examples n the community, as well as in the Example Finder, which show how to use these. A good place to start is the Write Configuration Settings File example in the Example Finder, as well as Read Configuration Settings File.
    Your .ini file will look something like this, once created:
    [DC Noise Settings]
    Amplitude = 1.234567
    Frequency = 8.901234
    This is equivalent to:
    [Section Name]
    Key 1 = Value
    Key 2 = Value
    When asked to read a specific key from a certain section, the read VI scans through the file for the named section, then looks for they key name that you've provided it. Bear in mind you'll need to know what the data type is when you read back.
    You can use the write VI to modify specific keys in specific sections once you close the file.
    This is one of a multitude of methods you could use to do this, but is probably the simplest.
    CLD

  • What is the best way to read and manipulate large data in excel files and show them in Sharepoint

    Hi ,
    I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
    What is the best way to read the data form the excel file in fastest and most efficient way.
    2 nd Problem,
    I have one excel file that has many rows each row contain some data that has certain keywords.
    What I want is  to segregate the data of rows into respective sheets(tabs ) in the workbook.
    for example in rows have following data 
    1. Alfa
    2beta
    3 gama
    4beta
    5gama
    6gama
    7alfa
    in excel
    I want there to be 3 tabs now with each of the key words alfa beta and gamma.

    Hi,
    I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
    as there's size limitations (probably the default max size is 10MB).
    Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
    However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Message Mapping, First and last values in a CSV file

    I'm having problems with a Message Mapping that requires me to take the values from the first line in a CSV and the last line to calculate other values...
    The source message type in my mapping is as follow
    <MT_Message>
        <Header>                  1..1
             <ID>
             <StartDate>
             <EndDate>
       <Records>                 1...unbounded
               <Interval>
               <Number>
    I need to take the first row/occurence of Records and use this to calculate the Startime. I also need to take the last occurence of Records to calculate the stop time
    This is my CSV file content
    H     FORECASTS      20080101     20081231     17568
    D     20080101     1     1     66.29283
    D     20080101     1     2     61.1344
    D     20080101     2     1     61.1344
    In this case I need to take  the values 1     1 for the StartTime and 2    1 for the StopTime.
    How can this be done?

    Damien,
    Do  u have problem with mapping or content conversion. According to my understanding the problem is with content coversion. U can't take the first and last values in CSV file. Probably u can import all the values and during mapping u can seggregate the required structure alone.
    Best regards,
    raj.

  • Reading and Inserting Value in Long Raw

    Hi guys !!
    I have a table with 15 columns out of which RESUME column has data type long Raw. I want to copy this table to another table with selectd columns and validation. I want to check whether RESUME column is NULL. How to achieve it ?
    Similarly, using VB how to insert and retrieve values in such column ?
    thanx in advance
    Abhi

    do one thing ,
    Create a summary item for detail amount column, say m_tot_amt
    Set its fol. properties
    Calculation Mode : Summary
    Summary : Sum
    Summ.Blk : Your detail blk
    Summ. Item : Your detail amount item
    Also, Set Query all records of your detail block as Yes
    Then In PRE-INSERT/ PRE_UPDATE of detail block, write
    :COP_ORDER_HEADER.DISCOUNT_AMOUNT := nvl(:m_tot_amt,0) ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Cretaion of UTL.File in Oracle 10G and directory entry in Ora.ini file

    Hi,
    Kindly advise me if:
    (!) we can create a directory and log file in this directory on some other server instead of creating it in the file system of the server where the Oracle 10G database is residing?
    Created directory in Oracle using create or replace directory command.
    My package will be creating a log file using UTL.File in the above directory.
    I want to create this directory on some other server to save my log file/s. Is this possible?
    (2) Also, let me know in Oracle 10G, do we need to add the directory entry (mention above in #1) in the Ora.ini file on the Oracle 10G server?

    Hi,
    1) utl_dir are different from directory object
    2) you cannot create directory on remote server and there is no need to write directory entry on oracle init file (not ini..)
    Acr

  • I just downloaded adobe reader and can't print a pdf file

    i just downloaded adobe reader and cannot print a pdf file.

    Same or related issue.
    After installing latest updates of Mac Mavericks and Adobe Reader, I can't open pdfs downloaded from the web or print pdfs from the web. Using "export" doesn't help. Same with the print/pdf workaround.
    I uninstalled/reinstalled Reader. I indicated Adobe Reader as my default opener for pdf-type files. No help.
    I'm using Safari.

  • How to capture the data within the given range of maximum and minimum values ? from csv files

    My requirement,
    1. Here, the user will provide the range like maximum and minimum values, based on this range, the VI should capture the data within the given range. ( from CSV file as attached )
    2. Then VI should calcluate the average value for captured data and export it to excel.
    This is my requirement can anyone help me on this.
    Many thanks in advance
    rc_cks
    Attachments:
    sample_short.csv ‏2439 KB

    Hi,
    Thanks for remnding me. I forgt to attach the VI, 
    Here I am attaching the VI, what I tried. 
    From attached CSV file, I have to find an average value for columns B,C,D,E,F,G,H,I and AJ, AK. ( data range will be defined  by user ), focused only on these columns
    Here, the scope is to calculate an average value for given data range by user as MAX and MIN data.  
    FYI:  I tried manually for two instance i.e column H & I.  As per H column one steady state values from  7500 to 10500 and similarly in I column 7875 to 10050. So, I gave these as a limit to capture and calculate the average value. But unfortunaltely, requirement has been modified as per below requirements.
    More Info on requirement: 
    --> The user will define the range of data by giving some MAXIMUM and MINIMUM values(for above mentioned columns induvidually), then VI should capture          that data range and it has to caculate the average value for that range of data. This is the task I have to complete. 
    --> I am stuck in creating a logic for data capturing for given range of MAX and MIN value from user, 
         Can anyone help me on this. 
    If my explanation is not clear, Please let me know.  
    Many thanks, help mw
    rc
    Attachments:
    VI_rc.vi ‏25 KB
    sample.zip ‏4166 KB

  • I Lost Power to my PC while in Acrobat Reader and lost data, where is temp file located?

    I lost power to my pc while typing a new acrobat reader file but never saved it, where is the default temp file located, if this exists? Thanks.

    The answer to your question depends upon your version of Reader and your OS. Especially since the last version of Acrobat Reader was version 5 which is four majors versions ago. The last four versions have been called Adobe Reader, not Acrobat Reader. This the forum for the Acrobat commericial product, not the free reader product.  
    PDF files cannot be edited in Reader and fields filled in with Reader cannot be saved (unless especially enabled) canot be re-opened from the temp files. To make a long story short. You will need to re-type the information. 
    Sorry to be the bearer of the sad news.

Maybe you are looking for