How to devide a string in the particular format

hi friends
my problem is that i have a string line having 150 character. i have to devide that string line by 70+70+10 character in such a way that the last word in the each line should be at single location. e.g
this is a dummy line of string and the characters in this line are important
suppose this is first line the 70 characerrs completes at impporant "imp" so is should keep this word together is the word length grater than 5 or 6 character then whole character should come in next line begining.
so friends please suggest me the logic to implement that. string of line may contain any of words with or without space.
the string is dynamic.
thanks in advance.

i have a string having 150 character i want to devide that string in three line first lien may contain 70 character second line also caontain 70 char and third line may contain 10 characters. but at the last word of the line should not be devided. if the last word length is 5 of 6 than the first line may have 75 or 76 character id the last word length is higher than 5 or 6 than the last word should be at initial word of second line and the forst line may have some less characters and so on for second and third line.
for example
suppose this is the some exaple of line is contains 77 characters
"this is a dummy line of strings and the characters in this line are important"
the 70 character complete in ""this is a dummy line of strings and the characters in this line are im"
but the last word is devided in two parts it should not be there. if length of the last char is 5 or 6 beyond 70 char then the word should be in the first line
so frirst line should be
"this is a dummy line of strings and the characters in this line are" and "important" word should come at second line.

Similar Messages

  • How to search a string from the database?

    how to search a string from the database? starting with some character

    If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
    Here's an Example
      SELECT obj_name FROM tadir
        INTO prog
        WHERE pgmid = 'R3TR'
          AND object = 'PROG'
          AND obj_name LIKE 'Z%'.
    In this case it will select every row that obj_name starts with Z. 
    If you wanted to find every row that the field obj_name contains say... 'WIN'  you use LIKE '%WIN%'.
    Edited by: Paul Chapman on Apr 22, 2008 12:32 PM

  • Match the string for a particular format

    i want to chek the string for a particular format..
    lets say for ex ,
    i have to check the string for 6A1N format where A - Alphabets and N - Numbers.
    that means my string exactly contains 6 alphabets from a to z and one number from 0 to 9
    like this i want to check for two more fromats..they are..
    2A7N1A or
    9N1A

    koneru9999 wrote:
    will the pattern is helpful in my case?
    and i don't have any idea doesn't mean finsh reading all the API right?You need to study http://www.regular-expressions.info/ and then http://java.sun.com/docs/books/tutorial/essential/regex/ .

  • How can I convert string to the record store with multiple records in it?

    Hi Everyone,
    How can I convert the string to the record store, with multiple records? I mean I have a string like as below:
    "SecA: [Y,Y,Y,N][good,good,bad,bad] SecB: [Y,Y,N][good,good,cant say] SecC: [Y,N][true,false]"
    now I want to create a record store with three records in it for each i.e. SecA, SecB, SecC. So that I can retrieve them easily using enumerateRecord.
    Please guide me and give me some links or suggestions to achieve the above thing.
    Best Regards

    Hi,
    I'd not use multiple records for this case. Managing more records needs more and redundant effort.
    Just use single record. Create ByteArrayOutputStream->DataOutputStream and put multiple strings via writeUTF() (plus any other data like number of records at the beginning...), then save the byte array to the record...
    It's easier, it's faster (runtime), it's better manageable...
    Rada

  • How to insert a String at the CaretPosition without moving the Caret?

    I have a JTextPane wrapped by a JScrollPane. The JTextPane is where chatroom messages appear. When a message is appended at the end, it determines whether to scroll to the bottom based on some conditions (scroll to the bottom only if the user was already viewing somewhere near the bottom). That part is working fine.
    Although the JTextPane is not editable, it allows the user to make selections using a mouse so that blocks of text can be copied from the chatroom. The default caret of JTextPane handles that for me.
    But the problem comes when the caret position is at the end of the document when my program inserts a new message with the following code:
    StyledDocument doc = textPane.getStyledDocument();
    doc.insertString(doc.getLength(), message + "\n", null);The caret was at doc.getLength() to begin with, when the new message is inserted at the end, it "pushes" the caret to a new position. The caret movement is causing JScrollPane to scroll to where the caret is visible (the bottom), therefore interfering with my scrolling algorithm (see above).
    So, when the caret is doc.getLength(), how do I insert a String at doc.getLength() with the caret staying at the original position?
    In other words, how do I insert a String at the caret position without the caret being moved?
    Note:
    1) I don't want to use setCaretPosition() to set the caret to its original position, because calling this method will trigger a CaretEvent, thus causing the JScrollPane to scroll (to the caret) which is not what I want (see above).
    2) I don't want to remove the CaretListener, cause then the JScrollPane won't scroll even when the user wants to make a multiple-page selection using the mouse (dragging the selection off screen).
    3) I want to keep the Caret at the original position so that the user won't lose his/her selection when new messages appear (which can be quite frequent).

    I keep forgetting how difficult it is to do such simple things in the text package. But it's not impossible! Here's a way to replace the relevant listeners, plus a sample implementation. If you know you'll never, ever delete any text from the JTextPane, you may not have to provide a replacement DocumentListener at all; this one just makes sure the caret isn't past the end of the document.
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.text.DefaultCaret;
    import javax.swing.text.Document;
    import javax.swing.text.JTextComponent;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    public class ChatCaret extends DefaultCaret
      private MyHandler newHandler;
      private PropertyChangeListener oldHandler;
      public void install(JTextComponent c)
        super.install(c);
        PropertyChangeListener[] pcls = c.getPropertyChangeListeners();
        for (int i = 0; i < pcls.length; i++)
          if (pcls.getClass().getName().equals(
    "javax.swing.text.DefaultCaret$Handler"))
    oldHandler = pcls[i];
    newHandler = new MyHandler(oldHandler);
    c.removePropertyChangeListener(oldHandler);
    c.addPropertyChangeListener(newHandler);
    break;
    Document doc = c.getDocument();
    if (doc != null)
    doc.removeDocumentListener((DocumentListener)oldHandler);
    doc.addDocumentListener(newHandler);
    public void deinstall(JTextComponent c)
    super.deinstall(c);
    c.removePropertyChangeListener(newHandler);
    Document doc = c.getDocument();
    if (doc != null)
    doc.removeDocumentListener(newHandler);
    class MyHandler implements PropertyChangeListener, DocumentListener
    private PropertyChangeListener oldHandler;
    MyHandler(PropertyChangeListener oldHandler)
    this.oldHandler = oldHandler;
    public void propertyChange(PropertyChangeEvent evt)
    Object oldValue = evt.getOldValue();
    Object newValue = evt.getNewValue();
    if ((oldValue instanceof Document) ||
    (newValue instanceof Document))
    setDot(0);
    if (oldValue != null)
    ((Document)oldValue).removeDocumentListener(this);
    if (newValue != null)
    ((Document)newValue).addDocumentListener(this);
    else
    oldHandler.propertyChange(evt);
    public void removeUpdate(DocumentEvent evt)
    int length = getComponent().getDocument().getLength();
    if (length < getDot())
    setDot(length);
    public void insertUpdate(DocumentEvent evt) { }
    public void changedUpdate(DocumentEvent evt) { }

  • How to downlad a string to the Presentation server

    Hi all
    How we can download a string to the presentation server <b>without</b> converting it to  the internal table.
    Am having a XML data as string. I want to bring that to the presentation server without converting it to internal table.
    I have tried that by converting to table and downloaded the same as BIN file ......since we are disturbing the string while converting to  itab am getting error while executing that XML file.
    <b>Error as shown below.
    Multiple colons are not allowed in a name. Error processing resource 'file:///D:/XXXXX.xml'. Line 705, Position 588
    </w:fldData></w:fldChar></w:r><aml:annotation aml:id="3" w:type="Word.Bookmark.Start" w:name="Text9"/&g...</b>
    Kindly help me in this regards.
    Thanks in advance
    Meikandan

    us the following code to convert the xml to itab which can then be use with gui_download with file type 'BIN'
    data: coutput type string ,
          xl_content type xstring ,
           binary_content     type solix_tab .
    call transformation (`ID`)
                  source flights   = flights[]
                  result xml output.
        clear: xl_content .
    *      xl_content = output .
        call function 'SCMS_STRING_TO_XSTRING'
          exporting
            text           = output
    *   MIMETYPE       = ' '
    *   ENCODING       =
         importing
           buffer         = xl_content
         exceptions
           failed         = 1
           others         = 2
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        refresh binary_content .
        call function 'SCMS_XSTRING_TO_BINARY'
          exporting
            buffer     = xl_content
          tables
            binary_tab = binary_content.
    Regards
    Raja

  • How to add a string at the End of TLFTextField without loosing current text format!

    I have a TLFTextField that loads text from external text file.
    Then a function changes the format of some parts.
    Then as soon as I add a string at the end of my TLFTextField, All previous formatting is lost!
    I use this code to add string:
    myTLF.text += "." ;
    or
    myTLFText.text = myTLFText.text.concat(".");
    Should I use another method??

    pass the text through your formatting function again, or try appendText:
    myTLF.appendText(".") ;

  • How to disable u201Csticky sessionu201D for the particular web application?

    Hi All,
    Is there a possibility to disable so called u201Csticky sessionu201D for the particular web application? We have deployed a WAR file with the Axis 1.4 based web service into SAP NW 7.1. The web service works fine but when the client makes SOAP request the server creates a so-called u201Cstickyu201D HTTP session with the default (30 minutes) timeout. Such u201Csessionsu201D are created on each SOAP request from the same client. The maximum number for Java Web Sessions (SAP Management Console) is 1000. After a while the clients start getting the u201C503 Service not availableu201D errors:
    503 Service not available.
    Error: -6
    Version: 7010
    Component: ICM Java
    Date/Time: Tue Mar 03 14:30:12 2009 
    Module: http_j2ee2.c
    Line: 1166
    Server: XXXXXXXXXXX
    Error Tag:
    Detail: server overload: no more sessions available
    The only way to improve the situation we found so far was to set session timeout to 1 minute. That u201Csticky sessionu201D will still be created, though.
    This is a testing environment and we do not use any hardware/software loadbalancer. 
    Any help/advice is appreciated. (Please let me know if you need more information.)
    Thanks,
    Dmitry Vasilenko

    The practical workaround we finally come up with for this problem was to create a servlet filter and map it to the AxisServlet. The servlet filter will invalidate the HTTP session and effectively destroy the sticky session created by the server on each SOAP request.
    Here is the fragment from the web.xml
    <filter>
      <filter-name>StickySessionFilter</filter-name>
      <filter-class>com.xxxxx.xxxxx.xxxx.services.StickySessionFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name> StickySessionFilter </filter-name>
      <servlet-name>AxisServlet</servlet-name>
    </filter-mapping>
    <servlet>
      <servlet-name>AxisServlet</servlet-name>
      <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
    </servlet>
    The doFilter() method looks like this:
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
           try {
                  chain.doFilter(request, response);
           } finally {
                         javax.servlet.http.HttpServletRequest httpRequest = (javax.servlet.http.HttpServletRequest)request;
                         javax.servlet.http.HttpSession session = httpRequest.getSession();
                         session.invalidate();
    Thanks,
    Dmitry Vasilenko

  • How to Save Pdf file in a particular format

    Hi Experts,
                        Can anybody tell me how to save a pdf file in a particular format,My requirement is i have a print button in webdynpro ,when ever user clicks on print ,adobe form is opened ,if user clicks on save .Form is saving with adobe form name .My requirement is it should be saved as ID NO.Date.Pdf  form lets Id is 0456 ,form should be saved as 0456.040614.pdf format, Thanks in Advance
    Regards
    Sandesh

    Hi Sandesh,
    Please provide the complete code from print & save button.
    Thanks & Regards,
    Balamurugan G

  • How to convert binary file to a particular format?

    Hi,
    I am having a requirement. I have in database various kinds of files stored as binary format. Its a sybase database. Now the files can be .pdf, or .doc also. But they are stored in binary format.
    I need to read the file from database.
    Now I can use jdbc to read the particular column value which contains the file in binary format.
    But tricky part is how to convert the binary file entry in a proper respective file format? So I have another column which basically has the value to tell the type of file. So I have ".doc" or ".pdf" as each entry of file...
    So please help me how can we do this using Java?
    THanks

    Hi,
    I am having a requirement. I have in database various
    kinds of files stored as binary format. Its a sybase
    database. Now the files can be .pdf, or .doc also.
    But they are stored in binary format.
    I need to read the file from database.
    Now I can use jdbc to read the particular column
    value which contains the file in binary format.
    But tricky part is how to convert the binary file
    entry in a proper respective file format? So I have
    another column which basically has the value to tell
    the type of file. So I have ".doc" or ".pdf" as each
    entry of file...
    So please help me how can we do this using Java?
    THanks

  • How can I change dates to the UK format, DD/MM/YY, in Mac Numbers?

    How can I change dates in Mac Numbers to the UK format of DD/MM/YY? When I correct them individually they automatically return to the US format.

    Open System Preferences, then click the "Languages & Region" pane in the first row.
    Change the Region from "United States" to "United Kingdom"

  • How to burn a cd in the AAIF format

    I burned a cd in the .MP3 format and it will not play in some older cd palyers. I understand that if I burn the cd in .AAIF format it should play on all cd players (old & new). Can I do this in Itunes, if so.....how?
    Thanks

    What you need to make is what is called an audio format CD (sorry, these all say iTunes for Mac but I suspect the instructions are similar for Windows):
    iTunes 10 for Mac: Create your own audio CDs - http://support.apple.com/kb/PH1747
    iTunes 10 for Mac: Disc burning overview - http://support.apple.com/kb/PH1746
    iTunes 10 for Mac: If you have trouble burning a CD - http://support.apple.com/kb/PH1751

  • How to create a file for the file format PDF/A?

    I want to create a file,which conform to the standard  PDF/A.
    when i use InDesign to create a pdf file and export it,i find the file format only support PDF/X,
    but i can't find any menu for PDF/A.
    who can help me?
    thank you !

    File>Print
    Choose Adobe PDF as your printer
    Go to Setup
    Go to preferences
    Choose the standard
    Make sure the rest of your settings are correct for the page size etc.
    It's a big screenshot so I've linked instead of posting here.
    Sorry had to blur out some PDF settings for privacy reasons
    http://img339.imageshack.us/img339/6103/37345539.png

  • HT3775 Can someone direct me as to how I check whether I have the media formats and codecs that QuickTime Player can play back using my Mac Pro?

    I'm trying to use quicktime on my macbook pro but I receive the message below when I make an attemp to use it.  Any suggestions?
    Media formats supported by QuickTime Player
    QuickTime Player natively supports the following media formats and codec components. You can also extend QuickTime to support additional codecs and components.
    Below are the media formats and codecs that QuickTime Player can play back in Mac OS X v10.6.x or later:

    More alternatives to Quicktime. VLC is recommended a lot.
    Video Player - Divx
    Video Player – Flip4Mac
    Video Player - VLC

  • How to make movies that have the same format as WS DVDs?

    What screen format do you use when creating a new project to have it look like store bought Wide Screen DVDs? Is it DV-NTSC Anamrophmoric 720x480, or should you go up to HDV 720/30? The final output will be to DVD and shown on a wide screen (16:9) monitor.
    It seems that the Anamrophic it not wide enought to look like wide screen and what is the deal with the project format and then the output format. I tried several variations and found a circle wipe that looks round on the FCP screen and exported using "Current Settings" it comes out oval?
    I found settings that look like they will work but would like to hear from someone who knows more than I.
    Thanks,

    All the footage is 4:3 DV which I will have to blow it up to fit 16:9.
    As I stated before the anamorphic format did not seem to be as wide as I had hoped for. When I tried anamorphic it looked like it was just doing letterbox with black on top and bottom not real wide screen.
    I guess I will just have to try out some short clips to see for myself.
    So when you choose DV Anamorphic for the project format then do you choose Current Settings when you export the file or custom?
    Thanks

Maybe you are looking for

  • Performance impact of Web Services

    As WebLogic adds support for Web Services to its platform, what is your plan for quantifying the performance impact and the functional correctness of using web services before going live with the final application. Empirix is hosting a free one hour

  • Ipod won't sync for the first time ever.  I am also seeing the cloud for the first time.  Help.

    Windows 7 operating system.  Ipod classic. Added new content tonight (audio book discs - have done dozens of times before).  Went to sync.  Nothing doing.  Tried two different cables.  Noticed that what I added was put in the cloud.  I had never seen

  • How to add a symbol in the table control

    Hi Experts, I have  created a Table control and want to insert a Symbol in a column and also want it to be interactive. That means when that symbol is being clicked it should perform some action. Your help is appreciated. This is a little urgent. ~Si

  • Labview 2009 I/O assistant issue

    Hi, I'm using labview 2009, and I can't get the I/O assistant to work-everytime I try to run it, it gives me the error message "Measurement & Automation Explorer or the Instrument I/O Assistant is not installed correctly. Please install these from La

  • Import MPEG-4 to Captivate v5.5

    I am using v5.5 and wonder if it is possible to import a video in MPEG-4 format into a v5.5 project. If this is possible, could you provide me with a simple explanation as to how to do this? Thank you in advance NOEL