Document to array conversion

Hi all,
i'm new to java and i would like to ask if there is some kind of command that would allow me to convert a document containing strings & numbers & characters(!,',-,=) into an array.
For example:
the file "test.txt" conatins the following text:
"Hello world. Today is 15-August."
I would an array to be created containing {"Hello" ,"world", ".", "Today", "is", "15", "-","August"}.
Is there such a command?
I know how to input text files, edit them and/or create text files using java but i all i need is that command for the conversion.
Cheers!

You can use the String.split method but this won't
give you the . and - as elements in the
array.
        String data = "Hello world. Today is 15-August.";
        String[] splitData = data.split("\\s+|(?<=[-.])|(?=[-.])");

Similar Messages

  • String to 2D string array conversion

    Hi,
    I have a string like this below. I would like to extract all the texts within the quotes "  ". How to do that?.
    05-Mar.20:52   skalyana    label type "BASELINE_1.2" (locked)
    28-Apr.19:19   skalyana    label type "BASELINE_1.8"
    i have tried using Match regular expression. I am able to extract one text within " ".
    I would like to know how to extract all the text within " "
    I have attached the vi for your reference
    Thanks
    Kalyan
    Attachments:
    string to 2D string array conversion.vi ‏19 KB

    Hi Jim,
    its simply superb...
    how to get more info on these 'Regular Expressions', is there any KB (knowledge base) or tutorial available for the same.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Required Document on Currency conversion Types

    Hi All,
    Can any body provide me link or send Document on Currency conversion types
    [email protected]
    Regards,
    C.V.
    Message was edited by: P.C.V.

    I sent to you an useful how to..
    Regards,
    Sergio

  • When i try to convert a pdf to a word document it says conversion failure

    When i try to convert a pdf to a word document it says conversion failure.  What should i do?

    Hi David,
    I see you are using the ExportPDF subscription. How large is your file?
    Try these two items:
    'Getting started guide'
    OCR
    Let me know if those help!
    Regards, Stacy

  • Word document to pdf conversions

    We have an application written in delphi. We need to develop an automated process to convert word documents to pdf format. I was wondering what was the best way to do this. Thanks.

    The Acrobat SDK only offers that type of conversion API to plugins (written in C/C++).

  • Pixel to array conversion (Vision toolkit)

    Hello everybody,
    I'm writing a vi to read out a CCD camera. I'd like to visualize the read out image converting one of its axis from pixels to other units (namely nm). I managed to do that by visualizing the image on an intensity graph creating accordingly a property node for the axis I wanted to convert . Is there a way to do this, so basically to convert one of the axis from pixels to a given array of values, using the vision toolkit?
    Many thanks.

    Hello,
    Thanks for the reply.
    The problem I've got to solve is the following. I have to read out a CCD camera. The light reaching the CCD is dispersed by a spectrometer. I know the algorithm to determine the correspondance between a given pixel of the camera and the wavelength of the light dispersed by the monochromator and reaching that pixel. I wrote a small VI (please find it attached) to obtain an array of values of wavelengths corresponding to each pixels, basically I can use the output of this small VI to know which are the minimum and maximum values of wavelength (in nm) displayed on the CCD camera and the increment in wavelength (in nm) correspondng to each pixel.  So if I display the read-out image using an intensity graph, I can use those values to create a property node for one axis of the graph and have it converted in the units I want (namely nm).
    Now my question is: is there a way I can do the same using the output of my small conversion VI and one of the displaying options of the vision toolkit? The bottom line is: I'd like to use the vision toolkit vis instead than the intensity graph to display my images.
    I hope my question is a bit clearer than before.
    Many thanks for the help.
    Cheers
    Attachments:
    Pixel2nm.vi ‏12 KB

  • Document to pdf conversion

    can any body help me how to convert word document to pdf

    if U want to use Java then U need to use XSL-FO for formatting and use some template engine like Apache-Velocity

  • Microsoft Document to PDF Conversion

    How about being able to convert a microsoft doc with text boxes to pdf? Have yet to get it to work so it must not be available.

    If you are having problems creating a PDF, there are two steps you should do FIRST
    Go to the appropriate vendor web site and apply all updates to the program you are using (several recent messages have concerned problems with MS Office conversion, with the response that different versions of Office have different BUGS that must be fixed by a download from Microsoft - and MS Office products are not the only ones which may, from time to time, need to be updated to work properly)
    Go to the Acrobat update page and apply the updates for your version of Acrobat
    IN NUMBER ORDER (updates are usually not cumulative so, using version 8 as an example, you must apply 8.1.0 before the 8.1.1 before the 8.1.2 update)
    http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows

  • Indesign document to ePub Conversion

    Hi,
    Please can anyone help me to get a solution to convert Indesign document to ePub file using indesign plug-in development?
    Thanks
    Ashok

    You set the indents and spacing in the Paragraph Styles panel under the Indents and Spacing tab. First Line Indent, Space Before/After. You will need two styles if the first par is not indented and the subsequent ones are.
    There is an InDesign ePub forum.

  • 1D Boolean Array to 1D Integer Array conversion for FPGA FIFO

    Hello, I am using a PXI7813R card. I would like to pass some data between the target (FPGA) vi and the host vi using the FIFO. I have a FIFO setup to 1023 "32 bit integer" samples. I have a boolean array of 32000 samples which would be the same as 1000 32 bit integers, that I acquired using the PXI7813R card.  I would like to convert the 1D boolean array to a 1D "32 bit intger" array. This seems like a more a difficult problem than I first thought as the labview functions are reduced when targetting a FPGA device. I have attached a jpg of how I would like to do it. I am getting a "Arrays must be fixed size in current target" error for the output from the array subset function. I know this is because one of the inputs is not exactly a constant, i.e. the index input  for array subset, but regardless of the index, I will only ever be taking 32 bits from the boolean array at any time to convert to a 32 bit integer to then place in the FIFO. Any suggestions of how I may get around this problem would be gratefully recieved. Regards, Michael.
    Message Edited by Michael_Limerick on 02-08-2008 04:54 AM
    Attachments:
    fifo_out1.JPG ‏52 KB

    Hi Daniel,
    Thanks for your reply.
    I had a look at the thread that you suggested and I'm not sure if that would solve the problem I was having, the option box was checked as default. I think my issue has to do with the limitations of the different LV functions when targeting a FPGA device.
    I have decided to take another route anyway, it seems that trying to compile a large array (even a 1D boolean array) for a FPGA target both takes a long time and also a lot of FPGA resources.
    Thanks again for your reply,
    Regards,
    Michael.

  • Read an XML file with java: Document to Node conversion

    Hello,
    I want to read an XML file and convert data into a Node instance because I need this for an XForm application.
    My code is:
    private Node workstationType;
    public Node initModel() {
    try {
    //This one will hold the results
    Document document;
    //loading from XML File
    String fileName="C:\\documents\\iniForm.xml";
    FileInputStream inXML = new FileInputStream(fileName);
    BufferedReader in = new BufferedReader(new InputStreamReader(inXML));
    document = XMLLoader.loadFromStream(in);
    } catch (Exception e) {
    System.err.println("ERROR:" + e.getMessage());
    e.printStackTrace(System.err);
    //Create the node for the root, 'typeOfWorkstation'
    workstationType = document.getDocumentElement(); //A
    //Return the root node
    return (workstationType);
    The problem: I can convert Node instance to Document instance (line A)
    The error message is: "document cannot be resolved".
    How can I do that??
    Thank you
    Sylvain

    Here is my XMLLoader class:
    public class XMLLoader {
         public static Document loadFromStream(Reader reader) throws Exception {
              //Build a DOM document with the reader
              //prepare DOM document
              DOMImplementation impl;
              DocumentBuilder builder;
              try {
                   // Find the implementation
                   DocumentBuilderFactory factory =
                        DocumentBuilderFactory.newInstance();
                   factory.setNamespaceAware(false);
                   factory.setValidating(false);
                   builder = factory.newDocumentBuilder();
                   impl = builder.getDOMImplementation();
                   //Read and parse the XML input stream into a DOM document
                   Document document = builder.parse(new InputSource(reader));
                   return document;
              } catch (IOException ex) {
                   throw new RuntimeException(
                        "[XMLLoader.loadFromFile]: Failed loading the InputStream. Root cause: \n"
                             + ex);
              } catch (Exception ex) {
                   throw new RuntimeException(
                        "[XMLLoader.loadFromFile]: Failed to initialize DOM factory. Root cause: \n"
                             + ex);

  • Char array conversion from String: toCharArray()

    Greetings,
    Can anyone tell me why this code:
    import com.wuw.debug.Trace;
    public
    class charTest
       public static void
       main( String[] args )
           String strIn = new String( "strIn" );
           Trace.DTRACE( "strIn: "+strIn );
           Trace.DTRACE( "strOut: "+strIn.toCharArray() );
    }produces this output:
    [DTRACE]: strIn: strIn
    [DTRACE]: strOut: [C@1fef6f
    and not:
    [DTRACE]: strIn: strIn
    [DTRACE]: strOut: strIn

    Because:
    String.toCharArray returns an array of chars.
    An array is basically an object in java.
    Objects are converted to strings with the method toString - if it's not implemented in your class the string that method returns will be of the form classname@hashcode.
    In the case of a char array, the name of the class is "[C". The hashcode of you object seems to be "1fef6f" (in hex).
    You'll just have to remember that an array of chars is [i]not a string in java.

  • Mobi document and other conversions

    Can Acrobat convert a mobi document to a pdf? If not, are there some other applications that can do this? What about ePub documents? Thanks.

    Can Acrobat convert a mobi document to a pdf? If not, are there some other applications that can do this? What about ePub documents? Thanks.

  • Object stream and byte array conversion

    Hello everyone,
    I am wondeirng how to convert an ObjectInputStream to a byte array, then convert the array back to ObjectInputStream -- should I convert the array back to ObjectOutputStream other than ObjectInputStream?
    Any sample codes?
    thanks in advance,
    George

    Isn't it the other way around? You can't do this directly:
    ObjectInputStream ois = ...;
    ByteArrayInputStream bais = new ByteArrayInputStream(ois);(but you can do it indirectly), but you can do this:
    ByteArrayInputStream bais = ...;
    ObjectInputStream ois = new ObjectInputStream(bais);

  • How do you keep embedded documents during conversion from Word 2007 to PDF?

    Windows 7, with all available patches.
    Word 2007, with all available patches.
    Acrobat reader 9.3.2
    I have additional documents, spreadsheets etc embedded into a Microsoft Office Word document. When this document is converted to the PDF (using the Word PDF add-in interface) the embedded objects can no longer be opened and only appear as images. 
    Is there a way to retain the embedded document during the conversion so that they can be opened from within the resulting PDF?
    Thanks in advance!

    Thanks very much for your repsonse, it's much appreciated
    I don't have Acrobat X installed at this time so am not able to create or edit PDFs (other than from Word).  I understand that creating a PDF from Word may not be an Acobat issue per se, but thought that someone on this forum may have experienced a similar problem, hence thought I'd try my luck here
    I will do as you suggest and try an MS forum
    Thanks again

Maybe you are looking for

  • XMLfile in archieve folder but no record in MDM-DM

    Hi All, I work in MDM 5.5. automatic XML File is getting processed in MDIS (i could see in Archeive folder)and with no Exception, but iam not able to see the record in Data manager . In Log folder-log file i see as below (Iam pasting the last few lin

  • How to get sub folder path

    I am trying to get sub string from a string with powershell $completeString = "C:\Development\Work\ABC-SharePoint\ABC\css\ABC\XYZ" $startingString = "ABC" I want "ABC\css\ABC\XYZ" note: ABC is multiple times in string

  • Encoding in apex

    hi ! i create application whit 1 report page thae get data from a table . this table has charactor set WE8ISO8859P1 and when application build , the web browser can't display , and when i change encoding of my browser to arabic(windows) i can view my

  • NEW FORUM DESIGN: Post Feedback Here

    Posting everything in one place will allow Comcast to better monitor what feedback is given.

  • When will external table field_list in access parameters support varchar2?

    Hello all, Currently I'm working on a CSV error check/upload/download utility (in pl/sql) using external tables. However, within the access parameters section, when I tried to use varchar2 in the field list to map to data fields in csv, oracle (10g)