I need help parsing a  swift data string

i need to parse swift financial data
is there a way to use split or stringtokenizer for ::
and keep the :: as part of the new seperated data.
i want to put each string starting with :: on a seperate line in a text box.
i gave up and tried it with a loop and a stringbuffer , and indexof.
if (line.indexOf("::") == Strpos ){
frame.jTextArea1.append(displayline.toString());
displayline = new StringBuffer();
displayline.append(line.substring(Strpos, (Strpos + 2)));
Strpos += 2;
if (line.indexOf("::") != Strpos ) {
displayline.append(line.substring(Strpos, Strpos + 1));
System.out.println( displayline);
Strpos++;
but i cant get that to work either.
if anyone knows how to parse swift data please give me your email address.
i've been doing it in cobol for 15 yrs and i just cant get the cobol techniques to translate to java.
thanks.

as i said
i am really a cobol guy
and yes as you see i did try to use indexof in my code.
but there must be something about indexof that i'm not getting.
it works the first time in the loop but then as i increment my start position(strpos)
the indsex of no longer works.
am i using the correct technique to increment the start position thru the string buffer.
thanks guys.

Similar Messages

  • Need help in formatting the Date - Date does not

    Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
    select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
    --- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
    (r.formdate, 'DD-MON-YYYY'),12) "formdate2"
    from  table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
    Edited by: Lucy Discover on Jul 7, 2011 1:05 PM

    Your syntax is wrong - look at the post above where this syntax is given:
    to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
    take formdate, add 12 months
    add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
    to_char(date, 'MM/DD/YYYY')Compare to your syntax:
    to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
    Good luck!

  • Need help in logging JTDS data packets

    Hi All,
    I m having web application which uses SQL Server database.
    I have to find out some problems in database connection for that there is need to log the jtds data packets.
    I have tried to use class net.sourceforge.jtds.jdbc.TdsCore but in constructor of TdsCore class there are two parameters needed one is ConnectionJDBC2 and another is SQLDiagnostic.
    I have tried a lot but it did not allow me to import class *SQLDiagnostic*.
    I need help in logging JTDS data packets. If there are any other ways or any body having any idea about logging JTDS data packets/SQLDiagnostic.
    Please reply it is urgent...!!
    Thanks in advance......!!

    if you want to use log4j then,
    in your project create a file called log4j.properties and add this
    # Set root logger level to INFO and its only appender to ConsoleOut.
    log4j.rootLogger=INFO,ConsoleOut
    # ConsoleOut is set to be a ConsoleAppender.
    log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender
    # ConsoleOut uses PatternLayout.
    log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
    log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n
    log4j.logger.org.apache.jsp=DEBUG
    #Addon for
    com.sun.faces.level=FINEGo to your class and add this line
    private static final Logger logger = Logger.getLogger("classname");and then you can use
    logger.info();
    logger.error();
    methods

  • Need help in loading master data.

    Hi everyone,
              I am just a beginner in BI 7.0 . I know Bw 3.5 . I need help in loading master data(flat file) in a step by step manner.
    Before posting this forum i searched and checked out other related forums too, as i am a beginner i am unable to follow them. Lots of the forums gave the help.sap.com link which i used and got a little help but not fully, so please don't send that link.  I need a step by step guideline from somebody, which says everything from the beginning till monitoring say like
    e.g.. 1) create a InfoObject by right clicking on InfoObject catalog.
    something like that.
    please help me get a clear and detail step by step procedure to load a master data (Flat File should be good) which may help me get a start will other things without much help.
    Please help me learn.
    Thanks.
    Ranjani.

    HI,
         Thanks for your reply. This is what i did.
    1) Created a Info Area.
    2) Created Info object catalog & activated
    3) created info object with nothing except some 4 attributes.
    4) Created Application compound in Infosource tab.
    5) Right clicked on Application compound and chose create Infosource in which chose a option with 3.x and chose the flexible update and gave the info object name.
    6) In info provider tab , in the Info Area right clicked and chose the Insert char as data target option.
    Now, i am stuck. I have no idea what to do next.
    I know i have to create a transformation - There are two tabs in Transformation box, what should i do there.
    Please help me from point 6 to cont., to load the data.
    Thanks.

  • Need help in fetching requested data from JSP

    Hello,
    I really need help in fecthing requested data from JSP to servlet. Can anyone assist me as soon
    as possible because I must finish my program by today.....( 20/02/2002).
    Thanks in advance.

    It is very likely that somebody can help you, if you say what your problem is. In fact somebody might already have helped you. What is your problem?

  • Need Help Parsing JSON String using PLJSON

    Hello,
    I have JSON stored in a database field:
    --Query
    select data1 from table1 where id= 339207152427;
    --Results:
    [{"name":"Home"},{"code":"JPNWC74ZKW9"},{"start date":"01\/02\/2014"},{"person name":"hhh, RamS"}]
    I need to parse the above results into 3 fields in a separate table. For now, i'm just trying to parse the results using PLJSON, but am getting the ORA-20101: JSON Parser exception - no { start found error when running the following pl/sql block:
    declare
    VIN_JSON varchar2(4000);
    jsonObj json;
    listOfValues json_list;
    listElement json_value;
    begin
    select data1 into VIN_JSON from table1 where id= 339207152427;
    jsonObj := new json(VIN_JSON);
    listOfValues := jsonObj.get_values();
    for i in 1..listOfValues.count loop
    listElement := listOfValues.get(i);
    end loop;
    end;
    I believe my syntax is close, but was hoping for some further instruction.
    Thanks in advance!
    John

    I have no idea what you are trying to do or in what version so help, at this point, is not possible.
    Let's start with this:
    I need to parse the above results into 3 fields in a separate tableAnd the parsing rules?
    And what the result should be?
    You apparently want us to guess. Which is something most of us do not like to do. (and don't forget your full version number if you want help).
    PS: This forum has a FAQ: I recommend you read it as you didn't even put your listing into tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need to parse Japanese Full Date Format

    Hi,
    Locale japanLocale = Locale.JAPAN;
    SimpleDateFormat fullDateFormat = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, japanLocale);
    String dateValue = 2010'?'09'?'12'?' 1'?'15'?'45'?'GMT // Here Japanese character will come instead of ?
    DateFormat initialDateFormat = new SimpleDateFormat(fullPattern, japanLocale);
    Date date = initialDateFormat.parse(dateValue);
    String formattedDate = fullDateFormat.format(date);
    This throws Exception java.text.ParseException: Unparseable date: "2010'?'09'?'12'?' 1'?'15'
    ?'45'?'GMT"
    If you send some good suggestions, it will be appreciable.
    Thanks in Advance
    Suresh

    Japanese full pattern is:
    "yyyy'年'M'月'd'日' (EEEE)
    H'時'mm'分'ss'秒' z"
    I need to parse this string.
    OK:
    String pattern = "yyyy'年'M'月'd'日' (EEEE) H'時'mm'分'ss'秒' z";
    String date = "2004年8月12日 (木曜日) 13時56分01秒 EEST";
    SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.JAPAN);
    Date d = parser.parse(date);
    System.out.println(d); // prints Thu Aug 12 13:56:01 EEST 2004
    Note that for the sake of portability the two first lines should be written asString pattern = "yyyy'\u5e74'M'\u6708'd'\u65e5' (EEEE) H'\u6642'mm'\u5206'ss'\u79d2' z";
    String date = "2004\u5e748\u670812\u65e5 (\u6728\u66dc\u65e5) 13\u664256\u520601\u79d2 EEST";This is to make it possible to compile your code on a platform that doesn't support Japanese script.
    Can i have your Yahoo / AOL ID?What makes you think I have one? :)

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • Need help in stroring CLOB data into a table

    Hi All,
    I have a CLOB data. Which contains delimited data.
    Example:
    "111#|#ABC#|#asfsdffgh $|$222#|#XYZ#|#jdsfgdskdsf $|$"
    #|# - is column delimiter.
    $|$ - is row delimiter
    I want to extract and store the above data into a table which has 3 columns. Need help.
    I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    Thanks in advance,
    Girish G

    Hi Girish,
    Please go through the below url's...It will give you fair idea and solution. HOpe you know the sql *loader utility. or external table.
    http://www.oracle-base.com/articles/10g/LoadLobDataUsingSqlLoader.php
    http://www.oracle-base.com/articles/10g/ExternalTablesContainingLobData.php
    KPR.

  • Need help in URL Service Data Control

    Hi Everyone,
    I'm working on JDev11gUp2, ADF-RC
    I am using URL Service Data Control to fetch data from CSV File and i got success but I need to know that is there any way to pass File Connection URL Dynamically at run time, As i know we have to provide URL string at design time, but i have multiple files to pass at run time , Then?
    And one more question that Once the data is uploaded into af:Table from my CSV file. then after Any data change in CSV file must reflect in af:table with that change like other iterator refresh functionality. but I'm not able to do that, Simple question is, How to Re fetch the data from CSV file at run time?
    Your answer would be really appreciated as it would really help me.
    Thanks
    Fizzz...

    Hi Fizz,
    Not sure of the answer to your specific question. A couple of thoughts, though:
    You could try putting some code in a backing bean action listener to get the data control from an iterator binding (where you have added an iterator binding to your page definition) and then using the debugger to inspect the runtime type of the data control returned - then look to see if that type has a setURL method.
    [url http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/adv_data_controls005.htm]this link talks about creating your own data control type - where you could certainly expose a method to set a URL. More work, but you have complete control.
    Hope this at least gives you an idea or two.
    John

  • Need Help....Data Concatenation

    Hey..How are you all..?
    If someone can take a look at my requirement and spend some on it, I would really appreciate help..
    Database version - 10g
    Requirement - Need to display 'Description' inforamtion in a single/one complete line for a single record ( as shown below) which are being entered in multiple lines through screen (this column is stored in single table only).
    engine_family sequence_num Description
    09          1     Includes:
    09          2     Clock on and off the job
    09          3     Move equipment to and from work area
    09          4     Record the following
    09          5     Generator set model number
    09          6     Generator set serial number
    09          7     Engine serial number
    09          8     Hours of operation
    09          9     Load/unload tools, equipment and repair parts
    09          10     Clean up work area
    09          11     Write repair order
    09          12     Write repair procedures
    I am not sure whether we can display this data by concatenation(concat) function through sql query or any other technique..?
    Please let me know how can concatenate the description from multiple lines to one line for a single record as displayed above...also let me know if you want other inputs from me..?
    Thanks
    Mark

    Hi, Mark,
    That's called String Aggregation , and this page shows several ways to do it:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    I think LISTAGG is the only technique that won't work in Oracle 10. (Too bad; it's the best one.)
    If the order of the concatenated data isn't important, then I recommend the user-defined aggregate function. You have to copy it from the site (about 60 lines of PL/SQL) and install it, but you only have to do that once. It's a very handy function.
    If order is important, then the SYS_CONNECT_BY_PATH technique is good.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    If the output isn't completely obvious, describe what it is. (For example, if you want to have a string with embedded newline characters, so that the one string appears on multiple lines.) It helps if you fiormat the output, and type hese 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    Edited by: Frank Kulash on Oct 13, 2010 12:56 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SimpleDateFormat.parse accepts invalid date string

    SimpleDateFormat("dd/MM/yyyy").parse(...) accepts invalid input strings (e.g. "1.1.2gsd001") without raising an exception.
    Where I do a mistake?
    Example:
    import java.text.*;
    import java.util.*;
    public class Test {
    public static void main(String[] args) throws ParseException {
    String s = "1.1.2gsd001";
    SimpleDateFormat sdf = new SimpleDateFormat("d.M.yyyy");
    sdf.setLenient(false);
    Date d = sdf.parse(s);
    System.out.println(d);
    GregorianCalendar gc = new GregorianCalendar();
    gc.setTime(d);
    The result is: Sun Jan 01 00:00:00 CET 2
    Thanks for your help.

    Tahnks s lot.
    Final code is (and it workes well):
    import java.text.*;
    import java.util.*;
    public class Test {
      public static void main(String[] args) throws ParseException {
        ParsePosition pp = new ParsePosition(0);
        String s = "1.1.2001";
        SimpleDateFormat sdf = new SimpleDateFormat("d.M.yyyy");
        sdf.setLenient(false);
        Date d = sdf.parse(s, pp);
        if (pp.getIndex() != s.length())
          throw new ParseException(String.format("Unparseable date: %s", s), pp.getIndex());
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(d);
    }

  • Need help parsing a long and passing the value.

    I'm doing Cattle Drve 4b on javaranch.com (http://www.javaranch.com/say.jsp) and I need a bit of help.
    I want to pass the reference of my num value to several small methods to work out the value printed. Here's the original code I did from 4a:
    public class Say{
    public static void main(String[]args){
    int num = Integer.parseInt(args[0]);  // parse argument from command line
    String array[] ={"Zero", "One", "Two", "Three", "four", "five", "six","seven","eight",
               "nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen",
               "seventeen","eighteen","nineteen","twenty","thirty","fourty","fifty",
               "sixty","seventy","eighty","ninety"};     //initialize the array
    //start check for value
    if(num<21)
    System.out.println("\n" + array[num]);
                                            //  \n is added before
    else if(num<30)                                   //  each result for a
    System.out.println("\n" + array[20]+ "-" + array[(num-20)]);     //  cleaner output
    else if(num<40)
    System.out.println("\n" + array[21]+ "-" + array[(num-30)]);
    else if(num<50)
    System.out.println("\n" + array[22]+ "-" + array[(num-40)]);
    else if(num<60)
    System.out.println("\n" + array[23]+ "-" + array[(num-50)]);
    else if(num<70)
    System.out.println("\n" + array[24]+ "-" + array[(num-60)]);
    else if(num<80)
    System.out.println("\n" + array[25]+ "-" + array[(num-70)]);
    else if(num<90)
    System.out.println("\n" + array[26]+ "-" + array[(num-80)]);
    else if(num<100)
    System.out.println("\n" + array[27]+ "-" + array[(num-90)]);
    //endFor 4b I need to be able to print out values in the billions, so I was going to create a few methods to keep it clean like so:
    public class billion (long (int num)
    { if( num<9 billion)
         num-= 8 billion
    System.out.print("eight billion ");
    else if(num<8 billion){
    num-= 7 billion
    System.out.print("seven billion ");
    ....etc
    return num;
    public class million...
    public class thousand...
    etc.And the current main section will be moved into a new "tens" class.
    I'm running into two problems though.
    1. How do you parse a long? I know integers are like so:
    int num = Integer.parseInt(args[0]); are longs the same?
    like:
    long num = Long.parseLong(args[0L])if not, how can I do it?
    2. how do I properly pass num to all the methods? I'm going to make num a public int and make the methods public because that seems simplest, but can I pass num to the method and then return the new value of num back to main?
    BTW, I'll be removing the carriage return from the beginning of the "tens" class when all is said and done so the results don't end up printing on multiple lines.
    Thanks in advance everyone.

    The L suffix is used to identify a Long literal.
    The index of the args[] array does not need to be specified as a Long.
    Solong num = Long.parseLong(args[0]);will suffice. You might want to put that in a try/catch block to catch the NumberFormatException that will be thrown if args[0] cannot be parsed to a long value.
    Various ways to update the value of num in the methods of the same class:
    Simplest of all: declare num as an instance variable. The methods simply access and assign its value.
    Other ways:
    -- pass num as a parameter to the method.
    -- return the value of num from the method (provided the method doesn't have to return any other value)
    -- Have a getNum() method return the value of num
    -- Have setNum() method to update the value of num
    db
    What's that line? public class billion (long (int num)edit Typos, typos...
    Also, the set/get approach with public access is the preferred method when used in the methods of another class.
    Don't forget that the other class has to know whose set/get methods to call.
    Message was edited by:
    Darryl.Burke

  • Need help to resolve the Date time issue(Urgent)

    Hello All,
    I am running simple code as follows, to get the date and time. getting difference in 2 environment. Our both environment of AIX.
    import java.io.PrintStream;
    import java.util.Calendar;
    public class DateTest
    public DateTest()
    public static void main(String args[])
    java.util.Date now = Calendar.getInstance().getTime();
    System.out.println((new StringBuilder("Calendar.getInstance
    ().getTime():")).append(now).toString());
    Problematics environment gives following o/p
    bash-4.0$ java -cp . DateTest
    Calendar.getInstance().getTime():Wed Feb 03 00:59:40 EST 2010
    bash-4.0$ date
    Wed Feb  3 05:59:42 EST 2010
    bash-4.0$
    In another enviornment gives proepr o/p
    bash-4.0$ java -cp . DateTest
    Calendar.getInstance().getTime():Wed Feb 03 05:01:45 GMT-05:00 2010
    bash-4.0$ date
    Wed Feb 3 05:01:48 CST 2010
    can some one help me out in this...............

    What were the results of your investigations based on the pointers you got from [your earlier thread|http://forums.sun.com/thread.jspa?threadID=5423811] ?

  • Need help in Migration of data !

    We developed a application using Apex and currently it is going through client testing.
    There is one challenge at client side; there are some third party legacy inventory systems at client side where there is data stored in databases like Paradox, SQL server, XML the customers have been using them for last 10 to 15 years.
    Now there is some amount of data where they enter into those system; we want to extract some of the data and show in our application. Ours is a hosted On Demand application we need to migrate the data from the client machine and push into our server so that they can view the data online. And we want to run a scheduler every day to extract the data .
    Do you have any idea how we can do this in APEX or any tool that can support our need.
    Did you hear about spectral.com (full convert)
    I really appreciate your help on this.

    Hi,
    it is not too difficult to load data into a database using only Apex tools, but the problem with this is that it can't be completely automated, as at some stage, a user would have to do a manual file upload.
    In order to achieve completely automated upload you would need access at a lower database and database server O/S level as well as have direct connectivity between your Apex server and the legacy source systems. As your Apex system is a "hosted On Demand application" you may be severely limited in your access at those levels.
    Depending on your access, you would typically extract and load data from other non-oracle sources using technologies like Oracle's heterogeneous Gateways or third party odbc connectivity and use database links. Or you could automate files to be dropped from the legacy systems to somewhere that is accessible to the destination system where it could be loaded using tools such as SQL Loader or External Tables. This could be scheduled using tools such as cron or dbms scheduler.
    I know this is very general, but I hope it points you in the right direction.
    Regards
    Andre

Maybe you are looking for

  • How can I set one loop's frequency as a slave of another loop ?

    I have 2 loops in parallel. The first runs at 500Hz. The AIread controls the frequency. How can I set the second one at 100Hz ? It is very easy to set it with local variable, but really not clean. The second loop must not use the CPU while waiting th

  • Displying wrong data after entering estimated cost while creating travel request.

    Hi Team, We are facing an issue while creating travel request from portal. When we are entering estimated cost and after clicking on save and send button we are getting data is saved as correct.But after clicking on display form button the data is sh

  • Need urgent help in running freetts in j2me

    hiiii, I m building a mobile application for text to speech conversion. for that i need the J2ME version of freetts. if anyone has the link plzzz forward that to me. avani

  • 16:9 Confusion

    Ok, I have scoured the forums and the internet, but I hope you guys can give me a once and for all answer to this. I recently purchased a camcorder (Canon ZR500) which does true (or so camcorderinfo.com says) 16:9. I am not super thrilled with it, bu

  • CDE Window Manager  configuration problem (Sol 8)

    Hi I have a strange problem with CDE. After having a proper PC instalation done, as I log in the CDE I get black background and only 2 windows ( a kind of help window and the File Manager) The windows don't have title bars, cannot be moved ot whateve