Breaking huge text into multiple parts.Please help..

Hi all..i'm urgently need any attention here..pliz help to solve this problem..
The description of my problem is like dis >> let say now i have 100 length of a text. Now , i need to break it into multiple parts, accordingly to the max lenght of a part for one time is 30.So, it should be to returned like dis >>
text [1]="blablabla.." -->text.length =30
text [2]="blablabla.." -->text.length =30
text [3]="blablabla.." -->text.length =30
text [4]="blablabla.." -->text.length =10
I have write a pieces of code that may explain what i try to do..but its not really work..i hope anybody out there can help me..thanks a lot..
code:
          for (int i=0; i<fullMsg.length(); i++){
               singlLen ++;
          if (singlLen == LEN-1){
                    System.out.print("splitMsg: i="+i+"\n");
                    System.out.print("splitting new msg["+msgCnt+"]="+fullMsg.substring(beginPos, i)+"\n");
                    msg[msgCnt] = fullMsg.substring(beginPos, i);
                    singlLen = 0;
                    msgCnt ++;
                    beginPos = i+1;
               }

     public static void main(String[] args) {
          String LONG = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
          int MAX_LEN = 30;
          ArrayList<String> strList = new ArrayList<String>();
          int i = 0;
          while (i < Math.floor(LONG.length() / MAX_LEN)) {
               strList.add(LONG.substring(i * MAX_LEN, MAX_LEN * (i + 1)));
               i++;
          // now get the remainder
          i--; // decrement it to get how many MAX_LEN chunks we have
          int remainder = LONG.length() % MAX_LEN;
          strList.add(LONG.substring(MAX_LEN * (i + 1), MAX_LEN * (i + 1)
                    + remainder));
          System.err.println(strList.toString());
     }I'm not sure if this is what you want... Say you have 75 chars in string.
Prepares an array with 3 strings,
first len 30,
second len 30,
last len 15
makes 75 in total

Similar Messages

  • Breaking up text into multiple fields

    The data in a field that I am reading contains something like
    this :
    Los Angeles, California 99999-0000
    What is the technique to break it up into three separate
    fields, so that a field name city would contain Los Angeles,
    a field name state would contain California, and a field
    named zip_code would contain 99999-0000 ?
    Thanks for any help.

    Is it possible to have each field separated by a comma? Space
    delimiters won't work since not all cities & states are one
    word (ie. New York, New York) however a comma delimiter would allow
    you to use simple list functions to extract the data.
    If this isn't possible but the data is always in the format:
    city<comma>state<space>zip, then you could extract the
    city using comma as the delimiter and then extract the zip code
    using the ListLast() function with space as the delimiter which
    would leave you with the state as the remaining text. This would
    only work however if your data is consistently in the format
    described above.
    Failing this you could build two tables with states and
    cities and then use them to identify valid states and cities and
    extract the data that way.
    cheers

  • It won't let me into I message. I type in my ID then I pick what people can text me by then I press next and it goes back to the sign in page so I tried it again and it just kept doing that so it won't let me into iMessage? Please help!

    It won't let me into I message. I type in my ID then I pick what people can text me by then I press next and it goes back to the sign in page so I tried it again and it just kept doing that so it won't let me into iMessage? Please help!

    Try:
    iOS: Troubleshooting FaceTime and iMessage activation

  • Splitting a string into multiple parts from particular position (string has no delimiter )

    Hello Gurus,
    I need to make string of having length 1000 into multiple parts from a particular position which has some text without any delimiter and i want to populate each part into an internal table which has one filed...
    eg : string = 'sap abap sap abap sap abap sap abap sap abap sap abap sap abap sap sap sap abap sap abap'
    suppose i want to start splitting from 40th position...assume that i have 3 parts
    and these 3 parts i have put into an internal table..
    lt_itab = [sap abap sap abap sap abap sap abap,
                  sap abap sap abap sap abap sap abap,
                   sap abap sap sap sap abap sap abap]
    plese help!
    any help would be Appreciated ...thank you

    Hi,
    Try this code.
    TYPES: BEGIN OF ty,
            b TYPE string,
            END OF ty,
            tt TYPE STANDARD TABLE OF ty.
    DATA: a TYPE string VALUE 'aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll',
           tb TYPE tt,
           wa TYPE ty,
           off TYPE i,
           len TYPE i,
           count TYPE i,
           count1 TYPE i,
           temp TYPE i.
    len = 8.                      "Position
    off = 0.
    count = strlen( a ).
    count1 = count / 8.
    temp = len - 1.
    DO count1 times.
      temp = off + len.
      IF temp > count.
       wa-b = a+off.
      ELSE.
       wa-b = a+off(len).
      ENDIF.
      off = off + len.
      SHIFT wa-b LEFT DELETING LEADING space.
      APPEND wa to tb.
    ENDDO.
    LOOP AT  tb INTO wa.
    write: / wa-b.
    ENDLOOP.

  • Breaking a pdf into multiple pdf's

    I have a 250 page pdf.  each page represents a departments information.  Is there a way to break apart that pdf into single pdf's but using part of the file to name the pdf?
    for example, if the first report has a title that contains department 123, I could extract that page and name it department 123.
    The only want I know how to break a pdf into multiple pages is to use the document / extract pages and select Extract pages as seperate files.  But when I do this it uses the name of the exiting file and adds a number to it.

    You will have to select a subforum, e.g. Creating, Editing & Exporting PDFs, or Acrobat SDK (since you probably need to write the functionality you want by yourself).

  • HT202159 Tried restarting download from the "Purchases" tab but the app comes out with "an error ocurred " message and I the button next to it is grey without any text or action. Please help, cannot dowload bad piggies game

    Tried restarting download from the "Purchases" tab but the app comes out with "an error ocurred " message and I the button next to it is grey without any text or action. Please help, cannot dowload bad piggies game

    Hi aaronvilla,
    Sorry to hear you are having issues with your iTunes Store purchase.   The following information should help you with this:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    To report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase, follow these steps:
    Find the email receipt for your purchase.
    Click Report a Problem under the app that is having the issue.
    When prompted, enter the Apple ID and password you used to purchase the item, then click Report a Problem.
    Click Report a Problem next to the item you are having an issue with.
    From the Choose Problem dropdown menu, choose the appropriate issue.
    Follow the onscreen instructions and—if prompted—type a description of the problem into the text field.
    Click Submit to have your issue reviewed.
    Hope this helps ....
    - Judy

  • Hello i am rajesh i am having problem while conveting other files into pdf format please help me

    i am rajesh i am having problem while converting other files into acrobat format please help me

    Hello Rajesh,
    I'm sorry to hear you're having trouble. Are you using Acrobat.com to convert your files to PDF? Please let me know where you are having trouble and I will do my best to help you convert your files. For your reference, here is a list of filetypes that can be converted to PDF online with Acrobat.com:
    http://kb2.adobe.com/cps/524/cpsid_52456.html#Create%20PDF
    Best,
    Rebecca

  • HOW TO - Create new from clipboard and process multiple files - please help

    Need help - have new version of photoshop on trial only ATM...
    Want to know - HOW TO:
    1. Create new from clipbaord
    2. Process multiple files
    Please help.

    For clipboard copy, I start with File > New and the size will be set to what's in the clipboard. Then once the new file is opened, Edit > Paste will place the clipboard contents as a layer in the new document.
    You must remember to use the command Layer > Flatten Image of you want to save as jpeg or any other file format that doesn't support layers.
    For processing multiple files,
    File > Automate > Batch or
    File > Scripts > Image Processor...
    Check the User guide or google information for those commands if you have specific needs.
    Gene

  • In Pages, the column in the table won't flow onto the second page. The text is hidden. Please help!

    In Pages, the column in the table won't flow onto the second page. The text is hidden. Please help!

    Thank you for your reply,
    When I click 'view' , I can "show inspector". From the table tab, I can pull up the "Format". [See below]. I don't see the "Arrange" or "Object Placement Move with Text"
    Right now I have the Wrap Text On. When I take it off, It messes up my rows [see second image].
    All I want is for my column to flow onto the second page.
    Your assistance is genuinely appreciated.
    Thank you again.

  • I have iOS 6 on my iPhone. i have linked my contacts with facebook and yahoo, which has doubled or triplicated some of the contacts. how can i integrate them into one? please help. it is getting on my nerves. thanks :)

    I have iOS 6 on my iPhone. i have linked my contacts with facebook and yahoo, which has doubled or triplicated some of the contacts. how can i integrate them into one? please help. it is getting on my nerves. thanks

    click on the contact which you want to integrate, click the edit button scroll down u will find a option called link contacts use it to link it to the duplicate contact

  • TS3406 I have a connection in the top left hand corner and can access the internet with and without internet on my iphone 5c but I can't receive and create texts and calls, someone please help have tried everything!

    I have a connection in the top left hand corner and can access the internet with and without internet on my iphone 5c but I can't receive and create texts and calls, someone please help have tried everything!

    YOu will need to contact your cell phone provider to resolve those issue, those are carrier features.

  • HT6030 Since I did the update, my mail-programm doesn't work no more. So I cannot send any eMail out or change the text into the eMail. Help, this is a catastrophe!!! Lukas Schmid

    Since I did the Mavericks-update, my mail-programm doesn't work no more. So I cannot send any eMail out or change the text into the eMail. Help, this is a catastrophe!!! Lukas Schmid

    Hey Lukas Schmid,
    The following resource may provide more help in troubleshooting Mail for OS X:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/TS3276
    For more information, you can also visit http://www.apple.com/support/mail/
    Thanks,
    Matt M.

  • Urgent: How to break 1 Row into Multiple Rows

    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product Sub Product Name Age
    New Car Nissan Tom 49
    New Car Nissan Jack 36
    Old Car Audi Sam 24
    Old Car Jaguar Pint 26
    Old Car Audi Smith 41
    I need to be able to fetch the above data in the below fashion
    Product Sub Product Name Age
    New Car
    Nissan
    Tom 49
    Jack 36
    Old Car
    Audi
    Sam 24
    Smith 41
    Jaguar Pint 26
    Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • Error when splitting a Table into two columns - Please help!

    Hi!
    I have created a table in which I have created a header which has been split into 3 parts conisting of 2 columns. These all work fine. However, when I try to split the row below the header row into 2 columns, it does so but, in a way, connects the line inbetween the two columns with the line inbetween the two columns above and will not allow me to move it left or right by manually changing specs or dragging the line. Please help! (I'm using CS5 by the way!) Thank you!

    I suggest you begin with a pre-built CSS Layout.  DW has several to help jump start your projects.  Go to File > New Blank Page > HTML.  Select a layout from the 3rd panel and hit CREATE.  See screenshot.
    Save this layout as test.html and begin building your prototype page saving and validating code often during your work sessions.
    Code Validation Tools
    CSS - http://jigsaw.w3.org/css-validator/
    HTML - http://validator.w3.org/
    Good luck with your project!
    Nancy O.

  • Breaking up audiobooks into multiple tracks

    I bought an audiobook from itunes that came as only 5 tracks. The book is 11 hours long and it would be really nice to be able to start closer to where I left off on my ipod. does anyone know how to edit mp4s to break them into multiple tracks?

    Is it possible to have each field separated by a comma? Space
    delimiters won't work since not all cities & states are one
    word (ie. New York, New York) however a comma delimiter would allow
    you to use simple list functions to extract the data.
    If this isn't possible but the data is always in the format:
    city<comma>state<space>zip, then you could extract the
    city using comma as the delimiter and then extract the zip code
    using the ListLast() function with space as the delimiter which
    would leave you with the state as the remaining text. This would
    only work however if your data is consistently in the format
    described above.
    Failing this you could build two tables with states and
    cities and then use them to identify valid states and cities and
    extract the data that way.
    cheers

Maybe you are looking for

  • BPC 10.0 NW - Black data cells

    Hello experts, we experienced quite a strange behaviour of our BPC webreports. Some of our reports show black data cells (see screenshot below). The same reports executed in BPC for Excel look perfect. [Screenshot|http://img131.imagevenue.com/img.php

  • !!URGENT!! how to detect HTML link click in JTextPane??

    I'm using JTextPane to display HTML file. Now I want to detect event when user click on a hyper link in that HTML file. So that I can open a new window for use to save it or something else. How can I do that?? Please help!!!

  • Same RFQ for two Vendors.

    Dear Experts, I have created a RFQ and in the vendor adress i have given the vendor Number.Now if i want the same RFQ to be sent to two  vendors then how can i do it. Kind Regards Sajid

  • About update statement in procedure

    I have one table usersubscription (userid,newsletterid,deleted) I got one string from user e.g. ('1,2,3') and userid = 14 I wrote proceduer that will insert this records in to usersubscription table; userid newsletterid deleted 14 1 n 14 2 n 14 3 n d

  • Object Project Definition could not be created

    Hi Experts, I am facing some trouble with multilevel controlling integration. Whenever I transfer a project I am getting the following error in cProjects: Costing data may not be up-to-date  Display Help Error occurred in accounting - see controlling