Compare two .txt files and show result

HI
Could anybody show me how to compare two text files and show the result.
i.e.
textfile1.txt
harry.denmark
karry.sweden
textfile2.txt
harry.denmark
karry.sweden
marry.usa
Compare
result=
marry.usa
The text files I want to compare are how ever much larger than this example. (up to 2-3.000 words)
anybody ??
Sincerly
Peder

HI & thanks for reply
I know almost nothing about java so could you or anybody please show me the code to do this? Or is it perhaps too large or difficult a code?
I know how to compile a .java file and run it in prompt :-) and thats about it (almost)
I offcourse understand if its too much to ask for :-)

Similar Messages

  • Scanning .txt file and outputting results?

    Greetings Everyone. My employer has charged me with a rather
    confusing task. Basically I need to scan a .txt file and retrieve
    some information from it. Here is a little background on the file
    itself.
    This is a feed file containing the information for employees
    such as name, department, employement status etc...Zeros are used
    in place of spaces in this file. What I am charged with is
    retrieving the employment status and name for every single person
    in the file (60,000+).
    I need to write a coldfusion script that can do the
    following.
    1. Scan a .txt file that is sent to me every night and look
    for the 99th character on each line of the .txt file
    2. If the 99th character is a 'T' I need to pull characters
    '10-50' (which contain the name for that person).
    3. Output the results of the scan to a coldfusion page
    displaying the individuals' names.
    If anyone out there can point me in the right direction I
    would be very grateful. I've been looking for websites on this
    topic but I have been unsucessful so far. Should I post this in the
    advanced section of the cf forums? Once again, thank you for any
    help you can give me.

    I guarantee you can do this! And it shouldnt be to hard so
    you can breath a sigh of relief... :)
    I would use <cffile action="read" file="filepath/name.txt"
    variable="fileContents">
    Then you should be able to do something like <cfset
    fileArray = ListToArray(fileContents, "#CHR(13)##CHR(10)#")>
    Now you have an array so you can loop through and try
    something like the following...
    <cfloop index="i" from="1" to="#ArrayLen(fileArray)#"
    step="1">
    <cfif fileArray
    NEQ "">
    <!--- Find 99th Char --->
    <cfset 99thchar = Mid(fileArray, 99, 1)>
    <cfif 99thchar EQ "T">
    <!--- Get Name --->
    <cfset empName = Mid(fileArray
    , 10, 40)>
    <!--- Change 0's to Spaces--->
    <cfset empName = Replace(empName, "0", "#CHR(32)#")>
    <cfoutput>#empName#</cfoutput><br />
    </cfif>
    </cfif>
    </cfloop>
    That should be close to what you could use... You may have to
    tweak it a bit... now if it is going though 60000+ records this may
    take a while...lol You might have to use the cfsetting tag to
    extend the normal request timeout..
    Hope this helps!

  • Help needed to compare two Key Figures and show out put

    hello experts,
                       I am comparing the Sales data for two year/month. I need to compare these two KF and show the result only if one is greater than the other by 40%. Sample
    Jan/2008                             Jan /2007
    400                                      600
    500                                      300
    300                                      700
    600                                      400 
    The columns should be outputted only if Jan 2008 is greater than Jan 2007 by 40% for all customers in a business area. Thank you all in advance.
    Regards,
    -Akash

    Hi Akash,
    Your requirement could be met by
    Creating a Calculated Key Figure say variance = ( ( Jan2008 - Jan2007 ) / Jan 2008 ) *100
    Then create a new Condition on  Variance so as to display rows only when Variance > 40
    Hope this solves ur issue.Do revert
    Vasavi

  • How do I compare two csv files and not disable the user if the username is found in the 2nd file using powershell?

    Hi Guys
    I have two csv files with the following headers and I need to import both files into the script to check whether the StaffCode is present in the Creation/Renewal of Contract csv in a DisableAccount Script so I can stop any action to disable the account as
    the staff has renewed the contract with the company so the account should not be disabled.
    However my accounts are still being disabled. I am not sure now to construct the query so that it detects that the account is to be left alone if the staffcode is present in both files
    I does recognize that the $staffcodeN in the renewal file matches the $staffcode in the termination file
    but still proceeds to disable or set an expiry date to the account anyway based on the termination file. 
    How do I stop it from doing that?
    1)In the Creation/Renewal of contract file the following headers are present
         -  TranCode,StaffCode,LastName,FirstName,SocialSecurityNo,DateJoin,Grade,Dept,LastUpdateDate,EffectiveDate
    2)In the Disable of contract file the following headers are present
        - TranCode,StaffCode,LastName,FirstName,SocialSecurityno,LastDateWorked,Grade,Dept,LastUpdateDate,
    My data is not very clean , I have a-lot of special characters such as = , ' ,/ and \ characters to remove first before i can compare the data
    Thanks for the help in advance.
    Yours Sincrely
    Vicki
    The following is a short snippet of the code 
    $opencsv = import-csv "D:\scripts\Termination.csv"
    $opencsv2 = import-csv "D:\scripts\RenewContractandNewStaff.csv"
    foreach ($usertoaction in $opencsv) 
    $Trancode = $usertoactionTranCode
    $StaffCode = $usertoaction.StaffCode.replace("=","").replace('"','')
    $LastName = [string]$usertoaction.LastName.Replace("/","\/").Replace(",","\,")
    $FirstName = [string]$usertoaction.FirstName.Replace("/","\/").Replace(",","\,")
    $socialsecurityno = $usertoaction.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoin = $usertoaction.DateJoin.replace("=","").replace('"','')
    $LastDateWorked = $usertoaction.LastDateWorked.replace("=","").replace('"','')
    $Grade = [string]$usertoaction.Grade
    $Dept = [string]$usertoaction.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $AccountExpiry = [datetime]::Now.ToString($LastDateWorked)
    foreach ($usertoaction2 in $opencsv2) 
    $TrancodeN = $usertoaction2.TranCode
    $StaffCodeN = $usertoaction2.StaffCode.replace("=","").replace('"','')
    $socialsecurityNoN= $usertoaction2.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoinN = $usertoaction2.DateJoin.replace("=","").replace('"','')
    $GradeN = [string]$usertoaction2.Grade
    $DeptN = $usertoaction2.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $EffectiveDate = $usertoaction.EffectiveDate.replace("=","").replace('"','')
    $LastName2 = [string]$usertoaction2.LastName.Replace(",", "").Replace("/","").trim()
    $FirstName2 = [string]$usertoaction2.FirstName.Replace("/","").trim()
    # Use DirectorySearcher to find the DN of the user from the sAMAccountName.
    $Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $Root = $Domain.GetDirectoryEntry()
    $Searcher = [System.DirectoryServices.DirectorySearcher]$Root
    $Searcher.Filter = "(sAMAccountName=$samaccountname)"
    $doesuserexist1 = $Searcher.Findall()
    if ($doesuserexist1 -eq $Null)
    {Write-Host $samaccountname "account does not exist"}
    elseif ($StaffCodeN -match $staffcode)
    write-host "user has renewed the contract, no action taken"
    else
    if(($lastupdatedate -ne $null)-or($LastDateWorked -ne $null))
                        write-host "Setting Account Expiry to"$accountexpirydate
    #$ChangeUser.AccountExpires = $accountexpirydate
               #$Changeuser.setinfo()
    if ($UserMailforwarding -ne $null)
    #Set Account expiry date to Last Date Worked
    # $ChangeUser.AccountExpires = $accountexpirydate
    # $Changeuser.setinfo()
     write-host "staff" $displayname "with staff employee no" $samaccountname "has                          
    mailforwarding" 
    Write-host "Please disable the account manually via Active Directory Users & Computers and 
    Elseif ($accountexpirydate -lt $todaysdate)
    #disable the account

    Hi Vicki,
    This Forum has an insert-codeblock function. Using it will make your script far more readable
    Your script is missing some parts, it is impossible to follow the problem.
    You are performing the same string cleaning action on $opencsv2 for each element in $opencsv, when doing it once should suffice. Why not start it all by cleaning the values and storing the cleaned values in new arrays?
    The Compare-Object function is great, why not take it out for a stroll on these lists, it might just safe you lots of unnecessarily complicated code ...
    You are creating a new $Domain, $Root and $Searcher object each iteration, when doing it once should suffice. Probably not much of a time-saver, but every little thing contributes.
    Try pinpointing the problem by doing extensive logging, not only by writing which action was taken, but writing the inidividual information (variables, mostly) before evaluation occurs. Your if/elseif/else looks sound, so if it's still not doing what you
    want, the ingoing data must be different from what you think should be there.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • How can compare two xml files.........

    Hi developers..........
    I have a problem in compare two xml files.My project description is I take two xml(file1,file2) files.Compare file1 with file2. Now I want what are the same words in to the file2.
    file1:
    <hello>
    <html>
    <jsp:plugin>
    file2:
    <hello>
    <jsp:usebean>
    <html>
    result:
    <hello>
    any give the code for this logic.....

    hi...can u pls send me the code which compares two
    xml files and gives the output as difference between
    two fileshttp://www.bmsi.com/java/#diff

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • Compare two XML files: Analysis and Design

    Hi, Java/XML/JDOM experts,
    I realised that an open source of Java utility to compare two XML is still missing. So I would like to write one for my JDOM excises.
    I plan to do it in three steps:
    1.Define the problem domain.
    2.Design the classes to be developed.
    3.Coding
    Below is the problem domain. Would you review it and tell me if it is fine?
    Best regards,
    AG
    Compare two XML files
    Schema assumption:
    The xml files used for the comparison must have the same schema.
    Definition:
    1. Two elements of simple type are said equal if their name and value are identical.
    2. Two elements of complex type are said comparable if their name, attributes are identical.
    3. Two elements of complex type are said equal if they are comparable and their children elements are identical.

    Hi,
    Thanks for reviewing my idea.
    The xml files used for the comparison must have the
    same schema.Including not having a schema at all? And if they do
    have a schema, must they be valid according to the
    schema?I will only support schema based xml files. To include a schema is a good practice. So I will valid them agaisnt schema (is this possible with JDOM? I am testing ...)
    >
    2. Two elements of complex type are said comparableif
    their name, attributes are identical.
    3. Two elements of complex type are said equal ifthey
    are comparable and their children elements are
    identical.Do you plan to require child elements to appear in the
    same order for the two documents to be equal? (Note
    that XML specifically says that the order of
    attributes is not significant.)No. The order is not significant as I use the attributes as the keys to find comparable element counterpart.
    Here is the sample code already tested. Any comments are welcome!
    The next step is to define the "delta xml schema" that will guide me to store the comparasion results. Do you have any suggestions?
    Regards.
    AG
    public static boolean comparable(Element element1, Element element2)
         boolean returnValue=false;
         if (element1.getName()!=element2.getName()) {
              return returnValue;
    } else {
              returnValue=true;
                        System.out.println ("place 2");
         List attributeList=element1.getAttributes();
         Iterator attributeIterator=attributeList.iterator();
         Attribute workingAttribute=null;
         while (attributeIterator.hasNext()) {
                             if (!workingAttribute.getValue().equals(
                             element2.getAttribute(workingAttribute.getName(), workingAttribute.getNamespace()).getValue()))
                                  returnValue=false;
                                  break;
         return returnValue;

  • Read from .txt file and output the content as two arrays

    I am using the contoured move to control the x-y stage. The trajectory datas for x and y axis are generated using my interpolation program and it is stored in a .txt file as two columns. What I want to do is read .txt file and output the content of this file as two arrays. Is there anyone has any ideas? Thanks, the .txt file is attached.
    Attachments:
    R.75.txt ‏172 KB

    Hi Awen,
    This is quite easy to do, you can merely use the "read from spreadsheet file" function to get a 2D array (2 columns and n rows) and then use the index array function to get whatever row/colums you want..
    Hope the attached VI helps you
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    read sprdsheet file.vi ‏27 KB

  • Compare two text file

    i am comparing two text file by checking occurance of a line in file 1 by comparing it with each line in file 2(not line by line)
    i have to print in 3rd text file as difference
    please see my progrm and tell me modification required
    package comp.vnet.comparator;
    import java.io.*;
    import comp.vnet.comparator.NewFile;
    class FileComparator {
         public static void main(String[] args) throws IOException{
              String file1,file2,String1,String2;
              BufferedReader br1,br2;
              int fileCount1=0;
              int fileCount2=0;
              br1= new BufferedReader(new InputStreamReader (System.in));
              // File file = new File ("output.txt");
              FileWriter fstream = new FileWriter("out.txt");
              // FileOutputStream fo = new FileOutputStream("E:/Filecomparator/FileComparator/output.txt");
              System.out.println("Enter First file name");
              file1="b.txt";
              //file1=br1.readLine();
              System.out.println("Enter Second file name");
              file2="a.txt";
              //file2=br2.readLine();
              NewFile nf= new NewFile();
              br1=nf.creatingFile(file1);
              br2=nf.creatingFile(file2);
    while ((String1= br1.readLine()) != null) {
         fileCount1++;
    while ((String2= br2.readLine()) != null) {
         fileCount2++;
    System.out.println("fileCount1+ : " + fileCount1);
    System.out.println("fileCount2+ : " + fileCount1);
    br1=nf.creatingFile(file1);
    BufferedWriter out = new BufferedWriter(fstream);
    for(int i=0;i<=fileCount1;i++)
         br2=nf.creatingFile(file2);
         String1=br1.readLine();
         for(int j=0;j<fileCount2;j++)
                   String2=br2.readLine();
                        if ( String1.equals (String2) ) {
                             System.out.println("the line is equal");
                        else{
                        out.write(String1);
                             System.out.println(String1);
    out.close();
    br1.close();
    br2.close();
              }

    thanks alot for that reply
    but there is some error
    pleasse send me a nice reply

  • How to compare two fmx files

    Hi,
    Is it possible to compare two fmx files , there are few differences between two fmx files , i wanted to know what are the differences.............Thanks.Bcj

    by converting fmb files into xml or text and then using gvimdiff (or similar) on unix or windows will show you the differences. For fmx files, as pointed earlier - you can only see that if they are different or not. On unix you can use strings command (for fmx files) and pipe it to a text file and then do a diff on the files, but that will not be too helpful either.

  • Compare two text files

    Guys I have two .txt files like the one below
    00001                
    00002
    00003
    00004
    00005
    00006
    Some elements are missing from one to the other one...
    I need to compare these two and find the different elements of each file...
    I been reading the old post but I cant figure anything out of them
    Any ideas???

    Hi Darin,
    I am doing more or less same sort of thing but its between the two folder number of files to be compared and then copying the missing files lets say from folder A to folder B. The first part is not a problem to read the content and then compare them but what I am stuck in is that, I want to see while the VI is running that how much data is being copying and how much is remaining my be in percentage on some status bar or may be time or may be out of 55 files 20 files copyied 35 remaining etc. Can you please guide me through this how to do it any idea. It will be great help.
    Regards,
    Naqqash
    Naqqash

  • Problem with store ResultSet and show result in table

    Hi, I'm kind of new in ADF, I need to store ResultSet and show result in table-component. I have two problems:
    1) I get my ResultSet by calling callStoredProcedure(...) and this returns actually ref_cursor as ResultSet.
    When I try to println() contains of this result set in this method - it works OK (commented part),
    but when I want to println() somewhere else (eg. in retrieveRefCursor() method) it doesn't work.
    The problem is that the scrollability of the ResultSet is lost - it becomes a TYPE_FORWARD_ONLY ResultSet.
    Is there any way to store data from ref_cursor for a long time?
    2) My second problem is "store any result set and show this data in table". I have tried use method storeNewResultSet() but
    without result (table contains only "No rows yet" and everything seems to be OK - no exception, no warning, no error...).
    I have tried to call this method with ResultSet from select on dbs (without resultSet as ref_cursor ) - no result with createRowFromResultSet(),
    storeNewResultSet(), setUserDataForCollection()...
    I've tried a lot of ways to do this, but it doesn't work. I really don't know how to make it so it can work.
    Thanks for your help.
    ADF BC, JDev 11.1.1.0
    This is my code from ViewObjectImpl
    package tp.model ;
    import com.sun.jmx.mbeanserver.MetaData ;
    import java.sql.CallableStatement ;
    import java.sql.Connection ;
    import java.sql.PreparedStatement ;
    import java.sql.ResultSet ;
    import java.sql.ResultSetMetaData ;
    import java.sql.SQLException ;
    import java.sql.Statement ;
    import java.sql.Types ;
    import oracle.jbo.JboException ;
    import oracle.jbo.server.SQLBuilder ;
    import oracle.jbo.server.ViewObjectImpl ;
    import oracle.jbo.server.ViewRowImpl ;
    import oracle.jbo.server.ViewRowSetImpl ;
    import oracle.jdbc.OracleCallableStatement ;
    import oracle.jdbc.OracleConnection ;
    import oracle.jdbc.OracleTypes ;
    public class Profiles1ViewImpl extends ViewObjectImpl {
        private static final String SQL_STM = "begin Pkg_profile.get_profile_list(?,?,?,?);end;" ;
        public Profiles1ViewImpl () {
        /* 0. */
        protected void create () {
            getViewDef ().setQuery ( null ) ;
            getViewDef ().setSelectClause ( null ) ;
            setQuery ( null ) ;
        public Connection getCurrentConnection () throws SQLException {
            // Note that we never execute this statement, so no commit really happens
            Connection conn = null ;
            PreparedStatement st = getDBTransaction ().createPreparedStatement ( "commit" , 1 ) ;
            conn = st.getConnection () ;
            st.close () ;
            return conn ;
        /* 1. */
        protected void executeQueryForCollection ( Object qc , Object[] params , int numUserParams ) {
            storeNewResultSet ( qc , retrieveRefCursor ( qc , params ) ) ;
            // callStoredProcedure ( qc , SQL_STM ) ;
            super.executeQueryForCollection ( qc , params , numUserParams ) ;
        /* 2. */
        private ResultSet retrieveRefCursor ( Object qc , Object[] params ) {
            ResultSet rs = null ;
            rs = callStoredProcedure ( qc , SQL_STM ) ;
            return rs ;
        /* 3. */
        public ResultSet callStoredProcedure ( Object qc , String stmt ) {
            CallableStatement st = null ;
            ResultSet refCurResultSet = null ;
            try {
                st = getDBTransaction ().createCallableStatement ( stmt , 0 ) ; // call 
                st.setObject ( 1 , 571 ) ; //set id of my record to 571
                st.registerOutParameter ( 2 , OracleTypes.CURSOR ) ; // my ref_cursor
                st.registerOutParameter ( 3 , Types.NUMERIC ) ;
                st.registerOutParameter ( 4 , Types.VARCHAR ) ;
                st.execute () ; //executeUpdate
                System.out.println ( "Numeric " + st.getObject ( 3 ) ) ;
                System.out.println ( "Varchar " + st.getObject ( 4 ) ) ;
                refCurResultSet = ( ResultSet ) st.getObject ( 2 ) ; //set Cursoru to ResultSet
                //   setUserDataForCollection(qc, refCurResultSet); //don't work
                //   createRowFromResultSet ( qc , refCurResultSet ) ; //don't work
                /* this works but only one-time call - so my resultSet(cursor) really have a data
                while ( refCurResultSet.next () ) {
                    String nameProfile = refCurResultSet.getString ( 2 ) ;
                    System.out.println ( "Name profile: " + nameProfile ) ;
                return refCurResultSet ;
            } catch ( SQLException e ) {
                System.out.println ( "sql ex " + e ) ;
                throw new JboException ( e ) ;
            } finally {
                if ( st != null ) {
                    try {
                        st.close () ; // 7. Close the statement
                    } catch ( SQLException e ) {
                        System.out.println ( "sql exx2 " + e ) ;
        /* 4. Store a new result set in the query-collection-private user-data context */
        private void storeNewResultSet ( Object qc , ResultSet rs ) {
            ResultSet existingRs = getResultSet ( qc ) ;
            // If this query collection is getting reused, close out any previous rowset
            if ( existingRs != null ) {
                try {
                   existingRs.close () ;
                } catch ( SQLException s ) {
                    System.out.println ( "sql err " + s ) ;
            setUserDataForCollection ( qc , rs ) ; //should store my result set
            hasNextForCollection ( qc ) ; // Prime the pump with the first row.
        /*  5. Retrieve the result set wrapper from the query-collection user-data      */
        private ResultSet getResultSet ( Object qc ) {
            return ( ResultSet ) getUserDataForCollection ( qc ) ;
        // createRowFromResultSet - overridden for custom java data source support - also doesn't work
       protected ViewRowImpl createRowFromResultSet ( Object qc , ResultSet resultSet ) {
            ViewRowImpl value = super.createRowFromResultSet ( qc , resultSet ) ;
            return value ;
    }

    Hi I have the same problem like you ...
    My SQL Definition:
    CREATE OR REPLACE TYPE RMSPRD.NB_TAB_STOREDATA is table of NB_STOREDATA_REC
    CREATE OR REPLACE TYPE RMSPRD.NB_STOREDATA_REC AS OBJECT (
       v_title            VARCHAR2(100),
       v_store            VARCHAR2(50),
       v_sales            NUMBER(20,4),
       v_cost             NUMBER(20,4),
       v_units            NUMBER(12,4),
       v_margin           NUMBER(6,2),
       v_ly_sales         NUMBER(20,4),
       v_ly_cost          NUMBER(20,4),
       v_ly_units         NUMBER(12,4),
       v_ly_margin        NUMBER(6,2),
       v_sales_variance   NUMBER(6,2)
    CREATE OR REPLACE PACKAGE RMSPRD.NB_SALES_DATA
    AS
    v_sales_format_tab   nb_tab_storedata;
    FUNCTION sales_data_by_format_gen (
          key_value         IN       VARCHAR2,
          l_to_date         IN       DATE DEFAULT SYSDATE-1,
          l_from_date       IN       DATE DEFAULT TRUNC (SYSDATE, 'YYYY')
          RETURN nb_tab_storedata;
    I have a PLSQL function .. that will return table ..
    when i use this in sql developer it is working fine....
    select * from table (NB_SALES_DATA.sales_data_by_format_gen('TSC',
                                        '05-Aug-2012',
                                        '01-Aug-2012') )
    it returning table format record.
    I am not able to call from VO object. ...
    Hope you can help me .. please tell me step by step process...
    protected Object callStoredFunction(int sqlReturnType, String stmt,
    Object[] bindVars) {
    System.out.println("--> 1");
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement("begin ? := " +"NB_SALES_DATA.sales_data_by_format_gen('TSC','05-Aug-2012','01-Aug-2012') ; end;", 0);
    System.out.println("--> 2");
    st.executeUpdate();
    System.out.println("--> 3");
    return st.getObject(1);
    catch (SQLException e) {
    e.printStackTrace();
    throw new JboException(e);

  • Scenario to read from txt-file and create a sales order

    Hi,
    i have started creating a scenario to read from an txt-file and to create a sales order.
    When i activate my scenario, i get the following message :
        no scenario step (vBIU) associated for this step for the incoming system (SysId)
    When i look into the detailed xml-file i see that all the records are read from the file, but there is no next step to be treated.
    Has somebody any idea how this come ?
    -<Msg MessageLog="true" msglogexcl="false" logmsg="0009" recording="true" BeginTimeStamp="20111202095144" MessageId="11120209514499820828C0A801674F24" xmlns="urn:com.sap.b1i.vplatform:entity">-<Header><msglog b1ifactive="true" always="false" step="Default message log"/>-<Resumption><starter ipo="/vP.0010000138.in_FEAN/com.sap.b1i.vplatform.runtime/INB_FI_EXST_ASYN_NAM/INB_FI_EXST_ASYN_NAM.ipo/proc"/></Resumption><IPO tid="11120205535899820808C0A801678C54" Id="INB_FI_EXST_ASYN_NAM"/><Sender Id="0010000138"/><Inbound file="ORDERS_TEST" ext="csv" path="C:\TEMP\In" pltype="txt" wrap="" deli=";"/></Header>-<Body><Payload Type="File exist" Role="T"/>-<Payload Role="S">-<io xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="txt">
    -<row>
    <col>OH</col>
    <col>0000087077</col>
    <col>201110041205</col>
    <col>220</col>
    <col>9</col>
    <col>201110191702</col>
    <col>8710624300012</col>
    <col>8714252008609</col>
    <col>8710624300012</col>
    <col>8714252008609</col>
    <col>8710624300012</col>
    <col>N</col>
    <col>N</col>
    <col>N</col>
    </row>
    -<row>
    <col>OL</col>
    <col>1</col>
    <col>8711715844378</col>
    <col>20</col>
    </row>-<row>
    <col>OL</col>
    <col>2</col>
    <col>8711715844392</col>
    <col>60</col>
    </rowrow>
    <col>OL</col>
    <col>16</col>
    <col>8710251791092</col>
    <col>280</col>
    </row>
    </io>
    </Payload>
    </Body>
    </Msg>
    This is my final atom :
    <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force=""><xsl:output method="xml" encoding="UTF-8" indent="yes"></xsl:output><xsl:param name="atom"></xsl:param><xsl:param name="sessionid"></xsl:param><xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;S&apos;]"></xsl:variable><xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"></xsl:variable><xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"></xsl:variable><xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover=&apos;P&apos;]/@Id"></xsl:variable><xsl:template match="/">
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
    <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
    <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
    <Body>
    <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
    <Payload Role="R" id="{$atom}">
    <xsl:call-template name="transform"></xsl:call-template>
    </Payload>
    </Body>
    </Msg>
    </xsl:template><xsl:template name="transform">
    <FinalAtomResult xmlns="">
    <BOM>
    <BO>
    <AdmInfo>
    <Object>17</Object>
    <Version>2</Version>
    </AdmInfo>
         <Documents>
         <row>
         <DocDate>
              <xsl:copy-of select="$msg/io/row[0]/col[2]/text()"></xsl:copy-of>
         </DocDate>
         <DocDueDate>
              <xsl:copy-of select="$msg/io/row[0]/col[5]/text()"></xsl:copy-of>
         </DocDueDate>
         <CardCode>KD10251</CardCode>
         <NumAtCard>
              <xsl:copy-of select="$msg/io/row[0]/col[1]/text()"></xsl:copy-of>
         </NumAtCard>
         <U_PMX_JD_COMP>32</U_PMX_JD_COMP>
         </row>
                          </Documents>
         <Document_Lines>
         <xsl:for-each select="$msg/io/row">
         <row>
         <BarCode>
              <xsl:copy-of select="$msg/io/row[*]/col[2]/text()"></xsl:copy-of>
         </BarCode>
         <Quantity>
              <xsl:copy-of select="$msg/io/row[*]/col[3]/text()"></xsl:copy-of>
         </Quantity>
         </row>
         </xsl:for-each>
         </Document_Lines>

    Mike,
    you were right, you may not specify the extension of a file.
    Another thing i detected is that the loop of my data start with the index 1 instead of 0 !!!
    In this scenario, i have to read all the lines of the file and each time i should do a SQL-query,
    so that i can use the result to build my sales document.
    Do you know if it this is possible or have you any idea how to do this ?
    thx,
    Mario

  • Is there a way to compare two .itl files?

    I recently uninstalled and reinstalled iTunes on my Vista machine. I then re-imported all by music, which resulted in a new .itl file. I then realized I could use my old .itl file and preserve some data, such as date added, play count, etc. I notice, however, that the new .itl file says that there are seven more items in the library than were in the old one (out of over 11,000 items). I am curious as to what these 11 items are, since I didn't make any additions to the library between the date of the old .itl file and the new one (they both have the same date stamp, in fact, though the new one is several hours newer than the old one). Is there any way to compare these .itl files and see what the additional items are? Thanks.
    Howard

    You have to do it on a field-by-field basis in a formula using the Previous() function.  However, you cannot "nest" calls to either Previous() or Next() - in other words, you can't do something like Previous(Previous(<some field>))  You'll also need to look at OnFirstRecord and/or PreviousIsNull() to work with data on the first row of the report.
    -Dell

  • How can i compare two excel files with different no. of records.

    Hi
    I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
    Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
    Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
    while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
                     String delims = "[;,\t,,,|]";
                    String[] tokens = strLine.split(delims);
                    String[] tokens1 = strLine1.split(delims);
                   if (tokens.length > tokens1.length)
                    for (int i = 0; i < tokens.length; i++) {
                        try {
                            if (!tokens.equals(tokens1[i])) {
    System.out.println(tokens[i] + "<----->" + tokens1[i]);
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
    out.println();
    sno++;
    } catch (Exception exception)
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
    out.println();
    Thanks & Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    A CSV file is not an Excel file.
    But apart from that your logic makes no sense.
    If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
    If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
    That system however is overly complicated for comparing CSV files.
    As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines.

Maybe you are looking for