/n and /r is writting out as []

I think this has something to do with the method of writting I am using
i grab some information from a text field, add it to a string, but when I open it with notepad /n and /r look like [], (my other data does not look like this when I open it with notepad)
     String a=jTextField11.getText();
     String person = a + "\n xxx" + "\r"; 
     OutputStreamWriter out2 = new OutputStreamWriter(new FileOutputStream(Loc),"UTF-8");
     out2.write(person);
     out2.close(); What should be the method of witting that would prevent this?
Edited by: Mr_Tuition on Dec 14, 2007 3:24 AM
Edited by: Mr_Tuition on Dec 14, 2007 3:26 AM

If I ask fred what colour it is and hes says red... Its red
If he gives it to me, I play with it, then I give it back, then he tells me its blue, Its not fred thats at fault but me for playing with it.
This data will be passed to 3rd party apps, and content editors. If manual content editors open this with note pad (which they will), they will not be happy when the see [][][][][], this is not the format they have used in the past, my app is supposed to help not hinder, I do not wish to restrict the content editors. There must be a method of witting that will write /n and /r out to files so that note pad interprets correctly.
I know this is so, since if I read /n from a file then write it out, it displays correctly... so it must be the method of adding /n and /r to a string that is at fault, how can I then add them to display correctly in notepad
Edited by: Mr_Tuition on Dec 14, 2007 3:50 AM
Edited by: Mr_Tuition on Dec 14, 2007 3:52 AM

