Text file contains data separated by pipe symbol read the data and saved in

Hi ,
This is Sreedhar, i am new to java. my query is Report its in text file format it contains data like GLNO,name ,amount. All fields are separated by pipe(|) symbol. I would like to read that
data and saved into the database. Please anyone can help me.

thx Ottobonn.
Scanner is very usefull with string operation like in my problem..but i want try to find java.util.Scanner in j2me, i can't found this class...:(
so, may be i can't use this class in j2me...
i new in java, so i try myself to code the simple method for my problem,
may be anyone can make this class more simple than my coding....:)
public StringPipe(String _msg){
        String message = _msg;
        int pipe = 0;
        int lengthmessage = message.length();
        int lengthMsgresult = 0;
        while(lengthMsgresult<=lengthmessage){
            String msg = null;
            int pipeX = message.indexOf("|");
            if(pipeX==-1){
                msg = message;
            else{
                msg = message.substring(pipe, pipeX);
                message = message.substring(pipeX+1, message.length());
                lengthMsgresult += msg.length();  
            // the string seperated by pipe
            System.out.println("msg = " + msg);
            if(pipeX==-1){
               break;
}thx...

Similar Messages

  • HT2234 How do I save text into my iPod's Notes? I read the instructions and there is no Notes Folder in my iPod.

    I would like to put texts into my iPod's Notes. I received instructions from Apple, BUT I'm totally lost. There is no Notes Folder in my iPod. ANYONE PLEASE HELP!

    Hi Niel,
    Create a folder like if it were a playlist folder? I'm so lost...create a folder where?

  • SSIS none text qualifier results in text file containing "_x003C_none_x003E"

    There is a bug in SSIS when exporting data from SQL to a comma delimited text file where you specified no text qualifier.
    This bug apparently only occurs when you develop the SSIS on a x64 win7 PC and copy the .dtsx file (windows explorer copy/paste) to network path of a x86 SQL server and schedule the job to run from SQL Agent on the same x86 SQL server.
    When the SSIS runs, the text file is written out containing text qualifier = "“_x003C_none_x003E".
    If you look at "
    _x003C_none_x003E", it actually means <none>.  x003C = "<" and x003E = ">".
    If you go into the SSIS package, double-click in the connection manager section to open the flat file connection manager editor and try to clear the text qualifier removing the <none>,
    the <none> value get added back in.
    The only work-around is to NOT open the
    flat file connection manager editor, but instead make the change using the property window and clear out any value in the TextQualifier field.
    Other similar problems occur when you actually want to put a real value in the text qualifier.  For explain if you select the double-quote as the text qualifier and copy to a
    x86 server and run, you end up with a text file containing the value "
    _x0022" around each field instead of a double quote.
    In my mind this is a serious bug, I did some research and other people have been having this same issue.
    FYI, the SQL server is currently SQL2008 with SP2.  I will try to get it updated to SP3/4 this weekend to see that will help.
    FYI2, when I am developing the SSIS using VS2008 and my local test/run is done through visual studio on my Dev PC (x64).  Everything works fine this way.  I do not have a instance of SQL on my machine so I did not test it running from SQL Agent
    on my PC.

    Todd,
    Sorry to revive an older post, but we are currently running into this problem...again, but this is happening on SQL Server 2008 R2 SSIS servers and the corresponding developer machines.
    Everything that I'm finding in forums and blogs pretty much points that this is an issue with build mismatches (i.e. one system not being caught up to the server while others are), but I have yet to find anything that really outlines how to properly rectify
    the situation and prevent it from happening going forward.
    Currently all but our production server (from a server perspective) are exactly the same version numbers (same CU applied).
    I can't really speak to all of the developer boxes, but mine matches all but the production server (production is showing a lower number than the expected 10.50.2500.0).
    As shown below, what is really odd is the second entry and last entry.  Second entry is showing SP1 as the generic identifier, but yet shows Build 7600.
    The bottom one shows RTM in the generic identifier, but yet shows Build 7601 Service Pack 1, and the version number isn't the expected 10.50.2500.0.
    SQL Server Version
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03     Standard Edition (64-bit)
    on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03     Standard Edition (64-bit)
    on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor)
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03     Standard Edition (64-bit)
    on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
    Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)   Apr 22 2011 19:23:43     Standard Edition (64-bit)
    on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

  • Read text file (ASCII), tab separated

    how to read contens of text file (ASCII), tab separated in a report.

    hi kailash,
                    To read contents of text files (Ascii) use GUI_UPLOAD function.
    GUI_UPLOAD - this FM will Upload the Data of a text File to ITAB.
    Please see below the code for it.It is very simple ,plz go through it.
    In the code when u call the function GUI_UPLOAD just mention the file type as 'ASCII' as done below.
    pls do reward if useful.
    Thanks.
    types: begin of ttab,
           f1(25) type c,
           f2(10) type c,
           f3(10) type c,
           end of ttab.
    data: itab type table of ttab with header line.
    data: file_str type string.
    parameters: p_file type localfile.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = p_file.
    start-of-selection.
      file_str = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = file_str
        FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = itab
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17.
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
      Loop at itab.
        write : / itab-f1,itab-f2,itab-f3.
      endloop.

  • How to read text file contain chinese character ?

    Hi XI Expert,
    I have scenario to read text file contain Chinese Character using sender file adapter. but every i was check from sxmb_moni all the chinese character looks different. and also the target file also i has changes.
    Please advise me how to maintaine the chinese character in PI 7.0 SP17.
    Thank You and Best Regards
    Fernand

    Hi,
    Refer these threads..
    Receiver file adapter corrupting characters
    Problem in converting special characters in input text file
    Here is one more useful guide..
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Nov 17, 2008 3:47 PM

  • Data adapter failed during OnLoad: The UDC file contains errors: '=' is an unexpected token. The expected token is ';'.

    I am working on SharePoint 2010 Infopath form, i have created one secondary connection to SharePoint List view using XML Connection it works fine.
    For the deployment from DEV to PROD i converted this connection to universal data connection (UDC) and tested this before deploying to PROD but i m getting below error.
    An error occurred querying a data source.
    i checked ULS logs and found below details
    Data adapter failed during OnLoad: The UDC file contains errors: '=' is an unexpected token. The expected token is ';'. Line 17, position 108.
    UDC file is below
    <?xml version="1.0" encoding="UTF-8"?>
    <?MicrosoftWindowsSharePointServices ContentTypeID="0x010100B4CBD48E029A4ad8B62CB0E41868F2B0"?>
    <udc:DataSource MajorVersion="2" MinorVersion="0" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc">
    <udc:Name>LastItemID</udc:Name>
    <udc:Description>Format: UDC V2; Connection Type: XmlQuery; Purpose: ReadOnly; Generated by Microsoft InfoPath 2010 on 2014-04-25 at 16:49:31 by DOMAIN\username.</udc:Description>
    <udc:Type MajorVersion="2" MinorVersion="0" Type="XmlQuery">
    <udc:SubType MajorVersion="0" MinorVersion="0" Type=""/>
    </udc:Type>
    <udc:ConnectionInfo Purpose="ReadOnly" AltDataSource="">
    <udc:WsdlUrl/>
    <udc:SelectCommand>
    <udc:ListId/>
    <udc:WebUrl/>
    <udc:ConnectionString/>
    <udc:ServiceUrl UseFormsServiceProxy="false"/>
    <udc:SoapAction/>
    <udc:Query>https://contoso/_vti_bin/owssvr.dll?Cmd=Display&List={32364DED-7FE3-4276-837C-F2AC62C04B81}&View={804CC528-34B2-4473-89DB-C4E766CACC95}&XMLDATA=TRUE&NOREDIRECT=TRUE</udc:Query>
    </udc:SelectCommand>
    <udc:UpdateCommand>
    <udc:ServiceUrl UseFormsServiceProxy="false"/>
    <udc:SoapAction/>
    <udc:Submit/>
    <udc:FileName>Specify a filename or formula</udc:FileName>
    <udc:FolderName AllowOverwrite=""/>
    </udc:UpdateCommand>
    <!--udc:Authentication><udc:SSO AppId='' CredentialType='' /></udc:Authentication-->
    </udc:ConnectionInfo>
    </udc:DataSource>
    w: sandippatilblog.blogspot.com/

    Hi  Sandip ,
    How about escape “&” to “&amp;” as below:
    <udc:Query>https://contoso/_vti_bin/owssvr.dll?Cmd=Display&amp;List={32364DED-7FE3-4276-837C-F2AC62C04B81}&amp;View={804CC528-34B2-4473-89DB-C4E766CACC95}&amp;XMLDATA=TRUE&amp;NOREDIRECT=TRUE</udc:Query>
    Reference:
    http://social.technet.microsoft.com/Forums/en-US/534fae6b-2cef-4947-86e2-4869cb291cfe/the-form-cannot-be-opened-because-it-requires-the-domain-permission-level-log-id-5566-error?forum=sharepointcustomizationlegacy 
    http://stackoverflow.com/questions/3493405/do-i-really-need-to-encode-as-amp
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Create text file (ASCII), tab separated and load in sap (transaction al11)

    hi..
    i need to create a text file (ASCII), tab separated in sap which can be viewed in transaction AL11.
    thank you.

    Hi kailashl,
    Do intend to create a tab delimited file through program. or is it that you wish to diretly place the file on the application server.
    PS: if you wish to place the file which you have on the application server from presentation you use the tcode CG3Z, you need to give the source file path on the front end and target path on the application.
    If you wish to write the file onto the app server using program that you can do using dataset. and for tab delimited u can use CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    PS: Award points ONLY if the solution was useful to you.

  • Sort text file containing words

    I have a plain text file that has a list of words in it (they are one word per line) - kind of like a custom user dictionary.
    I want to be able to open the file, highlight all the words, Ctrl+Click and sort the words alphabetically.
    I did not see a sort function in Automator for selected text. I read something about a Grep command while I was searching for a solution before posting this request, but I am very new at Automator so am asking for help. Any ideas about how to do this?
    Thank you.

    There is a sort shell script that you can use (there are a few options to change the way it sorts).
    example workflow:
    1) *Get Specified Finder Items* (or however you want to get the text file(s))
    2) *Run Shell Script* { Pass Input: as arguments }for f in "$@"
    do
    sort "$f"
    done
    3) *New Text File* { Save as: Sorted.txt    Where: wherever } -- save the sorted items

  • Inserting automatic file name, date and time in Illustrator CS3?

    hello all,
    is there an option in Illustrator where you could automatically insert inside your file the file name, date and time where it was last created or modified, etc.
    I found this option to exist in InDesign, but could not find the same menu in Illustrator. I am using CS3.
    help?
    thanks a bunch.

    Mario,
    would you please be so kind to include a reference on your site about the script? As far as I can see, the PutDateandTime.js you are providing here is a copy or a slightly modified copy of the original script that Wolfgang Reszel has provided on our site for about four years.
    It is okay that the script is available on your site, but please not without a reference. Thanks.

  • How to rename a flat file concatenating date and time the file name?

    I created a package where I run a first interface that uses a flat file from a server and load into a table in Teradata.
    After using the API OdiFtpPut, I used an FTP file and send to an outfit.
    Since this procedure will operate daily, I need at the time of FTP, get the concatenation destination file name, date and time of execution.
    What is the best practice for this?

    Using OdiFtpPut in the field where it informs the destination file name, instead of putting just the file name (lpn_pln.csv), I put as follows:
    - lp_pln_+<% = odiRef.getSysDate (ddMMyyyyhhmm ")%>+. csv
    For code example, today would record the name lp_pln310120111412.csv
    Anything you can add my msn ---> aluizs @ ig. com. br (no spaces)
    Edited by: andre_l_soares on 31/01/2011 08:16

  • How to include the Pipe symbol ("|") in the column heading.

    Hi ,
    Can somebody advice how to include the Pipe symbol ("|") in the column heading.
    Regards,
    Yagne

    Are you looking for this ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>set colsep '|'
    satyaki>
    satyaki>select * from emp;
         EMPNO|ENAME     |JOB      |       MGR|HIREDATE |       SAL|      COMM|    DEPTNO|JOB1     |DOB
    ----------|----------|---------|----------|---------|----------|----------|----------|---------|----
          7499|ALLEN     |SALESMAN |      7698|20-FEB-81|     211.2|       300|        30|SALESMAN |
          7521|WARD      |SALESMAN |      7698|22-FEB-81|      1650|       500|        30|SALESMAN |
          7654|MARTIN    |SALESMAN |      7698|28-SEP-81|      1650|      1400|        30|SALESMAN |
          7788|SCOTT     |ANALYST  |      7566|19-APR-87|      4356|          |        20|ANALYST  |
          7839|KING      |PRESIDENT|          |17-NOV-81|      6600|          |        10|PRESIDENT|
          7844|TURNER    |SALESMAN |      7698|08-SEP-81|      1980|         0|        30|SALESMAN |
          7876|ADAMS     |CLERK    |      7788|23-MAY-87|     145.2|          |        20|CLERK    |
          7900|JAMES     |CLERK    |      7698|03-DEC-81|      1254|          |        30|CLERK    |
          7902|FORD      |ANALYST  |      7566|03-DEC-81|    4791.6|          |        20|ANALYST  |
          7934|MILLER    |CLERK    |      7782|23-JAN-82|      1716|          |        10|CLERK    |
          7566|Smith     |Manager  |      7839|23-JAN-82|      1680|         0|        10|Manager  |23-JAN-89
         EMPNO|ENAME     |JOB      |       MGR|HIREDATE |       SAL|      COMM|    DEPTNO|JOB1     |DOB
    ----------|----------|---------|----------|---------|----------|----------|----------|---------|----
          7698|Glen      |Manager  |      7839|23-JAN-82|      1680|         0|        10|Manager  |23-JAN-89
          1111|Selen     |SALESMAN |      7499|20-FEB-81|      1920|         0|        20|SALESMAN |23-JAN-89
          1111|Selen     |SALESMAN |      7499|19-OCT-08|      3000|         0|        10|         |
          7499|ALLEN     |SALESMAN |      7499|19-OCT-08|      3000|         0|        30|         |
             1|boock     |         |          |         |          |          |          |         |
    16 rows selected.
    Elapsed: 00:00:01.03
    satyaki>Regards.
    Satyaki De.

  • Uploading a text file from webi filter area as part of the query condition

    Post Author: balasura
    CA Forum: Publishing
    Requirement : Uploading a text file from webi filter area as part of the query condition Hi, I am in a serious requirement which I am not sure available in BO XI. Can some one help me plz. I am using BO XI R2, webi I am generating a ad-hoc report, when I want to give a filter condition for a report, the condition should be uploaded from a .txt file. In the current scenario we have LOV, but LOV could hold only a small number of value, my requirement is just like a lov but the list of values will be available in a text file ( which could number to 2000 or 2500 rows). I would like to upload this 2500 values in the form of a flat text file to make a query and genrate report. Is it possible in BO XI? For Eg:- Select * from Shipment Where u201CShipment id = u2018SC4539u2019 or Shipment id = u2018SC4598u2019u201D The u201Cwhereu201D condition (filter) which has shipment id will be available in a text file and it needs to be loaded in the form of .txt file so that it will be part of the filter condition. Content of a .txt file could be this shipment.txt =============== SC4539 sc2034 SC2343 SC3892 . . . . etc upto 2500 shipment Ids I will be very glad if some could provide me a solution. Thanks in advance. - Bala

    Hi Ron,
       This User does not have the access to Tcode ST01.
       The user executed Tcode SU53 immediately following the authorization failure to see the authorization objects. The 'Authorization obj' is blank and under the Description it has 'The last Authorization check was successful' with green tick mark.
      Any further suggestions, PLEASE.
    Thanks.

  • When I import IE8 bookmarks into Firefox Portable, the text files or downloaded Google searches or other downloaded websites that I saved and added to my various Favorites folders do not appear ... and (2) if I can get them to appear, will I continue to b

    When I import IE8 bookmarks into Firefox Portable, the text files or downloaded Google searches or other downloaded websites that I saved and added to my various IE8 Favorites folders do not appear ... and (2) if I can get them to appear, will I still be able to add text files to the Firefox Favorites folders ... and how.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

    http://portableapps.com/forums/support/firefox_portable

  • HT1349 I have downloaded 4 films purchased on my Ipad to my laptop but can only play 1.  The other 3 do not have a screen symbol in the list and are called ie The Lion King - Extras.  How can I play the films?

    I have downloaded 4 films purchased on my Ipad to my laptop but can only play 1.  The other 3 do not have a screen symbol in the list and are called ie The Lion King - Extras.  How can I play the films?

    Hello Bagpus113
    Check out the article below to troubleshooting issues with the sound for music and for videos. One other thing you can try is to convert the songs to a different format
    iTunes and QuickTime for Windows: Audio does not play or plays incorrectly
    http://support.apple.com/kb/TS1362
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/ts1718
    iTunes: How to convert a song to a different file format
    http://support.apple.com/kb/ht1550
    Regards,
    -Norm G.

  • Positioning a symbol at the center AND bottom of stage

    hi there,
    maybe this is a simple question, i hope so...
    i need to place a symbol at the center AND the bottom of a responsive site (stage height/width = 100%). the size of the symbol is fixed and should NOT change when resizing the browser window.
    for better understanding i created this fantastic visual:
    thanks for your help!

    ok, i found out how to do it, it's quite simple... so anyone who needs a sticky footer may need this...
    project files:
    https://www.dropbox.com/s/f53kpr808ofmsr6/footer.zip
    best wishes to all of you

Maybe you are looking for

  • Can not revert to Mavericks

    Hello all I have Yosemite and as you are all aware, WiFi issues are still there, my WiFi is completely off and would'n't turn on. Sometimes after my MacBook Air sleeps or is rebooted, the WiFi is magically on, but it's bound to cut off on the next sl

  • Doubt s in ABAP HR -Enhancements

    Hi Experts,         I am working in enhancements, I have  some doughtes in that ,so plz do help to me, ””””My enhancement is, Whenever we enter data such as Emp Firstname, emp.lastname,empdate of birth, in ‘pb10’  this data should check in PAP databa

  • Billin Problem related with payment terms

    Hi all SAP experts, The client is selling inventorized items (trading goods) as well as services. There are orders in which the client will enter the trading goods as well as a service item called as u201Cinstallation charges.u201D For the trading go

  • Receiving M:N Results when connecting to a SAP BW Query

    Hi All, I'm working in SAP BW 7.0 and BO I created a query which is perfectly running. I have already set for external connection an when I connect to a UNIVERSE, BO generates a correct Universe. The Univer contais just two InfoObjects. Each InfoObje

  • Call global class exception to report prog

    Hi expert,         In  global class, i write a method in that one exception can be raised. that exception can be called in report program. please can you help me. Thank you, dinesh.