Line continuation in java

What is the syntax for line coninuation in java.Suppose i am defining a string and it goes to the next line.Without using '+' for appending how do i define this single string.

use concat(String yourString). This will append yourString to the end of your first String.

Similar Messages

  • System call, line continuation issue

    Hello,
    I used Java system call on a linux script as below:
    Runtime.getRuntime().exec(myScript.bsh);
    Where myScript.bsh is a bash script file. While the bash script file was executed, the issue is that some scripts in the file were skipped during exectution when there is a line continuation symbol. e.g.
    runCommandLine arg1 \
    arg2 \
    arg3
    The above command in myScript.bsh will not be executed. However, it will be executed successfully if I put the above command in one single line without the use of line continuation.
    I would appreciate any insights on how to get the script run with line continuation.
    Yuanshui

    Yancy_cheng wrote:
    Thank you very much. It works!
    While the line continuation works, another problem comes up:
    /bin/more: /bin/more: cannot execute binary file
    when below line is executed:
    more $1 | grep run_range_modulator | sed s/-s1/-p$theta/g > tmp
    I would appreciate the help. This sounds like a *nix problem instead of a Java problem.
    Confirm that you can execute the command directly in a terminal window.
    You may have to wrap the call in a shell.

  • Line wrapping in Java??

    Hi,
    Can anyone tell me if there is a class to handle line wrapping in Java?
    I'm working on a Java Mail application that deals with fairly lengthy email message bodies. The problem is in the actual email, the message body appears in a lengthy horizontal single line which is rather inconvenient to read.
    I'd like to break the message body into convenient 80 character lines that takes word boundries into account so that there are no broken words at the end of a line.
    Thanks,
    Veena

    Well the easiest way would be to put line breaks when you want them.
    "\n" is the line break character.
    So String("aaaaa\naaaaa");
    Should appear as
    aaaaa
    aaaaa

  • Line graphs in java

    I am looking for a free class that will allow me to graph a line graph in java. I was going to write my own but figured there must already be some out there... There doesn't happen to be a JGraph object that sun is working is there?

    Look at JFreeChart, it contains tools to draw many different charts and graphs.
    DB

  • Sun Studio 12 support DOS text (e.g. CR\LF) for line continuation ?

    I moved up to Sun Studio 12 hoping that I could solve a age old problem that allows me to share my code via NFS across multiple systems. AIX and GCC Linux precompilers and compilers have not problem with a code like this:
    #ifndef FSIBITON^M
    #define FSIBITON(x) \^M
    (long)( \^M
    ( ~(unsigned long)0 >> x ) & \^M
    ( ~(unsigned long)0 << ((sizeof(long)*8) - (x+1)) ) \^M
    )^M
    #endif^M
    (where ^M is the CR character)
    but for Solaris with the Sun Solaris compilers I have always had to copy the tree and convert to UNIX text.
    The line continuations are there for z/OS MVS record length limits to avoid having to modify default systems to build on that platform.
    Error:
    "/release/rel122/rps100/fsilib/unix/../h/fsi.h", line 118: token not allowed in directive: \
    Is there some undocumented flag/option I can use to get past this error? I hope so. Otherwise have to go back to coping lots and lots of code around, converting to Unix text as I do it, preserve the date based on the original file and then copy the binaries back to staging afterwards. On AIX and Linux and Windows they can all build in parallel from the SCM export.

    Sorry, I don't know of a way around this exact issue.
    Studio compilers will ignore the CR in a CR/LF sequence, but the C compiler does not accept what looks like an escaped CR. (The C++ compiler does accept what was intended as an escaped newline sequence.)
    Is the CR actually necessary? I thought that on systems using CR/LF as the default newline would accept LF as a newline as well in source code.
    If you have a Studio support contract with Oracle, you can file a request for enhancement (RFE) on the C compiler via your support channel to address your problem.
    Edited by: Steve_Clamage on Jul 30, 2012 9:18 AM

  • How to use line wrapping and line spacing in java?how to use line wrapping

    how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?how to use line wrapping and line spacing in java?

    Hello,
    You should post your question at:
    http://java.forum.sun.com
    Thanks
    - Rose

  • How to use line wrapping and line spacing in java?

    how to use line wrapping and line spacing in java?

    Hi,
    This is explained in the java Tutorial. Please see the link:
    http://java.sun.com/docs/books/tutorial/i18n/text/line.html
    and find some sample examples.
    Hope this helps,
    --Sun/DTS                                                                                                                                                                                                                                                                                                                                                                                       

  • Terminal line continuation

    Hey wasn't there a UNIX forum around here somewhere?
    How do I run a ./configure command telling Terminal to use a line continuation character?  For example:
    ./configure --prefix=/usr/local/python-$version \
    --enable-frameworkinstall=/usr/local/python-$version/frameworks \
    --enable-universalsdk=/ 'MACOSX_DEPLOYMENT_TARGET=10.6 \
    --with-universal-archs=3-way \
    --htmldir=/Library/WebServer/share/Python
    I thought the backslash should be a line continuer, but it doesn't work.  BTW, I wasted about an hour searching Google for the answer to this question.

    Skip it, I figured out one of my parameters is wrong but no error is reported. The backslash character is the line continuer.

  • Multi line strings - line continuation chars?

    Hi all,
    I'm not sure if this is a daft question or not...
    I need to put a multiline select statement into a string variable.
    ie I would like to put the sql below into a variable.
    select bla bla bla bla bla
    from bla
    where bla
    strvar := 'select bla bla bla bla bla
    from bla
    where bla';
    Is there a standard line continuation character that I can put at the end of each line to enable me to put the single quote and the beginning of line 1 and the end of line 3? Or do I need to quote each line front and back and cat them together as separate strings?
    rgds
    John

    Hi John,
    See if this can help you
    declare str varchar2(10000);
    begin
    str := 'select bla bla bla bla bla '||chr(10);
    str := str||'from bla '||chr(10);
    str := str||'where bla '||chr(10);
    dbms_output.put_line(str);
    end;
    SQL> /
    the output should be like below :
    select bla bla bla bla bla
    from bla
    where bla
    Anyway new line character is chr(10) for SQL.
    Thanks
    Kailash K Agarwalla,
    Delhi, India.

  • How to read messages from mqseries continuously by java?

    Hi,
    I'm sending messages to the queue of MQSeries.
    Here my requirement is i have to write a java/jms program that should run at the back side and check the queue  for every 5 minutes for messages.If any message exists in the queue the java/jms program should read the message and display it on the console.
    If anybody has idea please reply it.
    thanks in advance

    Hi!
    You have many ways. You could define a cron on a UNIX box to make sure a simple command line app connects to the queue every 5 min and uses JMS API to read the queue and do whatever you need with the messages.
    http://java.sun.com/products/jms/javadoc-102a/index.html
    On the other hand, unless its critical to recover messages just every 5 min., you could create an MDB. Actually this is the best solution: a Message Driven Enterprise Java Bean is just a listener over the queue reacting instantly to every message received. The way to create and configure them depends strongly on your appserver and development process: an IDE as WSAD or something like that creates them very easily. The actual problem with these ones is to properly configure them on your appserver. However, all appservers will allow you to define a 'Foreign JMS Provider' or something like that pointing to the actual MQ implementation you have and define an activation specification on which to sit your MDB.
    Regards
    Jorge

  • Permission problems with command line CVS and Java CVS App

    Greetings,
    I'm part of a moderately sized website development team which recently upgraded to MacBook Pros (dual core) running OS 10.4.9. One of the primary tools we use in our day to day work is the open source concurrent versioning system (CVS). We've noticed a distressing issue running CVS on our macbook pros: there seems to be a problem with the way these new machines handle permissions on the directories/files that CVS uses to manage files.
    The error occurs when the CVS application, in this case both command line CVS and GUI CVS application named SmartCVS, tries to rename a temporary file named Entries~ to its new name Entries (no ~). It looks like this:
    java.io.IOException: Could not rename file
    /Users/[USER]/Sites/[MODULE]/lib/CVS/Entries~ to
    /Users/[USER]/Sites/[MODULE]/lib/CVS/Entries
    at smartcvs.JP.a(SourceFile:125)
    at smartcvs.JP.a(SourceFile:113)
    We've noticed that if we open up a get info window on the directory we're downloading, and choose "Apply to enclosed items" right when we start the download process, the issue will be resolved, presumably because the permissions are being set on the subdirectories as the download is taking place.
    We've checked the permissions on the overall ~/Sites/ directory numerous times, and they always seem to be set correctly as drwxr-xr-x. It's within this folder that CVS creates a directory with the CVS module name and downloads all the contained files, so we don't see why it would be having issues completing this successfully. We also checked to ensure the GUI CVS application is running under the current user on the machine: it does.
    Has anyone run into issues like this in the past? Is there more information I could provide to further clarify the problem we're having?
    Thanks for any input you have!

    Thanks for asking Jeff, yes one place we are seeing this error is Java application SmartCVS, though the results posted here are from a normal command line CVS checkout.
    ===
    Checkout command:
    cvs co [MODULE]
    ===
    Error:
    cvs [checkout aborted]: cannot rename file CVS/Entries.Backup to CVS/Entries: No such file or directory
    ===
    ID:
    uid=502([USER]) gid=502([USER]) groups=502([USER]), 81(appserveradm), 79(appserverusr), 80(admin)
    ===
    LS -ALN
    Computer:~/Sites [USER]$ ls -aln
    drwxr-xr-x 28 502 502 952 Jun 4 13:11 Sites
    Computer:~/Sites/[MODULE] [USER]$ ls -aln
    drwxr-xr-x 38 502 502 1292 Jun 4 13:33 www_root
    Computer:~/Sites/[MODULE]/www_root [USER]$ ls -aln
    drwxr-xr-x 32 502 502 1088 Jun 4 13:33 [SUBDIR1]
    Computer:~/Sites/[MODULE]/www_root/[SUBDIR1] [USER]$ ls -aln
    drwxr-xr-x 5 502 502 170 Jun 4 13:33 [SUBDIR2]
    Computer:~/Sites/[MODULE]/www_root/[SUBDIR1]/[SUBDIR2] [USER]$ ls -aln
    drwxr-xr-x 4 502 502 136 Jun 4 13:33 [SUBDIR3]
    Computer:~/Sites/[MODULE]/www_root/[SUBDIR1]/[SUBDIR2]/[SUBDIR3] [USER]$ ls -aln
    drwxr-xr-x 6 502 502 204 Jun 4 13:33 CVS
    Computer:~/Sites/[MODULE]/www_root/[SUBDIR1]/[SUBDIR2]/[SUBDIR3]/CVS [USER]$ ls -aln
    total 32
    drwxr-xr-x 6 502 502 204 Jun 4 13:33 .
    drwxr-xr-x 4 502 502 136 Jun 4 13:33 ..
    -rw-r--r-- 1 502 502 45 Jun 4 13:33 Entries
    -rw-r--r-- 1 502 502 45 Jun 4 13:33 Entries.Log
    -rw-r--r-- 1 502 502 48 Jun 4 13:33 Repository
    -rw-r--r-- 1 502 502 63 Jun 4 13:33 Root
    MacBook Pro / MacPro Mac OS X (10.4.9)

  • Slow Broadband 250K throughput, line continually d...

    I joined BT in October 2010, I left Sky because my broadband speed was really good then one month they dropped the speed, no notice or apologies. I joined BT as I thought they would be able to provide a fast, quality and reliable service; this has not been my experience so far.
    Summary
    Problems since joining in October 2010, 6 months on still not fixed.
    Line throughput is configured to 250kbps, Profile is configured to 3776kbps.
    Current download speed is 0.12mbps, this is my average download speed.
    Line drops every 4-5 days, profile is reconfigured then drops again.
    4 failed BT Broadband engineer visits (engineers did not turn up).
    Card changed on the switch twice.
    If there is anyone from BT who cares about their customers please contact me to try and resolve.
    Line state
    Connected
    Connection time 0 days, 6:35:39
    Downstream 3,776 Kbps
    Upstream 448 Kbps
    ADSL settings
    VPI/VCI
    0/38
    Type PPPoA
    Modulation ITU-T G.992.1
    Latency type Interleaved
    Noise margin (Down/Up) 14.9 dB / 22.0 dB
    Line attenuation (Down/Up) 43.0 dB / 28.5 dB
    Output power (Down/Up) 18.9 dBm / 12.0 dBm
    Loss of Framing (Local) 156
    Loss of Signal (Local) 2266
    Loss of Power (Local) 0
    FEC Errors (Down/Up) 16124 / 0
    CRC Errors (Down/Up) 8 / 2147480000
    HEC Errors (Down/Up) nil / 1
    Error Seconds (Local) 5460

    A complex broadband engineer attended my premises on Friday, he spent 2.5 hrs testing and could find nothing wrong with the internal wiring he dsaid I should be able to receive 4.7mb download with no problems. 4 hours after he left and my router threw a wobbly, continually rebooting with the amber and red light on occasions. Surprise, surprise the speed returned to the usual poor speed of 0.12mbps download.
    I have run BT Speedtester tonighht and it gets worse 67KBPS download, line profile now configured as 160kbps, see results below.

  • Calculating line length in Java

    Hi all;
    I've been using LineBreakMeasurer & AttributedString to measure line lengths. However, I now need to take into account:
    Small Caps
    Scaling (making each character thinner/wider).
    Spacing (adding/subtracting space after each character).
    Hyphenation, where line breaks can occur at specific places within words.
    Is there a way to do this using Java? The two fundamental things I need to get is:
    How long is a passed in string.
    For a passed in string and length, how many characters of the string fits in that length.
    I can do this using LineBreakMeasurer & AttributedString and calling it character by character. But is there a better way?
    thanks - dave

    Hi, Have you had a look at the FontMetrics class? That might be an option.

  • Problem with new-line-character and java.io.LineNumberReader under AIX

    Hi folks,
    I got the following problem: I wrote a little parser that reads in a plain-text, tabulator-separated, line-formatted logfile (and later on safes the data to a 2-dimensional Vector). This logfile was originally generated by an AIX ksh script, however, I copied it on my Windows machine to work with it (for I'm using a Java editor that runs under Win Systems).
    For any reason, Windows, and what is worse Java too, seems not to recognize correctly the new-line character (in the API it is written that this should be a newline '\n' or a carriage-return '\r' or one followed by the other) that marks the end of a line in the logfile.
    Also, when I'm opening the logfile with the "Notepad"-editor, this special character does not seem to be recognized, every line is inserted right after the other.
    On the other side, when I open the logfile with the built-in editor in the CMD-Shell ("Dos-shell"), the newline chars seem to be recognized correctly.
    But when start my parser on the AIX-machine the newline does not seem to be recognized correctly again.
    I tried to read in the logfile with MS-Excel and safe it as a plain-text, tabulator-separated, line-formatted logfile again, with such files my parser works fine both on the AIX as it does on Windows.
    Any ideas? Anybody got over the same problem already?
    Greetz FK

    Under windows, text files' lines are usually delimited by \r\n,
    under Unix/Linux/AIX etc. \n
    and under Mac \r.
    I recommend to use the following editors, which are capable to handle files with Unix and Windows-styled line-delimiters or convert between these types:
    Programmer's File Editor (PFE; available on Windows)
    The Nirvana Editor (http://www.nedit.org/; available on Unix, MAcOS, Windows)
    (BTW good old vim can handle that too. Transferring text files to windows in order to edit them, even using Excel for this purpose means your being a UNIX newbie, (I mean no offense by writing this) so vim is probably beyond your reach for the moment.)
    Java normally assumes the platform's line delimiters where it is running, so if you transferred the file from Unix to Windows might be distrurbing.

  • Replacing windows new line characters with JAVA

    I am importing a file into the database... the file is written by a client using windows, and it is a text file.
    When there is a windows new line character at the end of the line (^M), it is getting saved to the database as part of the string value.
    When we parse this data to run a report, the (^M) are being written back out to the file and causing the fields and data not to line up.
    We want to REPLACE the ^M with some other character (whatever it doesn't matter)... how can java do that???
    We tried replacing '/n' with '###' and it will show the ###, but the line still breaks.
    TIA,
    Tonya

    The characters in question are cr = \r = ascii(13) and lf = \n = ascii(10). Windows uses CrLf, Unix uses Lf and some systems use just Cr. You can use the String.replaceAll or the pattern matching classes to fix this up, see java.util.regex.Pattern, and java.util.regex.Matcher.

Maybe you are looking for

  • Portal runtime error while accessing BI Report as URL iView

    Hi All, I created an URL Iview with the URL of BI report, when i am trying to access it then getting portal runtime error. I had check the log it is showing the following details about the error, could you please help me out what is the root cause ba

  • Crashing on start up on MacBook Pro had no trouble...

    Crashing on start up on MacBook Pro had no trouble until 03-10-15 OS Version:            Mac OS X 10.10.2 (14C1510) Report Version:        11 Anonymous UUID:        FDA4D1C5-18C3-DF9C-CC74-768C8C114969 Time Awake Since Boot: 3400 seconds Crashed Thre

  • Time Capsule and Extreme on the same network with different roles

    I've just bought a new Time Capsule device which replaces my slightly older Airport Extreme Base Station. The TC is attached directly to my broadband modem via ethernet. This works fine. I want to use the old AEB as a 'print server', in other words a

  • Torch 9860 not starting

    My Blackberry Torch 9860 is dead. Red light at the top is giving long blip. It is trying to start but not able to complete the operation. Can anyone quickly help me with this problem?

  • HH3, Mario Kart online, Apple TV and Sony Internet...

    I'm reasonably techy and have tried many of the 'solutions' given to stop Mario Kart online dropping out (none of them worked) and now, I am scared of upgrading my TV to a Sony Internet TV or getting Apple TV since I think my HH3 would not work with