Similar Messages

  • Write out file from java UDF?

    I have a synchronous RFC->XI->HTTP (no BPM) process and need to write out a log of the call details each time it runs.  At first, I tried having multiple receivers (one for HTTP and one for log file) in IB:Config, but received an error that I "cannot have multiple receivers when synchronous call".
    Should I be able to write out a file using java code in a UDF?  Should I do something with a BPM (and if so, any hints)?
    Thanks in advance!

    It deppends on which kind of log you want and how much time you're willing to spend on this.
    If you want to learn BPM and has available time to learn and implement, go for it. It will provide you more flexibility (since you can use any adapter protocol) and is way better for maintenance purposes.
    Your BPM will basically have 4 steps:
    1. A Receiver step in "Open S/A Bridge" mode;
    2. A Sender step in Asynchronous mode (to send the log message to your target system);
    3. A Sender step in Synchronous mode (to send the request to HTTP and receive the response);
    4. A Sender step in "Close S/A Bridge" mode.
    The mapping can be made in three ways:
    1. mapping between RFC and BPM (so your BPM will have abstract interfaces based on HTTP interface); or
    2. mapping between BPM and HTTP (so your BPM will have abstract interfaces based on RFC interface); or
    3. create 2 transformation steps in the BPM, one to map from RFC.request to HTTP.request and the other to map from HTTP.response to RFC.response (I'd not recomend this).
    Regards,
    Henrique.

  • BufferedWriter(Writer out)  and flush()

    BufferedWriter(Writer out)
    correct me if i'm wrong, but when i use BufferedWriter(Writer out) as in
    pout = new PrintWriter(new BufferedWriter(new FileWriter("log.txt");
    i do not have to call flush().
    it will automatically call flush when the buffer is 512 is that correct ?
    or do i have to still call flush to make sure the contents come out.
    Stephen

    I'm using jav 1.4.
    Notice the code below:
    I get a null exception when trying to write() a second time with the PrintWriter instance .
    Here is the error
    Tracer constructor works
    getLogFileDate() = Jun-14--2002-8.17.42-AM
    getLogFileDate() = Jun-14--2002-8.17.42-AM
    main method starts
    main method successfully gets Tracer instance tt. com.myinteractivesite.Tracer@888759
    Exception in thread "main" java.lang.NullPointerException
    at com.myinteractivesite.Tracer.log(Tracer.java:29)
    at com.myinteractivesite.Tracer.main(Tracer.java:72)
    Why do I get this null exception when trying to write a second time using the printwriter in the log() method ?
    * Tracer.class logs items according to the following criteria:
    * @since June 2002
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    class Tracer{
         public static void log(int traceLevel, String message, Object value)
              pout.write(getLogFileDate(new Date()) +" >" + message + " value = " + value.toString());
         public static void log(int traceLevel, String message )
              pout.write("HI HOW ARE YOU " ) ;
              pout.flush();
         //public static accessor method
         public static Tracer getTracerInstance()
              return tracerInstance;
         private static String getLogFileDate(Date d )
              String s = df.format(d);
              String s1= s.replace(',','-');
              String s2= s1.replace(' ','-');
              String s3= s2.replace(':','.');
              System.out.println("getLogFileDate() = " + s3 ) ;
              return s3;
         //private instance
         private Tracer(){
              System.out.println("Tracer constructor works");
              df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
              date                    = new java.util.Date();
              try{
              pout = new PrintWriter(new BufferedWriter(new FileWriter("Crawler_log"+getLogFileDate(new Date())+".txt", true)));
              pout.write("**************** New Log File Created "+ getLogFileDate(new Date()) +"****************");
              pout.flush();
              }catch (IOException e){
              System.out.println("**********THERE WAS A CRITICAL ERROR GETTING TRACER SINGLETON INITIALIZED. APPLICATION WILL STOP EXECUTION. ******* ");
         public static void main(String[] argz){
         System.out.println("main method starts ");
         Tracer tt = Tracer.getTracerInstance();
         System.out.println("main method successfully gets Tracer instance tt. "+ tt.toString());
         //the next method is where it fails - on pout.write() of log method. Why ?
         tt.log(1, "HIGH PRIORITY");
         System.out.println("main method ends ");
         //private static reference
         private static Tracer tracerInstance = new Tracer();
         private static Date date     = null;
         private static PrintWriter pout = null;
         public static DateFormat df = null;
    }

  • I have an external hard drive that shows up in disk utility but Verify and Restore are greyed out.

    I have an external hard drive that shows up in disk utility but Verify and Restore are greyed out. I am trying to determine what is wrong with the drive.
    I need the data on the drive and it won't show up in Disk Warrior. I have tried different Mac's and different USB cords only to find the same outcome. When selected in Disk Utility the information read as such...
    Disk Description : WD Elements 1023 Media                      Total Capacity : 500.11 GB (500,105,740,288 Bytes)
    Connection Bus : USB                                                               Write Status : Read/Write
    Connection Type : External                                                     S.M.A.R.T. Status : Not Supported
    USB Serial Number : 575837314135304D36373132        Partition Map Scheme : Unformatted
    As the drive shows in Disk Utility there must be some life left in it surely. There is a possibilty that the physical connection between the USB cord and the external drive is damaged but since the drive shows up I believe it's unlikely... before I give it to the pro's is there anything else I can do to diagnose the issue?

    Hello,
    I have just experienced the same thing!
    Although my external drive shows in Disk Utility, it does not show in Finder.
    And the Verify/Repair buttons are also greyed out.
    Also, although the drive is 2TB. DU shows it as having Total Capacity of only 4.14GB! (Which should be the Free Space).
    I was wondering if you solved your problem, & if so, would you share your solution.
    I´m afraid to Erase in case I lose all my Data on the drive.
    Thanks in advance for your reply!

  • [Flat File Destination [220]] Error: Failed to write out column name for column "Column 2"

    I am using SSIS to extract fixed width data into a flat file destination and I keep getting below error. I have tried almost everything in this forum but still no solution. can anyone help me out to solve this problem.
    [Flat File Destination [220]] Error: Failed to write out column name for column "Column 2".
    [SSIS.Pipeline] Error: component "Flat File Destination" (220) failed the pre-execute phase and returned error code 0xC0202095
    Thanks

    Hi Giss68,
    Could you check the Advanced tab of the Flat File Connection Manager to see whether the InputColumnWidth and the OutputColumnWidth properties of the Column2 has the same value? Please refer to the following link about the same topic:
    http://stackoverflow.com/questions/10292091/how-do-i-fix-failed-to-write-error-while-exporting-data-to-ragged-right-flat-fil 
    If it doesn’t work, please post the sample data and the advanced settings of Column2 for further analysis.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • How do I get firefox to write out homepages to pdf-files correctly

    2011-08-22
    I have been using Firefox for many years now. I like this browser better than Safari. However. I have a problem when I have connected to a homepage over the web and want to write the content out to a pfd-file. The pdf-file does sometimes contain only one page. The material is good enough for two or more pages of output. I have checked that using Safari browser. I´d like to continue using Firefox so please tell med what to do!
    Göran Stille
    [email protected]
    Computer Mac Powerbook G4
    Processor 1.67 GHz PowerPC G4
    Operative system OSX 10.5.8
    Firefox version 3.6.2

    "Google" is a search engine (website) and NOT (repeat: NOT) a PDF viewer. It can't and won't open PDFs in any real or imaginable way.
    Firefox added their own proprietary PDF viewer with version 20 - they're on 21 now. I'll be the first to admit "it sucks". You CAN'T fill in PDF forms with it, and you can't email them from the page like with Opera, Safari or Chrome (which use the reader plug-in still).
    Unfortunately, the ONLY option you have now that they've added it and killed the ability for the Reader plug-in to work with Firefox, is Tools>Options>Applications - select Portable Document Format(PDF) and choose "Use Adobe Reader (Default)". What that will do is FORCE Firefox to download the PDF instead of opening it in their terrible PDF viewer in the browser window.
    Or... use one of the other browsers I mentioned. They're all free.

  • Which planning function i have to use and how to write this planning fucnti

    Hi Bi Guru's,
    I have rolled out  BW SEM-BPS Planning Layout's for the Annual Budget in my organistaion.
    There are two levels of layout given for the each sales person.
    1)  Sales quantity to be entered Material and  country wise for all 12 months ( April 2009 to March 2010)
    2)  Rate per unit and to entered in second sheet, Material and country wise for the total qty entered in the first layout.
    Now i need to calculate the sales vlaue for each period and for the each material.
    Which planning function i have to use and how to write this planning fucntion.
    Please suggest me some solution ASAP.
    Thanks in Advance,
    Nilesh

    Hi Deepti,
    Sorry to trouble you...
    I require your help for the following scenario for caluclating Sales Value.
    I have Plan data in the following format.
    Country   Material    Customer    Currency    Fiscyear    Fiscper           Qty         Rate        Sales Value
    AZ          M0001      CU001          #             2009          001.2009        100.00                        
    AZ          M0001      CU002          #             2009          001.2009        200.00                        
    BZ          M0001      CU003          #             2009          001.2009        300.00
    BZ          M0001      CU003          #             2009          002.2009        400.00
    BZ          M0002      CU003          #             2009          002.2009        300.00
    AZ          M0001       #               USD          2009             #                                 10.00
    BZ          M0001       #               USD          2009             #                                 15.50
    BZ          M0002       #               USD          2009             #                                 20.00
    In the Above data the Rate lines are entered in the Second Layout, Where the user enters on the Country Material Level with 2009 value for FISCYEAR.
    I am facing problem with this type of data. 
    I want to store the sales value for each Material Qty.
    Please suggest some solution.
    Re
    Nilesh

  • Write out file through servlet

    Hello all,
    I wish to write out a file when a servlet is requested; however the file may be quite large and take a couple of seconds (approx 10) to write out. This results in a ten second delay for the user. I wish to offset this delay so the servlet continues executing returning the response and the file is written out in some form of background process.
    Could someone point me in the right direction?
    Thanks
    John

    Write up a Thread class to do the file writing for you. Your servlet will only start the thread with the required arguments and will generate the response without waiting for the thread to complete.

  • How to get the validity of the socket before writes out datas?

    I should keep the socket which created before and send/recieve datas several times,and the socket would be closed by other side after minites,
    the question is
    How can I get the validity of the socket before writes out datas?

    If I understand well yor concern...
    There is no way to know if a socket is still connected without using (i.e reading /writing on) it.
    That's the way it works on C API layer, so it should not be defferent in Java.
    For a good understanding of how TCP/IP works, if C code is OK for you, the best are Richard Stevens books.... (IMHO)

  • Write out Oracle models to RDF

    I am trying to write models I have in my Oracle 12c database to RDF. I am using Jena, and the code goes something like this:
    Oracle oracle = f.getOracle(); //My shortcut to getting access to the database, and give me an Oracle object.
    Model model;
    try {  model = ModelOracleSem.createOracleSemModel(oracle, modelName); }
    catch (SQLException ex) {
    //errorhandling
    model.write(out);
    Now, this works. But it works so terribly slow. I can almost see each individual triple downloaded. 30mb takes me three hours, which is totally unusable.
    Are there other ways of doing this?

    Here is a quick test I did.
    I have a graph with 60.9M triples. And on my machine (a quad core CPU and Samsung 840 SSD), I can dump it out in a few minutes.
    $ time java -Doracle.net.disableOob=true -cp ./classes:./'*' TestWrite jdbc:oracle:thin:@127.0.0.1:1521:db12c scott tiger mygraph 4
    117.632u 6.941s 7:50.38 26.4%   0+0k 4360+11611520io 33pf+0w
    The output is almost 6GB in size.
    5,944,877,703 Nov 18 16:42 dump.nt
    ------- Source code is as follows ----
    $ cat TestWrite.java
    import java.io.*;
    import com.hp.hpl.jena.query.*;
    import com.hp.hpl.jena.rdf.model.Model;
    import com.hp.hpl.jena.util.FileManager;
    import oracle.spatial.rdf.client.jena.*;
    public class TestWrite {
      public static void main(String[] args) throws Exception
        String szJdbcURL = args[0];
        String szUser    = args[1];
        String szPasswd  = args[2];
        String szModelName = args[3];
        Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
        ModelOracleSem model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
        GraphOracleSem gos = model.getGraph();
        gos.setDOP(Integer.parseInt(args[4]));
        OutputStream os = new FileOutputStream("/tmp/dump.nt");
        model.write(os, "N-TRIPLE");
        os.close();

  • When I write out a DDL - no PK:FK constraints

    Hi;
    When I use Application to write out a .sql file for a schema, it does not write out the PK:FK constraints. Any idea how to get this?
    thanks - dave

    select
    p.constraint_name "Primary or Unique Key", p.owner "PKEY_OWNER", p.table_name "PKEY_TABLENAME"
    ,f.constraint_name "FKEY_NAME", f.owner "FKEY_OWNER", f.table_name "FKEY_TABLENAME"
    from user_constraints p, user_constraints f
    where p.constraint_type in ('U','P')
    and f.constraint_type(+) = 'R'
    and f.r_owner(+) = p.owner
    and f.r_constraint_name(+) = p.constraint_name
    Or
    select
    p.constraint_name "Primary or Unique Key", p.owner "PKEY_OWNER", p.table_name "PKEY_TABLENAME"
    ,f.constraint_name "FKEY_NAME", f.owner "FKEY_OWNER", f.table_name "FKEY_TABLENAME"
    from user_constraints p left outer join user_constraints f
    on f.r_owner = p.owner
    and f.r_constraint_name = p.constraint_name
    where p.constraint_type in ('U','P')
    and (f.constraint_type = 'R' or f.constraint_name is null)
    ;

  • I,have,a,Galaxy,S,and,want,to,clear,out,some,memory.,All,my,epics,are,in,the,cloud,(I,think),but,I,want,them,on,my,external,hard,drive,before,I,delete,them,from,my,phone.,,Do,I,have,to,upload,all,of,the

    I have a GalaxyS5 and want to clear out some memory.  All my pics are in the cloud but I don't want to keep all of them.  After I sort and cull how to I move the keepers to my external hard drive?  Can I do this directly from the cloud?

    rwethereyet,
    Keeping your pictures safe is definitely important! Once you have synced the saved pictures to your phone you can transfer them from the phone to your computer. Are you using the Verizon Cloud Desktop app?
    JohnB_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • I have downloaded the latest pages  update on my iPad, but my iMac still has version 4.3 and I cannot find out how to update it only desktop. When I try to send something from my iPad pages to via email to be opened on my desktop in Pages, it won't open P

    I have downloaded the latest pages update on my iPad, but my iMac still has Pages version 4.3, and I cannot find out how to update it on my desktop. When I try to send something from my iPad pages via email to be opened on my desktop in Pages, it won't open in Pages. I get a message that it can't be opened because the version is too old. I sent the document as a PDF and it worked. But I want to be able to use Pages back and forth. HOw do I update the Pages version on my desktop iMac?

    The file format used by the iOS versions of the iWork apps can only be read by the new iWork apps on your Mac - i.e. Keynote 6, Pages 5 & Numbers 3. Those versions for the Mac require Mavericks, OS X 10.9. The "too old" error on a Mac comes if you are trying to open an iWork '08 or earlier file in the newest apps. If you do have the newest apps you can open the files from your iPad.
    If you can't or don't want to upgrade to Mavericks & the newest iWork apps your best option would be to export/share the files from the iPad to a type an older version of iWork can read such as Word, text, Excel, etc.
    Or contact AppleCare. They made this mess, let them fix it.

  • My apple ID and password, recognized through out the Cloud, is not being recognized in the itunes store. I am signed into itunes.When I want to change something in my account, the sign in prompt comes up and doesn't recognize my PW

    My apple ID and password, recognized through out the Cloud, is not being recognized in the itunes store. I am signed into itunes.When I want to change something in my account, the sign in prompt comes up and doesn't recognize my PW

    Solved the problem. I had to allow cookies for safari and it run - as here: Re: itunes keeps asking for my apple id password. it's NOT entered incorrectly.

  • HT1689 since doing the 7.0.4 update i notice that my mobile data has doubled and i am running out of data mid month.  I've disabled apps s not many running.  Any suggestions?

    since doing the 7.0.4 update i notice that my mobile data has doubled and i am running out of data mid month.  I've disabled apps s not many running.  Any suggestions?

    I am having the same issue even with the newer 7.1. I have a 1-100 KB data push on both my husdand's and my phone every hour on the hour (i.e. my will be at :23 of the hour and his will be at :13 of the hour and it will change). This is whether we are on a WIFI and with all apps, background refreshes, push notifications, etc turned OFF.

Maybe you are looking for

  • Upgrade to Unlimited BT Infinity 1: post-order iss...

    A little earlier I accepted an emailed BT offer to upgrade from the Infinity package I have with a monthly limit, to Unlimited BT Infinity 1. Went through the online process, upgrade was confirmed online and now I have two issues. (1) The emailed off

  • Where did the "Detect display" command go?

    I cannot find it in the System Preferences app and can't find a way to connect an external display (or video projector) to my MacBook Air

  • Exporting document to Excel "Percent" on the graph,shown as decimal values

    When I'm converting a WEBI report(pre 3.0 version) into Excel 2003, I have a problem with displaying data values on the graphs which are formatted as "percent".  Nomatter what I do, in excel it will always show the same data values on the graph as de

  • Not generating controlfiles backup trace file

    Hello frndssss when i am issing this command , sql>alter database backup controlfile to trace; output its showing : Database is altered . when I am looking the trace files in UDUMP dirrectory there is no file exist there what might be the reason ? my

  • Pulse width measurements

    Hello, I am trying to measure the pulse witdth of a signal that has a pulse width of 800 micro seconds.  I am using the pulse width measurement VI with an indicator on the pulse duration output.  The sample rate I am using to sample the signal is 100