How do I create an array with variables also splits words  in a txtfile?

Hello guys,
I made a script that reads a text file.
function readMyFile()
var myFile=File(app.activeDocument.filePath + "/LareLog.txt");
if (myFile.exists)
        myFile.open("r");
        var Temps =  myFile.read();
        alert (Temps);                          // message the content
        var nyRad=("\n");                    // break the line
        textArr=Temps.split(nyRad);
        alert(textArr);                          // message the content with all info on new lines ("\n");
        myFile.close();
my textfile contains:
~/Desktop/3.indd ,Thu Mar 20, 2014, 11:26:34 , GMT+0100
I wonder how do I sort the content in array
in this order, also creates variables for each string.
var= string 1[~/Desktop/3.indd]
var2=string 2[11:26:34]
var3=string 3[11:26:34]
var4=string 4[2014]
var5=string 5 [GMT+0100]
Thank you in advance people.

Hmmh?
Jump_Over said it before: „… are stored as separate array's elements …“ in your [textArr]
So you can create now variables on this way:
var string_1 = textArr[0]; // and so on
alert(string_1);
See Java Scripting reference for more examples how to use Arrays.

Similar Messages

  • How to create a array with variables dimensions?

    I try to create a array like that:
    Object[][] data;
    data = new Object[] [];
    But that's doesn't work!
    Apparently I must specify the dimension of my array
    So I have done like that :
    Object[][] data;
    data = new Object[3] [3];
    And that work!
    But the problem is when I need to add extra elements to my array.
    If I write :
    data[4][1] = "123";
    I have the error message :
    java.lang.ArrayIndexOutOfBoundsException
    So, how can I defined a array with variables dimensions OR how can I add a dimension to a array?

    if you have:
    Object[][] data;
    data = new Object[3] [3];you end yo getting ArrayIndexOutOfBoundException if you try to point to some other Indexes. You can increase the size by doing new:
    Object[][] data;
    data = new Object[4] [3];and then copy the old Arrays to this one... this is heavy.
    Other thing to consider then is using some other datastructure, such as Vector, which grows along you add elements to it.
    P_trg

  • How can I create a array with all files from a directory

    How can I create a array of files or varchar with all files from a directory?

    I thought the example could be improved upon. I've posted a solution on my blog that doesn't require writing the directory list to a table. It simply returns it as a nested table of files as a SQL datatype. You can find it here:
    http://maclochlainn.wordpress.com/2008/06/05/how-you-can-read-an-external-directory-list-from-sql/

  • How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?, How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?

    How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?, How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?

    Hi Libby,
    Select all three columns of data. All three must be 'regular' columns, not Header columns, and the X values must be in the leftmost column.
    Click the Charts button and choose the Scatter chart.
    The resulting chart will initially show only the first and second columns of data, and the selection will have been reduced to show this.
    Click the gear icon at the top left of the selection and choose Share X Values.
    You should see a result similar to this:
    Notes:
    The values on my sample table contain a random element, so they have changed from thhe first image to the second.
    The chart is as created by Numbers, with two edits:
    Data points have been connected with curves, using the Chart nspector.
    The curves were selected and their stroke increased to 2pts, using the stroke formating button in the format bar.
    Regards,
    Barry

  • How to create 2D array with 3 rows and unlimit column?

    how to create 2D array with 3 rows and unlimit column?

    Here are images of what I described in my previous post
    Message Edited by JoeLabView on 11-14-2007 07:56 AM
    Attachments:
    2D-array_code.PNG ‏7 KB
    2D-array_values.PNG ‏13 KB

  • How do you create an array without using a shell on the FP?

    I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file. I was thinking an array would be a way to do this, as I have done that in VB. (Saving it as a text file, then reading lines back into the array when the file is read and point the control(s) values/states to the corresponding array element.
    So how do I create an array of X dimensions without using a shell on the front panel? Or can someone suggest a better way to accomplish what I am after? (Datalogging doesn't allow for saving the status by a filename, so I
    do not want to go that route.)

    Thanks so much m3nth! This definitely looks like what I was wanting... just not really knowing how to get there.
    I'm not sure I follow all the icons. Is that an array (top left with 0 constant) in the top example? And if so, that gets back to part of my original question of how to create an array without using a shell on the FP. Do I follow your diagram correctly?
    If I seem a tad green... well I am.
    I hope you understand the LabVIEW environment and icons are still very new to me.
    Also, I had a response from an NI app. engineer about this problem. He sent me a couple of VI's that he threw together approaching this by using Keys. (I still think you are pointing to the best solution.) I assume he wouldn't mind m
    e posting his reply and the VI's for the sake of a good, thorough, Roundtable discussion. So here are his comments with VI's attached:
    "I was implementing this exact functionality this morning for an application I'm working on. I only have five controls I want to save, but they are all of different data types. I simply wrote a key for each control, and read back that key on initialization. I simply passed in property node values to the save VI at the end, and passed the values out to property nodes at
    the beginning. I've attached my initialize and save VI's for you to view. If you have so many controls that this would not be feasible, you may want to look into clustering the controls and saving the cluster as a datalog file.
    Attachments:
    Initialize_Settings.vi ‏55 KB
    Save_Settings.vi ‏52 KB

  • How do I create an Array of Images

    Hi,
    I'm creating a program that basically is a slideshow. It has buttons that allow the user to switch from image to image, and has some audio in the background. I was wondering how I might create an array to store the images. I'm very new to Java, so please no detail is too small. I've just started using arrays, so I'm not sure where I would store the files or how to call the images. Please be descriptive and as dumbed down as possible :)
    Thanks for the help!

    I like ArrayList
    ArrayList<BufferedImage> myPics = new ArrayList();then just dump them in with add(myBufferedImage)
    If you'e not using BufferedImages then just change the BufferedImage to Image.
    to get, say the 6th image back out, then use:
    myBufferedImage = myPics.get(5);the index starts at 0 and should be addressed as 0 to (myPics.length - 1)

  • How can i creat several rectangles with one draw rect.vi

    how can i creat several rectangles with one draw rect.vi? thanks
    Solved!
    Go to Solution.

    You can call it in a for loop, with an array of the rectangle coordinates you want to draw. Is this what you mean?
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    rectangle.png ‏11 KB

  • Creating many arrays with different names

    I'm trying to create many arrays with a different names by calling this method:
    n=name of array
    c= some string
    public Array[] newArray(String n, String c)
    n[n.length]= new String();
    n[n.length]= c;
    As you experts might guess this does not compile. Is it even possible to do this?

    no, you cannot make a dynamic variable like that.
    and no, that is not the way to make arrays.
    and no, there is no such thing as "Array[]" ( unless u have made an "Array" object ).
    code for a new array is as such
    public Object[] newArray(int size){
      return new Object[size];
    }called as such:
    String[] strings = (String[]) newArray(10);
    strings[0] = "hmmm";mmmmm

  • How do I cerate an array with a set of numbers lets say 1 through 12 random order but no repeating.

    How do I cerate  an
    array with a set of numbers lets say 1 through 12 random order but no
    repeating.
    I know this should be easy but my brain wont work
    right now
    Solved!
    Go to Solution.

    OK, here's the handmade version.
    It is useful to know that arrays of clusters are sorted by the cluster order of the elements. Simply bundle random numbers with numbers 1-12 in a loop, create an array at the output tunnel, sort the array by the random number, and extract the number array. It will be shuffled.
    Message Edited by altenbach on 06-04-2007 09:20 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    shuffleArray.png ‏5 KB

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • How do I create a track with just controller MIDI data in it?

    How can I create a track with just MIDI controller data in it? 
    For example: I'd like to create a track that issues a bank change/patch change and sets the default volume for that track, and that's it.
    I can then use this setup as a template for future projects.
    How can I do this?
    It seems like LPX will not allow me to enter any controller data into a track without first defining a region. However, it seems that LPX also won't allow me to create a region with just controller data in it. 
    Ideas?
    Thanks
    -Mike

    Soniq2 wrote:
    How can I create a track with just MIDI controller data in it? 
    For example: I'd like to create a track that issues a bank change/patch change and sets the default volume for that track, and that's it.
    I can then use this setup as a template for future projects.
    How can I do this?
    Let me qualify, I'm using Logic 9, not upgrading for various reasons.
    Is this for an external Instrument? If so it's very easy to do using the inspector, but first you have to create an instrument in the environment. (at least in L9 and the way I do it, which is old school)  Here's an example of an external instrument setup in the Environment.
    A multi Instrument is created, channels 1, 2, 3, & 9 are active. Patch names are entered, format for bank change is selected. (just happens I selected channel 14 to open the patch names).  This Instrument will now appear in the arrange page, and you can set patch change, bank change, volume & pan.

  • How can I create a solution with Livecycle

    I work for a high school and we have about 12 pdfs that we need parents to read/scroll through, then 10 (different) pages that we want them to print, complete and return to the school.  Finally, we want them to see a "Thank you, you have done all you have to do" type screen.  We want to make it as user friendly as possible so I was thinking...
    Reading pages, 1 at a time with next at bottom.
    Click next and it takes them on.  When they get to printing pages 1 print button prints all pages we need them to print. Click next, and it takes them to optional print pages.
    Click next and it says, thank you.
    How can I make this happen if I already have all the pdfs?
    Help please.
    John Dent
    [email protected]

    Thank you soo much.  A few questions?
    They weren't created in designer but could I just import all of them?
    How do "build the structure" for the naviagtion?
    Where/how do you add the script.
    Thanks again,
    John Dent
    Date: Fri, 30 Jul 2010 07:01:08 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I create a solution with Livecycle
    I assume that all of these PDFs were created in Designer. If so you can add any buttons that you want to appear on every page (Next, Previous) onto the Master page then there is script you can add to the buttons to actual move the pages (xfa.host.pageDown() and xfa.host.pageUp()). The Prin button can be added to the specific page and you can pass the page numbers that you want to print as a parameter to the print command. Lastly when you get to the last page and the click Complete you can display a messageBox with your Thank you message.
    Hope that helps
    Paul
    >

  • How can I create a query with tables in INFOSET?

    Dear Gurus,
    How can I create a query with tables in INFOSET?
    Just tables and fields INFOSET?
    Kind Regards,

    Hello
    Check following SCN Article for your understanding/reference:
    - [Using Infoset Query ,SAP Query and Quick Viewer|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5]
    Regards
    JP

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

Maybe you are looking for