How to break up a String into multiple array Strings?

How do I break up a string into a bunch of String arrays after the line ends.
For example,
JTextArea area = new JTextArea();
this is a string that i have entered in the area declared above
now here is another sting that is in the same string/text area
this is all being placed in one text field
Sting input = area.getText();
now how do I break that up into an array of strings after each line ends?

Ok I tested it out and it works.
So for future refrence to those that come by the same problem I had:
To split up a string when using a textfield or textarea so that you can store seperate sections of the string based on sperate lines, using the following code:
String text = area.getText() ;
String[] lines = text.split("\n") ;
This will store the following
this is all one
entered string
into two arrays
Cheers{
Edited by: watwatacrazy on Oct 21, 2008 11:06 AM
Edited by: watwatacrazy on Oct 21, 2008 11:16 AM
Edited by: watwatacrazy on Oct 21, 2008 11:16 AM

Similar Messages

  • How to break the PDF file into images?

    How to break the PDF file into images? There should be settings in Photoshop CS 6 that imports PDF file and break it into images.  I have a short instruction:
    2.    Open the file in Photoshop.
    3.    A new window should open to Import PDF.  Click on images, not pages  import pdf into Photoshop.doc
    4.    Select all the files shown (shift + click), Click O.K.  Four files should open on your screen.
      Was anybody successful with that?

    Whether this is available solely depends on the structure of the PDF and whether it actually contains whole images that can be extracted separately. Depending on whatgoing on in the PDF this may simply not be the case and the images have been tiled and split up in multiple "objects" whose appearance can only be retained by rasrerizing the whole page...
    Mylenium

  • How do I separate a PDF into multiple PDFs using Adobe PDF Pack?

    How do I separate a pdf into multiple pdfs using AdobePack?
    [Title edited to reflect actual product name... Mod]

    I do not find "AdobePack" when I look at the list of forums https://forums.adobe.com/welcome
    What is the exact name of the program you are using... Acrobat, or are you using the online version at Acrobat.com?
    ADDED... found Adobe PDF Pack (read only) so will move this message

  • "Save as PDF" breaks up the document into multiple PDFs

    Ever since my Lion install, when I open a doc in MSWord and try to "Save as PDF", it breaks up the document into multiple PDFs, not one saved PDF. Haven't seen this problem before. Anyone else experiencing this new "feature"?

    What version of Word?  It's working fine with my Word 2011 on Lion.  (version 14.1.2.  Applied SP1 and the .2 update.)
    A workaround would be to print, then select the PDF dropdown in the lower corner of the print window.
    Otherwise, you'll probably want to ask in the Microsoft forums, as Save As is using Word's programming code, not OSX's code like it does with the print function.

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • How to insert one table data into multiple tables by using procedure?

    How to insert one table data into multiple tables by using procedure?

    Below is the simple procedure. Try the below
    CREATE OR REPLACE PROCEDURE test_proc
    AS
    BEGIN
    INSERT ALL
      INTO emp_test1
      INTO emp_test2
      SELECT * FROM emp;
    END;
    If you want more examples you can refer below link
    multi-table inserts in oracle 9i
    Message was edited by: 000000

  • How to Split Single Outbound Idoc into Multiples

    Hi guys
    Hope you all are doing good.
    Can you please let me know , How to Split Single Outbound IDOC into multiples.
    I am looking for some sought of configuration in IDOC/from SHIPMENT Configuration level.  Because this needs to be implemented for Shipment IDOCS.  Please let me know if this can be done through configurations apart from implementing  User exit or copying the outbound shipment function module.
    Awaiting for your valuable replies.
    Best Regards
    Shiva

    Hello,
    1. Routes
    2. Packaging used
    3. Shipment Type
    Regards
    Waza

  • ALV grid - how to break a long string into several lines?

    I have a ALV grid, where one of the fields contains a textstring that is typically 100 characters long.
    Is it possible to break this long string into shorter strings on multiple rows?
    Kind of like in Excel, when using row break...

    Thats not possible in ALV

  • Breaking a Program Execution into Multiple Threads

    Hi,
    We want to run a BAPI with Differenet parameters synchronoulsy in the same program as the BAPI is taking a very lon time for execution.
    We are Planning to break up the execution and the call o the BAPI into multiple threads that can run synchronously. How can this concept implemented in SAP ABAP.
    Thanks in advance.
    Arunava

    I am using parallel processing in my current client. Basis define a dialog processes group that we can use. This way our program will be limited to the number of processing give in the group. For example, our production system has 5 servers and each servers has 15 dialog processes. Basis reserve in the group 5 dialog processes for each group. So when we run our program, we are limited to 25 processes. We use function module SPT_INITIALIZE to find out the number of dialog processes and free processes for our group.
    The logic of the program as follow:
    Do loop
        Call function module with starting new task and destination in group performing end of task subroutine
    Enddo
    Wait until all task completed (check help on wait-you need to keep track of the number of record completed)
    In end of task subroutine, use command receive results from function to get the return parameters.
    Hope this helps.
    Cheers

  • Breaking up one project into multiple projects

    I have a question that I hope can be answered (Using Captivate 5.5).
    I have a seemingly large project now (433 slides with no quizzes added at this point) that is broken down as follows:
    There are 9 chapters.  The first is a quick "how to" which has a menu that links to the 8 chapters.  All the chapters are accessed by the "jump to page" link with buttons i created at the top, a home button that links back to the main menu buttons, and each chapter contains 4 sub-chapters.
    When this whole deal started, I was told it would just be a run through start to finish in one day with a quiz at the end, but now I am told they like the individual chapters so much that they want chapters with their own quiz and summary and they want it to be able to be "bookmarked" so that they can work at it in half hour sections over the course of a few days. 
    The down side is I'm pretty much done the whole thing as one project file.  I have looked into how to break it up, or how to just have various quizzes (more importantly quiz summary for each chapter that stops the user from proceeding to the next chapter until complete) within one project but its clear that I need to break it up and have 9 .exe files (.exe being the requested format) in the end all linked to one another.  The problem I have is that I have no idea how to go about this. 
    Anyone with any ideas for me?  Please?
    Thank you once again!

    Thanks Anjaneai,
    This was pretty much much idea as well and I think it makes the most sense. 
    There is really only one page in each module that links back to the main page so it shouldn't take too long to implement.
    The only question I have is with something like this where I will essentially have a breakdown of one "main" exe that links to the 8 other chapters, how do I go about saving these?  Is there something that I need to do (ie file structure or a certain click box during the export)?  Do I just export/publish each of them as their own exe and Captivate is smart enough to recognize this?
    Right now what my vision is of this is that I would publish all 9 exe's into one directory where the main exe is in the root and the other exe's are in their own directories so that when the file is sent, unzipped, it will only show the one exe to click on so it isn't confusing to the end users.   

  • 8500 adf scan Breaking a single page into multiple pages

    I have a 8500A Premium. Lately when I am scanning multiple sheets via the ADF, the scan will take each sheet and break it into multiple sheets on the scan.  i.e., if I am scanning 5 sheets, I may end up with 20 partial sheets in my scan. 

    Hello there @coolhandluke2 ,
    I read about the unusual scanning issue you are facing when you scan with your Officejet 8500A. I would suggest trying a multiple copy for starters to see the copies will also show irregularities.
    If the copies work fine, the issue is most likely within the software.
    Here are some steps to try!
    Power reset:
    Press the Power button to turn on the product.
    With the product turned on, disconnect the power cord from the rear of the product.
    Unplug the power cord from the wall outlet.
    Wait at least 15 seconds.
    Plug the power cord back into the wall outlet.
    Reconnect the power cord to the rear of the product.
    If the product does not turn on by itself, press the Power button to turn it on.
    Uninstalling the Printer Software, restarting the computer and reinstall the printer HP Officejet Pro 8500A Premium e-All-in-One Printer - A910n Drivers
    Let me know the results, good luck!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • How to split large video files into multiple individual clips by date

    Hello. I'm looking for a freeware/shareware program (if one exists, or willing to pay for one if it does this well) that will:
    1) Analyze a large AVI file identifying the start/start points of each segment of video and the dates the video segments were shot.
    2) Then allow me to organize (for example, join 2 or more segments together if it's a video with a lot of start/stop points during the same shot) the segments identified in step 1 into logical clips that could be split apart from the 1 large AVI file.
    3) Lastly, it would split my one large AVI file into the multiple clips or files that I identified in step 2.
    A piece of software called FootTrack does a great job analyzing AVI files as I describe in steps 1 & 2, but it doesn't allow you to split or export the one avi file into multiple avi files.
    I really don't want to have to do this one clip at a time, I've got to believe there's a program out there that will automate this process for me.
    Thanks

    I don't know of a way to automate it. I just did about 15 years worth. It wasn't too hard. I use an application called mpegstreamclip. Its very easy and free to download either from the apple site or direct from its site.
    http://www.squared5.com/
    Bascically you set the in and out points with the i and o keys and export.

  • How to break the name column into first,middle,last

    hi,
    Having a column in a table called employee_name which is
    containing the names of employees like:-
    employee_name
    Syed Azhar Husain
    Also having another table having cloumns first_name,middle_name, last_name
    I just want to write the query that break my employee_name column into
    first name, middle name, last name and
    store into table columns first_name, middle_name, last_name respectively
    i.e. it should display like
    first_name middle_name last_name
    Syed Azhar husain
    I am using oracle9i database.
    Thanks in advance
    Azhar

    Dear Asuri,
    Thanks for quick reply,
    your query was working fine when there was one record into the table but when there was more then one record into the table it was giving error "ORA-01427: single-row subquery returns more than one row". So i did small modification in the query as below
    SELECT SUBSTR(' ' || name || ' ', INSTR(' ' || name || ' ' , ' ', 1, rn) +1,
    INSTR(' ' || name || ' ' , ' ', 1, rn + 1) - INSTR(' ' || name || ' ' , ' ', 1, rn) -1) name
    FROM test , (SELECT ROWNUM rn FROM all_objects
    WHERE ROWNUM <= ( SELECT distinct(LENGTH(name) - (LENGTH(REPLACE(name, ' ')))) / LENGTH(' ') + 1
    FROM test ))
    order by name
    so above query is working fine with more than one record but there is another problem as i am explaining blow
    Suppose there is table called "test" as follows
    SQL> select * from test;
    NAME
    Rajendra kumar jain
    syed azhar husain
    Chander Shekhar Kumar
    when i am putting above query it is giving result as follows
    NAME
    Chander
    Kumar
    Rajendra
    Shekhar
    azhar
    husain
    jain
    kumar
    syed
    my requirement is that for complete full name like 'syed azhar husain' it should give
    name
    fist name : syed
    middle name: azhar
    last name: husain
    first name: rejendra
    middle name: kumar
    last name: jain
    first name: chander
    middle name: shekhar
    last name: kumar

  • How do I convert an Object into an Array?

    If I have an instance of type object that I know is really a DataGrid row that was cast into an object when passed to a function, how can I cast that Object to an array, such that each index of this array would correspond to the information in a given column of the row?

    @Sathyamoorthi
    Can you please explain what this function does? Essentially, what should be contained in the String?
    I printed out the string and it seems like I am getting a random row in the Object, as opposed to first or last. Why is that?
    UPDATE: I printed out the value of dataGrid0.columns[5].dataField but it just turned out to be the id of the column.

  • How to restore this kinda XML into an array or list?

    I have a XML file like this
    [msgboard]
    [message]
    [subject] subject [/subject]
    [body] text body [/body]
    [followups]
        [message]
            [subject] subject [/subject]
            [body] text body [/body]
            [followups]
                       [message] ...
            [/followups]
        [/message]
    [followups]
    [/message]
    [/msgboard]so the XML can be unlimited deap.
    I want to read it into an array or list or something like that, so I can use the data.. but how should I store them? any ideas ? thanks

    Please refrain from cross posting http://forum.java.sun.com/thread.jspa?threadID=785000

Maybe you are looking for