Reading new line charchter

How can i read a new line charchter in forms pl/sql.
I have a multiline address feild, but I have to read the data in one single line.

Thats great many thanks it works, BUT now I got another problem what if we are not sure of no of newline character the feild have?
Do we need to write a function for it OR we can achive it through SQL itself!

Similar Messages

  • Read new line charchter

    How can i read a new line charchter in forms pl/sql.
    I have a multiline address feild, but I have to read the data in one single line.

    If you need to parse the original multi-line input into seperate fields then some code like the example below might help? It is a simple package which has two functions, one which returns the number of lines in the users input (based on chr(10) delimeter) and another which will extract a given line of that input (ie - give me line 3 of the address)
    package multiline is
         function count(input varchar2) return number;
         function line(input varchar2, line_number number) return varchar2;
    end;
    package body multiline is
         delimeter constant varchar2(1) default chr(10);
         function count(input varchar2) return number is
         begin
              if input is not null then
                   if instr(input, delimeter) > 0 then
                        return ((length(input) - length(replace(input, delimeter, ''))) / length(delimeter)) + 1;
                   else
                        return 1;
                   end if;
              else
                   return 0;
              end if;
         end;
         function line(input varchar2, line_number number) return varchar2 is
              counter number;
              pos_1 number default 1;
              pos_2 number default 1;
         begin
              if line_number <= multiline.count(input) then
                   for counter in 1..line_number loop
                        if counter > 1 then
                             pos_1:= pos_2;
                        end if;
                        pos_2:= instr(input||delimeter, delimeter, pos_2 + 1);
                   end loop;
                   return substr(input||delimeter, case when pos_1 > 1 then pos_1 + 1 else 0 end, (pos_2 - pos_1) - case when pos_1 > 1 then 1 else 0 end);
              else
                   return null;
              end if;
         end;
    end;
    Is this any use to you?
    Pete

  • How do i read new line char in jtextarea.getText()?

    guys, how do i read new line character in jTextArea.getText()? i'll appreciate ur help tnx..:))

    Use a StringRead, then you can treat the text file a file.

  • Reading new line character as part of a input stream

    I am reading and parsing an ASCII text file in the Windows environment. End Of Line marker is \r\n as expected for Windows. However, I have discovered that \n can be part of the data stream being sent to me and it doesn't mean a new line or new record. It should be treated as part of the data stream and not processed a s a new line. However, the readline() method I am using treats it as such and the read is cut short and therefore I do not get all of the data for that record. I want to avoid reading char by char if I can as this is a large text file.
    Any Ideas as to how to let the \n go through and to wait for \r\n as the real end of line?
    Thanks

    I think what I would do is implement my own reader, with my own readLine(). Should be trivial - just subclass the reader you are using, and read and look at each byte, not returning until you see the \r\n sequence you want to treat as end of line.

  • Read new line of returned message

    Hi,
    I am new to labview and I am trying to get the return message from an instrument which is three lines long, but only one line gets displayed. How can I read past the carriage return?
    Thanks.
    Angelia

    Check the Termination char setting for comport
    http://zone.ni.com/reference/en-XX/help/371361G-01​/lvinstio/visa_configure_serial_port/
    termination char calls for termination of the read operation. The read operation terminates when the termination char is read from the serial device. 0xA is the hex equivalent of a linefeed character (\n). Change the termination char to 0xD for message strings that terminate with a carriage return (\r).
    Or just read it 3 time one line at a time to get all the data. Set the number of bytes to read to something larger than you will ever get back on each line.
    Omar

  • New line character not read..

    Hi guys;
    i'm writing a jsp application that has to write into a file...
    the file has to be in the form of multiple lines of the form : login=password
    i did the following:
    String s=new String("");
    String s2=new String("");
    BufferedReader in = new BufferedReader(new FileReader(
    "c:\\myflash\\myfile.txt"));
    while((s=in.readLine())!= null){
    s2 +=s+'\n';
    s2 +=login+"="+password;
    in.close();
    PrintWriter outer = new PrintWriter(new BufferedWriter(new FileWriter(
    "c:\\myflash\\myfile.txt")));
    outer.println(s2);
    outer.close();
    the problem is the following: when i run the applications the data are written in the file without new line ...
    it seems that the '\n' character did not got read!!
    I don' know what's the problem!
    please help!...

    are you testing this on Windows? Are you determining that the newline chars aren't there by opening the file in another program? Most Windows programs will not recognize the \n by itself. It needs the \r\n combination. You might want to use System.getProperty("line.separator"), which will return the correct OS-specific line separator character(s).

  • Read at each new line from .txt file

    Hi guys
    I want to read from a file which I am saving using labview. What I am doing is reading 128 bytes fro VISA port and saving it in .txt file with new line constant. At some later time I want to read 128 bytes from that text file do some processing and display it. The "read from text file" vi has convert EOL but I am not able to configure it. Please help me..
    Thanks in advance
    Niladri

    Hi Newbee_3,
                                                  Do 1 thing, Read the txt file & convert this into string, Then you have all the flexibility to do whatever you want.
    Thanks
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • How to print new line in jsp page

    hi
    how to print new line in jsp page
    thanks

    \n - new line character is in java specific not HTML
    specific.Well, if the correct line separator sequence (by far not always \n) would be used, it does add a new line to the HTML output. Too bad that you don't want to see HTML but formatted text. The BR tag is a formatting element for the displayed text, not a line break in HTML. ;)

  • What is happening with my new line install?

    Hi,
    I don't normally post on anything like this, but feel I am being left no alternative, other than cancelling my order.
    I am a new customer to BT and on the 14th of May I placed a order for a broadband and phone package, which was to include a new line installation on the 5th June between 8am and 1pm.
    I also ordered a new phone system and dual wifi dongle which all turned up as expected.
    On the 5th June I took a day off work and waited until just after 2:30pm for the engineer not to turn up.
    I received no call, text or email telling me that the appointment had been cancelled, it took me to call BT and finally manage to get to speak to somebody human to find out that it had apparently been delayed.
    First I was speaking to somebody from the UK the next I was put through to order management in India, which started to infuriate me more as the line was really bad and I was calling from my mobile for then to have them hang up on me.
    I called back a further 3 times after being passed from pillar to post to eventually get put back in touch with a order management lady in India again.
    She told me that the problem was with openreach as they reckoned they had tried calling me on the 14th May (when I placed the order) to which I replied I had not received any phone call from them.
    They wanted to know if it was a first or second line installation, I replied 5 times with it is a separate line that needs to be installed and I still don't think she understood after that.
    I was then told I would get an update on the 12th June between 8am and 8pm as to when the line was going to get installed, to which I did and again was a bad line as the call came from India just to be told there is another delay which will be the 19th June.
    At this point I'm beginning to lose my patience, I had waited nearly a month for the line installation to happen to be told that there was another delay which would take another 7 days before somebody updated me again.
    After I put the phone down I received a text from BT sms saying they had tried to contact me but we're unable to do so but not to worry they will be back in contact on the 22nd June?
    Very strange seen as I had just spoken to somebody and was told the 19th June.
    I rang back through to BT and got put through to India yet again where the signal was poor and asked that somebody call me from the UK as nothing seems to be getting sorted.
    Within 10 mins I got a call back and was put through to BT in Dundee, I explained the whole situation over again and was told they would be looking into the problem and would get back to me later on the same day the 12th June.
    It is now the 17th June and I still have no answer as to when the line installation is taking place, so I can start using the equipment I have paid for.
    if I knew in the first place that this was going to be a problem I would have used a different provider other than BT, as a new customer I find their lack of communication and generally not seeming to give a **bleep** about customers poor, with my only choice then being if I don't get the answers I want on the 19th June I will cancel the order and send everything back for a full refund and would advise others not to use BT in the future.
    Sorry for the rant and this being my first post but I am beginning to lose my patience any help would be appreciated.

    Hi lda1979, 
    Welcome to the forum and thanks for your post. 
    I am so sorry that your order has been delayed and you are not getting any information on this. 
    Can you send me in your details using the "Contact The Mods" link found in my profile and I will find out what is happening. 
    Cheers,
    OlgaC 
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Records are not getting imported due to new line charactor in the field

    Dear All,
    I am trying to load a file into target but the import is failing. The error thrown is as below;
    During the import of leads into CRMoD through loading the New lead/Step lead file received from CA, leads have not been imported and we encountered the following
    error message:
    "Import field 'LAST_NAME' had a blank value for the required Oracle CRM On Demand field 'Last Name'. This record was not imported. Please enter desired values for
    the required fields and re-import this record."
    Reason:
    Leads are not imported due to an additional new line (Enter) character, which results in the subsequent lines not being picked up and the error of import failure.
    Please help me to resolve this to remove the new line charactor in the field so that import succeeds..
    By the way, I am working on ODI 11g.
    Thanks in Advance
    Regards
    Santy

    While i was reading your post i remembered an issue that madded me. I don't know Oracle CRM, but a possible workaround could be to create a temporary Oracle table and load all data inside it. After that load in CRM only valid rows.

  • Arraylist only reading first line of file

    I am reading a text file using an arraylist. my file has a single value on each line e.g.
    2
    3
    4
    5
    however this method is only reading only the first line of each file. is it because of this statement:
    String s1[] = number.split("\\s");
    I would like to change the method so its not expecting numbers in a single line.. but reads each line and adds it to the collection... how can I do that?
    here is getData method that gets the file and processes it.
         public static List<Integer> getData(String Filename) {
              List<Integer> array1 = null;
              // BufferedReader for file reverse.txt
              try {
                   array1 = new ArrayList<Integer>();
                   BufferedReader bf = new BufferedReader(new FileReader(Filename));
                   String number = bf.readLine();
                   String s1[] = number.split("\\s");
                   for (int i = 0; i < s1.length; i++)
                        array1.add(Integer.parseInt(s1));
              } catch (Exception e) {
                   e.printStackTrace();
              return array1;

    Faissal wrote:
    while(bf .ready()){
    readline() will return null if the end of the stream has been reached. ([http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html]). This condition can be used to determine when to stop reading thereby ensuring that all lines have been read.
    EDIT:
    Here's a code snippet from [Java Developers Almanac|http://www.exampledepot.com/egs/java.io/ReadLinesFromFile.html]: notice how they close() the stream when they're finished with it.

  • General Ledger Accounting (New): Line Items 0FIGL_O14  Performace issue

    Dear Forum,
    We are facing a performance issue while loading the data to 0FIGL_O14 General Ledger Accounting (New): Line Items from  CUBE ZMMPRC01 -> ODSO 0FIGL_O14 DSO.
    Please see my requirement below for updating the data to 0FIGL_O14 DSO.
    This report is generated to display Dry Dock and Running Repair expenses for the particular Purchase orders with respective G/L's.
    1) The G/L DSO will provide us the 0DEBIT_LC and    0DEB_CRE_DC Foreign currency amount with signs (+/-) amounts and.
    2) ZMMPRC01 Cube   will provide us the 0ORDER_VALUE  (Purchse order value)and    0INVCD_AMNT Invoice  amount.
    While we are loading the data from  CUBE ZMMPRC01 -> ODSO 0FIGL_O14 DSO ,we have created nearly 19 InfoObject  level routine to derive the below mentioned fields data for MM Purchase Order related records.
    0CHRT_ACCTS    Chart of accounts
    0ITEM_NUM      Number of line item within accounting documen
    0AC_DOC_NO     Accounting document number
    0GL_ACCOUNT    G/L Account
    0COMP_CODE     Company code
    0COSTCENTER    Cost Center
    0CO_AREA       Controlling area
    0COSTELMNT     Cost Element
    0SEGMENT       Segment for Segmental Reporting
    0BUS_AREA      Business area
    0FUNC_AREA     Functional area
    0AC_DOC_NR     Document Number (General Ledger View)
    0AC_DOC_TYP    Document type
    0POST_KEY      Posting key
    0PSTNG_DATE    Posting date in the document
    0DOC_CURRCY    Document currency
    0LOC_CURTP2    Currency Type of Second Local Currency
    0CALQUART1     Quarter
    0CALYEAR       Calendar year
    For reference Please see the below logic to derive the data for PO related record.
    DATA:
          MONITOR_REC    TYPE rsmonitor.
    $$ begin of routine - insert your code only below this line        -
        ... "insert your code here
        types : begin of ty_FIGL,
                    CHRT_ACCTS type /BI0/OICHRT_ACCTS,
                    ITEM_NUM type /BI0/OIITEM_NUM,
                    AC_DOC_NO type /BI0/OIAC_DOC_NO,
                    GL_ACCOUNT type /BI0/OIGL_ACCOUNT,
                end of ty_FIGL.
        data :it_figl type STANDARD TABLE OF ty_figl,
              wa_figl type ty_figl.
        SELECT single CHRT_ACCTS
                        ITEM_NUM
                        AC_DOC_NO
                        GL_ACCOUNT from /BI0/AFIGL_O1400
                          into wa_figl
                          where DOC_NUM = SOURCE_FIELDS-DOC_NUM and
                                DOC_ITEM = SOURCE_FIELDS-DOC_ITEM and
                                /BIC/Z_PCODE = SOURCE_FIELDS-/BIC/Z_PCODE
                                and
                                /BIC/Z_VOY_NO = SOURCE_FIELDS-/BIC/Z_VOY_NO
                                and
                                FISCYEAR = SOURCE_FIELDS-FISCYEAR.
        if sy-subrc = 0.
          RESULT = wa_figl-AC_DOC_NO.
        ENDIF.
        clear wa_figl.
    Please note the same kind of logic is applied for all the above mentioned fields.
    Here is my concerns and issue.
    For the all above all routines i am referring BI0/AFIGL_O1400
    DSO and finally loading to the Same DSO(BI0/AFIGL_O1400
    The worried part is my DSO  0FIGL_O1400 is currecnly having nearly 60 Lacks records and MM cube is having nearly 55 requests which are required to update to the Above DSO for PO related PO value and Invoice amount.
    The big issue here is while uploading data from MM cube to DSO say for example if the request is having  25,000 records from this  nearly 500-600 records will be updated to DSO.
    But here it is taking huge time ( nearly 3 days for request ) for updating  these records , like this i have to pull 50 more requests from Cube to DSO as per the requirement.
    Please note as of now i haven't created any indexes on DSO to improve this loads.
    Please note am facing this issue in Production environment and need your help ASAP.
    Thanks & Regards,
    Srinivas Padugula

    Hi,
    If selecting data from 0FIGL_O14 is taking long time then you can create secondary indexes on DSO.
    0FIGL_O14 would be huge as data volume directly corresponds to data volume in BSEG.
    But for you requirement, I think what you can do is,
    1. create multiprovider on top of DSO and Cube and create Bex report to give you the fields requried from both the infoproviders, you can then use open hub or APD approach to keep the data in the staging table or direct update DSO and then load the data to the DSO
    2. Create secondary indexes on DSO so that fetching would be faster.
    3. Do the enhancment at R/3 level to fetch fields from MM during load of G/L
    Regards,
    Pravin Karkhanis.

  • 500k profile after disruption and new line install...

    Hello,
    Status: 
    I have an open fault logged with BT;  
    Phone line ok but broadband speed low, profile appears stuck at 500k.
    History: sporadic BBand connection and noisy phone line followed by outright failure of both.
    Engineers visited and confirmed line between street and master socket probably corroded - they put it on leg+leg to get it working while we waited for a new physical line to be installed.
    Pavement was dug up, new armoured cable run from street to house, and a proper master socket fitted (NT5 ? but no inbuilt ADSL filter).
    In effort to ensure low noise, ALL other sockets in the property disconnected.
    Digital phone (3 handsets off a single powered base) are run off the master socket using a filter.
    Router is business hub - 2700hgv; f/w 6.1.1.48.1-enh.tm ,  h/w 2701-100589-005 .
    Hub is connected to same master socket as phone (as it's the only socket now connected to the new line).
    New line was installed approx 18 days ago.
    Speed tests (speedtest.net) repeatedly show download of 480kbps, upload around 620kbps.
    No change since new line was installed and all but the master socket decomissioned.
    I use wireless to the router but also repeated tests with a Cat6 copper RJ45 cable and got same results.
    Have taken all wireless devices offline and removed electrical items near phone line power supply and cable path to reduce potential noise and repeated tests.
    I left the router on for two weeks and no increase in broadband speed.
    I rebooted it twice this weekend to see whether it picked up a different profile - but no change.
    BT speedtester repeatedly indicates a profile of 500k (full results further down).
    Last year I had speeds about 512k on a DrayTek router before switching to the 2700HGV. The change to the BT hub upped the download speed to around 1Mbps, which made a huge difference.
    I know I am "a long way from the exchange" but I've had 1Mbps last year and now have a new line into my property, so not much left that I can do to improve the situation.
    I'd like to know what can be done to get me at least 1Mb download again.
    I have an engineer visit due tomorrow but I believe that will be purely to finish putting paving slabs back over the armoured cable that's been installed (i.e. OpenReach dig team rather than line engineers).
    After those slabs are done, I expect the fault will be closed but I'll still have a 500k profile and will need to raise a new fault all over again - that fault was opened 5 weeks ago.
    Results of speedtester.bt.com run just now (1pm Sun 13th March 2011):
    Download speed achieved during the test was - 363 Kbps
     For your connection, the acceptable range of speeds is 100-500 Kbps.
     Additional Information:
     Your DSL Connection Rate :576 Kbps(DOWN-STREAM), 777 Kbps(UP-STREAM)
     IP Profile for your line is - 500 Kbps
    The throughput of Best Efforts (BE) classes achieved during the test is - 2.46:14.86:82.95 (SBE:NBEBE)
    Upload speed achieved during the test was - 638 Kbps
     Additional Information:
     Upstream Rate IP profile on your line is - 777 Kbps
    Router web interface shows:
    Rate:
    576 kbs
    778 kbs
    Max Rate:
    2621 kbs
    784 kbs
    Noise Margin:
    16.7 dB
    7.0 dB
    Attenuation:
    62.8 dB
    35.8 dB
    Output Power:
    16.1 dBm
    12.4 dBm
    Protocol:
    G.DMT2 Annex A
    Channel:
    Interleaved
    DSLAM Vendor Information
    Country: {46336} Vendor: {IFTN} Specific: {48753 }
    ATM PVC:
    0/38
    Rate Cap:
    2621 kbs
    Attenuation @ 300kHz:
    62.8 dB
    Uncanceled Echo:
    -14.8 dB
    Ok
    VCXO Frequency Offset:
    -2.0 ppm
    Ok
    Final Receive Gain:
    34.5 dB
    Ok
    Impulse Noise Comp. Tones:
    0
    Ok
    Excessive Impulse Noise:
    0
    Ok
    I hope that's the information that someone might need to help me at least get 1Mbps back on my line.
    Regards,
    BK

    Hi Bk1
    Welcome to the Community.
    Send me an email to the link in the about me section of my profile.
    I can have this looked into for you further.
    Cheers
    Stuart
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • CLIENT_TEXT_IO : cannot insert new line into a text file

    Facts:
    Developer 10g
    AS 10g
    Web utility
    Problem:
    i am traying to
    Open a text file. using CLIENT_TEXT_IO.FOPEN
    insert a record in to a text file using CLIENT_TEXT_IO.PUTF
    insert a new line using chr(10) or CLIENT_TEXT_IO.NEW_LINE
    or CLIENT_TEXT_IO.put_line
    insert the next record
    Close the file.
    all work except insert a new line
    Why !!!
    it was Working fine in 6i, but now in 10g and Webutil is not working
    plz help

    Hi you can put a new line in a text file using System.getProperty("line.separator"). This implementation will work for every OS.
    import java.io.*;
    class Demo{
    public static void main(String args[]) throws Exception {
    FileWriter fr = new FileWriter("FileDemo.txt");
         fr.write("AAAAAAAAAA");
    fr.write(System.getProperty("line.separator"));
    fr.write("AAAAAAAAAAA");
    fr.close();
    }

  • Reading one line from a text file into an array

    i want to read one line from a text file into an array, and then the next line into a different array. both arays are type string...i have this:
    public static void readAndProcessData(FileInputStream stream){
         InputStreamReader iStrReader = new InputStreamReader (stream);
         BufferedReader reader = new BufferedReader (iStrReader);
         String line = "";          
         try{
         int i = 0;
              while (line != null){                 
                   names[i] = reader.readLine();
                   score[i] = reader.readLine();
                   line = reader.readLine();
                   i++;                
              }catch (IOException e){
              System.out.println("Error in file access");
    this section calls it:
    try{                         
         FileInputStream stream = new FileInputStream("ISU.txt");
              HighScore.readAndProcessData(stream);
              stream.close();
              names = HighScore.getNames();
              scores = HighScore.getScores();
         }catch(IOException e){
              System.out.println("Error in accessing file." + e.toString());
    it gives me an array index out of bounds error

    oh wait I see it when I looked at the original quote.
    They array you made called names or the other one is prob too small for the amount of names that you have in the file. Hence as I increases it eventually goes out of bounds of the array so you should probably resize the array if that happens.

Maybe you are looking for

  • Is it possible to script Firefox to do things from the command line?

    Specifically, I am attempting to print a web page at a specific url from the command line.

  • Links not passed to PDF file in RH7

    I have 4 Webhelp projects that output to PDF files. RH7 is supposed to retain hyperlinks in the PDF file and it did on the the first volume I converted and compiled. But the second volume is not retaining the links even though I have "Add links to PD

  • Address Book Opens Automatically and will not close (even with Force Quit)

    The address book automatically opens at times and I cannot close it. Even with a force quit, I cannot close it. It takes up over 80% of CPU cycles when it opens automatically. Any thoughts or suggestions? Thanks Robby

  • Po to inbound delivery

    Dear friends I have a scenario where i need to bring the master data text to inbound delivery text.what are the settings required.Is it possible? Regards Aaryabalaji

  • Effects plug-ins, and user preset weirdness

    Here's a headache for you. I've noticed that when using VST/DX effects in Audition that it adds its very own load/save preset bar to whatever effects application is in use, and that when saving presets with this quick access bar that it doesn't appea