Storing some filenames in an array in loop

Hi ,
I am getting some file names in a loop like this:
File aDirectory = new File("Data/");
         File[] files = aDirectory.listFiles();
         //String fileret = null;
         for(File file : files){
              String file1 = "Data/"+file.getName()+"/"+file.getName()+".txt";
              String f12str = readTextFile(file1);
              String s1 =f12str.toLowerCase();
         }I need the f12str names outside the loop in an array...How can I do that? It is not defined outside.
I need to store the names in an array.

Hi,
I want to compute something like this:
String file1 = "Data/xyz/xyz.txt";
String file2 = "Data/abc/abc.txt";
String file3 = "Data/efg/efg.txt";
          String f12str = readTextFile(file1);
          String f22str = readTextFile(file2);
          String f32str = readTextFile(file3);By using a new program with a new loop:
File aDirectory = new File("Data/");
         File[] files = aDirectory.listFiles();
         String file1 =null;
         for(File file : files){
              file1 = "Data/"+file.getName()+"/"+file.getName()+".txt";
         }But how can I perform the above operations if I cant even initialize an array of files in file1.
Actually I have to make
file[] = all files;
do same operations as in main file.... like readTextFile and stuff

Similar Messages

  • SQL stored procedure Staging.GroomDwStagingData stuck in infinite loop, consuming excessive CPU

    Hello
    I'm hoping that someone here might be able to help or point me in the right direction. Apologies for the long post.
    Just to set the scene, I am a SQL Server DBA and have very limited experience with System Centre so please go easy on me.
    At the company I am currently working they are complaining about very poor performance when running reports (any).
    Quick look at the database server and CPU utilisation being a constant 90-95%, meant that you dont have to be Sherlock Holmes to realise there is a problem. The instance consuming the majority of the CPU is the instance hosting the datawarehouse and in particular
    a stored procedure in the DWStagingAndConfig database called Staging.GroomDwStagingData.
    This stored procedure executes continually for 2 hours performing 500,000,000 reads per execution before "timing out". It is then executed again for another 2 hours etc etc.
    After a bit of diagnosis it seems that the issue is either a bug or that there is something wrong with our data in that a stored procedure is stuck in an infinite loop
    System Center 2012 SP1 CU2 (5.0.7804.1300)
    Diagnosis details
    SQL connection details
    program name = SC DAL--GroomingWriteModule
    set quoted_identifier on
    set arithabort off
    set numeric_roundabort off
    set ansi_warnings on
    set ansi_padding on
    set ansi_nulls on
    set concat_null_yields_null on
    set cursor_close_on_commit off
    set implicit_transactions off
    set language us_english
    set dateformat mdy
    set datefirst 7
    set transaction isolation level read committed
    Store procedures executed
    1. dbo.p_GetDwStagingGroomingConfig (executes immediately)
    2. Staging.GroomDwStagingData (this is the procedure that executes in 2 hours before being cancelled)
    The 1st stored procedure seems to return a table with the "xml" / required parameters to execute Staging.GroomDwStagingData
    Sample xml below (cut right down)
    <Config>
    <Target>
    <ModuleName>TransformActivityDim</ModuleName>
    <WarehouseEntityName>ActivityDim</WarehouseEntityName>
    <RequiredWarehouseEntityName>MTV_System$WorkItem$Activity</RequiredWarehouseEntityName>
    <Watermark>2015-01-30T08:59:14.397</Watermark>
    </Target>
    <Target>
    <ModuleName>TransformActivityDim</ModuleName>
    <WarehouseEntityName>ActivityDim</WarehouseEntityName>
    <RequiredWarehouseEntityName>MTV_System$WorkItem$Activity</RequiredWarehouseEntityName>
    <ManagedTypeViewName>MTV_Microsoft$SystemCenter$Orchestrator$RunbookAutomationActivity</ManagedTypeViewName>
    <Watermark>2015-01-30T08:59:14.397</Watermark>
    </Target>
    </Config>
    If you look carefully you will see that the 1st <target> is missing the ManagedTypeViewName, which when "shredded" by the Staging.GroomDwStagingData returns the following result set
    Example
    DECLARE @Config xml
    DECLARE @GroomingCriteria NVARCHAR(MAX)
    SET @GroomingCriteria = '<Config><Target><ModuleName>TransformActivityDim</ModuleName><WarehouseEntityName>ActivityDim</WarehouseEntityName><RequiredWarehouseEntityName>MTV_System$WorkItem$Activity</RequiredWarehouseEntityName><Watermark>2015-01-30T08:59:14.397</Watermark></Target><Target><ModuleName>TransformActivityDim</ModuleName><WarehouseEntityName>ActivityDim</WarehouseEntityName><RequiredWarehouseEntityName>MTV_System$WorkItem$Activity</RequiredWarehouseEntityName><ManagedTypeViewName>MTV_Microsoft$SystemCenter$Orchestrator$RunbookAutomationActivity</ManagedTypeViewName><Watermark>2015-01-30T08:59:14.397</Watermark></Target></Config>'
    SET @Config = CONVERT(xml, @GroomingCriteria)
    SELECT
    ModuleName = p.value(N'child::ModuleName[1]', N'nvarchar(255)')
    ,WarehouseEntityName = p.value(N'child::WarehouseEntityName[1]', N'nvarchar(255)')
    ,RequiredWarehouseEntityName =p.value(N'child::RequiredWarehouseEntityName[1]', N'nvarchar(255)')
    ,ManagedTypeViewName = p.value(N'child::ManagedTypeViewName[1]', N'nvarchar(255)')
    ,Watermark = p.value(N'child::Watermark[1]', N'datetime')
    FROM @Config.nodes(N'/Config/*') Elem(p)
    /* RESULTS - NOTE THE NULL VALUE FOR ManagedTypeViewName
    ModuleName WarehouseEntityName RequiredWarehouseEntityName ManagedTypeViewName Watermark
    TransformActivityDim ActivityDim MTV_System$WorkItem$Activity NULL 2015-01-30 08:59:14.397
    TransformActivityDim ActivityDim MTV_System$WorkItem$Activity MTV_Microsoft$SystemCenter$Orchestrator$RunbookAutomationActivity 2015-01-30 08:59:14.397
    When the procedure enters the loop to build its dynamic SQL to delete relevant rows from the inbound schema tables it concatenates various options / variables into an executable string. However when adding a NULL value to a string the entire string becomes
    NULL which then gets executed.
    Whilst executing "EXEC(NULL)" would cause SQL to throw an error and be caught, executing the following doesnt
    DECLARE @null_string VARCHAR(100)
    SET @null_string = 'hello world ' + NULL
    EXEC(@null_string)
    SELECT @null_string
    So as it hasnt caused an error the next part of the procedure is to move to the next record and this is why its caught in an infinite loop
    DELETE @items WHERE ManagedTypeViewName = @View
    The value for the variable @View is the ManagedTypeViewName which is NULL, as ANSI_NULLS are set to ON in the connection and not overridded in the procedure then the above statement wont delete anything as it needs to handle NULL values differently (IS NULL),
    so we are now stuck in an infinite loop executing NULL for 2 hours until cancelled.
    I amended the stored procedure and added the following line before the loop statement which had the desired effect and "fixed" the performance issue for the time being
    DELETE @items WHERE ManagedTypeViewName IS NULL
    I also noticed that the following line in dbo.p_GetDwStagingGroomingConfig is commented out (no idea why as no notes in the procedure)
    --AND COALESCE(i.ManagedTypeViewName, j.RelationshipTypeViewName) IS NOT NULL
    There are obviously other ways to mitigate the dynamic SQL string being NULL, there's more than one way to skin a cat and thats not why I am asking this question, but what I am concerned about is that is there a reason that the xml / @GroomingCriteria is incomplete
    and / or that the procedures dont handle potential NULL values.
    I cant find any documentation, KBs, forum posts of anyone else having this issue which somewhat surprises me.
    Would be grateful of any help / advice that anyone can provide or if someone can look at their 2 stored procedures on a later version to see if it has already been fixed. Or is it simply that we have orphaned data, this is the bit that concerns most as I dont
    really want to be deleting / updating data when I have no idea what the knock on effect might be
    Many many thanks
    Andy

    First thing I would do is upgrade to 2012 R2 UR5. If you are running non-US dates you need the UR5 hotfix also.
    Rob Ford scsmnz.net
    Cireson www.cireson.com
    For a free SCSM 2012 Notify Analyst app click
    here

  • In 2007, I stored some information on a disk, as it was too sensitive to remain on my computer. Now the disk shows it was a .cwk file and I cannot open it. I've tried several things, but I've gotten messages that it isn't a pages, numbers or presentation

    In 2007, I stored some sensitive information on a disk rather than leave it on my computer. Now, in the latest version of Pages, I cannot read the disk, although accessing the information could save me days of work duplicating it. Is there a way of reading/converting the disk?

    By 'cannot read the disk' I assume you mean that you can access the file but cannot open it (if you couldn't read the disk you wouldn't be able to see the file in the first place).
    As you have found, the latest Pages does not open Appleworks documents. If you had the earlier version of Pages and upgraded, the older version is still in the iwork '09 folder in your Applications folder and that version pf Pages will open AW Word Processing documents (which presumably that is).
    Failing that, Panergy Software's docXConverter v3.2 ($19.95) can convert Appleworks 5 and 6 Word Processing documents to RTF (though it has been reported that it can only handle documents which contain only text, not those which include images or frames). The latest version of the free LibreOffice can open AppleWorks 6 Word Processing documents and an ability to open ClarisWorks documents has been reported: it does appear to be able to handle at least some embedded images.

  • How to create a stored procedure that accepts an array of args from Java?

    I am to be creating a stored procedure that accepts an array of arguments from Java. How to create this? thanks
    Sam

    Not a PL/SQL question really, but a Java one. The client call is done via ThinJDBC/OCI to PL/SQL, This call must be valid and match the parameters and data types of the PL/SQL procedure.
    E.g. Let's say I define the following array (collection) structure in Oracle:
    SQL> create or replace type TStrings as table of varchar2(4000);
    Then I use this as dynamic array input for a PL/SQL proc:
    create or replace procedure foo( string_array IN TStrings )...
    The client making the call to PL/SQL needs to ensure that it passes a proper TStrings array structure.. The Oracle Call Interface (OCI) supports this on the client side - allowing the client to construct an OCI variable that can be passed as a TStrings data type to SQL. Unsure just what JDBC supports in this regard.
    An alternative method, and a bit of a dirty hack, is to construct the array dynamically - but as this does not use bind variables, it is not a great idea.
    E.g. the client does the call as follows: begin
      foo( TStrings( 'Tom', 'Dick', 'Harry' ) );
    end;Where the TStrings constructor is created by the client by stringing together variables to create a dynamic SQL statement. A bind var call would look like this instead (and scale much better on the Oracle server side):begin
      foo( :MYSTRINGS );
    end;I'm pretty sure these concepts are covered in the Oracle Java Developer manuals...

  • VBA: problems in creating and storing objects in array with loop

    I created a Class named Issue. Then I created a function that creates Issue objects, set their properties with data from a worksheet and store them into a variant array through a loop. the problem is that everytime that the loops runs it overwrites the properties
    of the same object instead of creating a new object, setting its properties. Would anyone know how to solve that? The loop code goes below:
     'Stores all the Issues objects in an Array
    Function StoreAllIssues() As Variant
    Dim IssuesSheet As Worksheet
    Set IssuesSheet = Sheet1
    Dim intLastRow As Integer
    intLastRow = Uteis_Jorge.LastRowFunc(IssuesSheet, 1)
    Dim IssuesArray() As New Issue: ReDim IssuesArray(0)
    For i = 2 To intLastRow
        Dim MyIssue As New Issue
        MyIssue.IssueName = IssuesSheet.Cells(i, 1)
        MyIssue.Suggestion = IssuesSheet.Cells(i, 2)
        MyIssue.Priority = IssuesSheet.Cells(i, 3)
        MyIssue.Resolution = IssuesSheet.Cells(i, 4)
        MyIssue.JobStatus = IssuesSheet.Cells(i, 5)
        MyIssue.AssignedTo = IssuesSheet.Cells(i, 6)
        Set IssuesArray(i - 2) = MyIssue
        ReDim Preserve IssuesArray(i - 1)
    Next i
    ReDim Preserve IssuesArray(i - 3)
    StoreAllIssues = IssuesArray
    End Function
    Jorge Barbi Martins ([email protected])

    Hi Jorge,
    You can set the MyIssue to Nothing every time you don't use the MyIssue object, in this way, the array will properly store the new MyIssue object:
    For i = 2 To intLastRow
    Dim MyIssue As New Issue
    MyIssue.IssueName=IssuesSheet.Cells(i,1)
    Set IssuesArray(i - 2) = MyIssue
    ReDim Preserve IssuesArray(i - 1)
    Set MyIssue = Nothing
    Next i
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Call stored procedure in JDBC passing Array parameters

    Hi all,
    Im trying to call an Oracle Stored Procedure with JDBC. The problem is
    that my parameter is an Array (PL/SQL Type is "Table Of").
    How can i call this procedure by passing right Java parameters to
    the Callable statement ??
    In the Documentation, all samples don't work ! it's possible to
    call a procedure that return Array Type but when we need to pass an Array as
    a parameter we have a DataType exception.
    Any idea ?
    thanx in advance
    Sam.

    Hi Sam,
    I don't have an answer to your question, just some suggestions as to
    where else you may find help.
    Do you know about the "Ask Tom" website:
    http://asktom.oracle.com
    Also, you may find something in the comp.databases.oracle.* newsgroups:
    http://groups.google.com
    I found this article there -- but it's not exactly what you're looking
    for:
    http://groups.google.com/groups?q=array+group:comp.databases.oracle.server+author:Thomas+author:Kyte&hl=iw&as_qdr=w&selm=a9sg06027kf%40drn.newsguy.com&rnum=1
    Good Luck,
    Avi.

  • Storing sql recordset in an array, or list, or similar

    I should probably understand hashmaps better before posting this, but if someone could point me in the right direction, I'd appreciated it.
    I'd like to store a sql resultset having an integer and a string in an array, or list, or similar. That is, I'd like to close the recordset and still have the data stored somehow.
    Problem wth an array is, as I understand it, even a multi-dimensional array has to be of the same type:
    String [][] records ...or
    int [][] records;
    I'd like to declare:
    int[]String[] records;
    ...and store the resultset into this array(list, or collection, or whatever) in a while loop.
    ResultSet rs = statement.executeQuery();
    int i = 0;
    while ( rs.next() ) {
    records[0] = rs.getString( "ObjectId") ;
    records[i][1] = rs.getString( "ObjectName" );
    rs.close();
    statement.close();
    Any ideas appreciated.
    Amboss

    You could declare create a your own class as -
    class MyRecord extends Object {
    int id;
    String name;
    public MyRecord(int id, String name) {
    this.id = id;
    this.name = name;
    }Then use a Vector to save the records as you iterate
    over the ResultSet
    Vector records = new Vector();
    ResultSet rs = statement.executeQuery(sql);
    while (rs.next()) {
    records.add(
    new
    MyRecord(rs.getInt("ObjectId"),rs.getString("ObjectNam
    e"));
    }To retrieve records you must use the get() method of
    Vector.
    MyRecord rec = (MyRecord)records.get(i);
    Aren't you going to put parameter to Vector<?> ?
    this is based on the JDK Generics 1.5

  • How to zero array within loop that displays 3 numbers when program is started?

    i am starting a loop that displays 3 pieces of data that is updated throught the cycle. At the end it displaces the last result. When the program is run again i need these values to be reset. This is a loop inside of a loop inside of a loop.
    Attachments:
    GEM_testset_V2.vi ‏633 KB

    The most evident approach is just to use initialise array function on the first iteration of your loop, but... There are really many loops in your vi, so may be its better to use zeros as defaul values for your array indicaters and before each run apply a "Reset to Defaults" method. But for this you must make some kind of a higher level vi which will perform "reset to defaults" method on your vi as this method doesn't work in run-time (or may be I'm wrong?)...

  • Get document swatches in [arrays]: In loop to Peter kahrel & Jump_over previous thread.

    Hi forum,
    this is reg, getting swatches available inside the document pallette into [arrays], instead of typing the document swatches as i did.
    (this is my ongoing UI script related to previous thread, answered by jump_over and peter kahrel).
    Im storing manually the swatches names in [arrays] and calling it from dropdown list, instead of automatically getting available swatches inside the document...
        var arrays2 = ["Black", "Red", "Blue"]; // here i want to automatically assign the available swatches inside the "document - swatches pallette".
        myGroup1.add("statictext", undefined, "Color");
        var ddown2= myGroup1.add("dropdownlist", undefined, arrays2);
    screen shot is:
    also if Im answered to get the available system fonts for fontstyle that would be greatest of great, instead of ["Regular", "Bold", "Italic"] etc.,
    thanks.
    shil...

    hi vamitul,
    thanks for the reply,
    also, if i use: app.fonts.everyItem().name;..
    it show like the below screenshot: 
    instead i wish to get only the fontStyles, when i click the fontstyles dropdown like;;
    Regular,
    Condensed Light,
    Condensed,
    Italic,
    Bold,
    etc., and not the font family like the above.
    very thanks in advance,,
    SHIL...

  • How can I append some data to an array via a case structure?

    Basically i want to do the following thing:
    do
    if control=0
    else
    Data=Data append data1
    end if
    }while(run=1)
    We try to avoid local variable since the size of Data is pretty big. I am pretty sure i can add a shift register in a loop structure.But is it possible to add a shift register in a case structure?
    Thank you!

    The best you will be able to do is going to be a variation on what CC suggested regarding replacing array sub-sets.
    If you do not know how big it will end up then over-allocate but still use the replace array subset.
    The delays you are seeing are due to the memory buffers groing and additional memory need allocated as the array grows. The Replace array subset function operates inplace and re-uses the buffer it is passed. There is no clear KB regarding which array operations operate inplace and which do not.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=74847&requireLogin=False
    Under Tools >>> Advanced >>> Show buffer allocations will show you where buffers are being allocated (LV 7.1).
    If you post a zip or llb of you code I am sure someone will have more to add.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How Do I Call PL/SQL Stored Procedure That Returns String Array??

    I Have Problem Calling An Oracle(8i) Stored Procedure That Returns Array Type (Multi Rows)
    (As Good As String Array Type..)
    In This Fourm, I Can't Find Out Example Source.
    (Question is Exist.. But No Answer..)
    I Want An Example,, Because I'm A Beginner...
    (I Wonder...)
    If It Is Impossible, Please Told Me.. "Impossible"
    Then, I'll Give Up to Resolve This Way.....
    Please Help Me !!!
    Thanks in advance,

    // Try the following, I appologize that I have not compiled and run this ... but it is headed in the right direction
    import java.sql.*;
    class RunStoredProc
    public static void main(String args[])
    throws SQLException
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    catch(Exception ex)
    ex.printStackTrace();
    java.util.Properties props = new java.util.Properties();
    props.put("user", "********"); // you need to replace stars with db userid
    props.put("password", "********"); // you need to replace stars with userid db password
              // below replace machine.domain.com and DBNAME, and port address if different than 1521
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@machine.domain.com:1521:DBNAME", props);
    // replace "Your Stored Procedure" with your stored procedure
    CallableStatement stmt = conn.prepareCall("Your Stored Procedure");
    ResultSet rset = stmt.execute();
    while(rset.next())
    System.out.println(rset.getString(1));

  • Scripted JDBC and Oracle Stored Procedure with in/out Array

    The com.waveset.util.pooledconnection used by Scripted JDBC Adapter extends java.sql.connection.
    I need to pass an Varchar2 Array to the Stored Procedure. I tried using the oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to pass the values, but get a casting exception,as the polledconnection implements only the java.sql.connection and not oracle.sql.connection.
    What are my options of using java.sql.Array with a PL/SQL procedure that takes a varchar2 array as in out parameter?
    Thanks
    Venki

    i ran my procedure which is very similar syndra posted
    create or replace procedure foo(p_dt in date, cv out sys_refcursor) as
    begin
    open cv for
    select e.*
    from table_xyz e
    where start_dt = p_dt;
    end;
    /Here is how is executed
    DECLARE
      P_DT DATE;
      CV SYS_REFCURSOR;
    BEGIN
      P_DT := '10-oct-2005';
      -- CV := NULL;  Modify the code to initialize this parameter
      scott.foo ( P_DT, CV );
      COMMIT;
    END;           
    -- i get PL/SQL procedure successfully complted , But i dont see the result set Or output
    - How do i see the output when i m using refcursor ?? i tried using print , but nothing didnt work
    - Any idea ??
    Thank you!!
    Edited by: user642297 on Jun 24, 2010 1:35 PM

  • Trouble with storing values in 2-d array.

    Hi, I am a Java newbie and would appreciate any help. I am writing a program to read in bandwidth traffic data from a text file and process it to make a graphical representation to analyze the data better. Anyways I haven't gotten very far yet. I am reading the text in from file a line at a time and splitting each line up into fields. I am trying to store each set of fields ( line of text) into a separate array so that I can manipulate the data better...when I get to that. Anyways, when I run the program it will output the first 3 fields of data and then give me the error 'Usage: java ReadFile filename' If I take out the code that stores my data in the array and just test it by outputting it to the screen it works fine. Reads in the file and prints out the entire file like I want it.
    Thanks for any help.
    import java.lang.*;
    import java.io.*;
    import java.util.regex.*;
    public class Main{
    public static void main(String[] args){
    String line;
    String [][] str = new String[88][4];
    try {
    FileReader input = new FileReader(args[0]); // Takes an arg and reads a file as input
    BufferedReader bufRead = new BufferedReader(input);
    line = bufRead.readLine(); // Reads the file one line at a time
    while (line != null){
    int i = 0;
    String text = line;
    String [] fields = text.split( "\\s*;\\s*" ); // splits data file into fields
    while (fields.length < 3){            // this gets rid of the first 12 lines of my
    line = bufRead.readLine(); // file that are unnecessary data
    text = line;
    fields = text.split( "\\s*;\\s*" );
    for (int j = 0; j < fields.length; j++){
    str[i][j] = fields[j];
    System.out.print(fields[j]);
    i++;
    line = bufRead.readLine();
    bufRead.close();
    }catch (ArrayIndexOutOfBoundsException e){
    /* If no file was passed on the command line, this expception is
                   generated. A message indicating how to the class should be
                   called is displayed */
                   System.out.println("Usage: java ReadFile filename\n");               
              }catch (IOException e){
                   // If another exception is generated, print a stack trace
    e.printStackTrace();
    }// end main
    Here is my text file I am reading from.
    version;3
    active;1
    interface;eth0
    nick;eth0
    created;1182373685
    updated;1184735101
    totalrx;7832
    totaltx;142830
    currx;2464128311
    curtx;3121558764
    totalrxk;1
    totaltxk;867
    btime;1181771048
    d;0;1184731201;38;1698;405;794;1
    d;1;1184644801;755;17589;559;855;1
    d;2;1184558401;540;2647;958;1012;1
    d;3;1184472001;112;3685;377;34;1
    d;4;1184385601;102;2957;523;359;1
    d;5;1184299201;90;2605;961;781;1
    d;6;1184212802;199;2442;53;300;1
    d;7;1184126401;103;3092;494;124;1
    d;8;1184040002;117;3097;1008;1009;1
    d;9;1183953601;109;3136;435;337;1
    d;10;1183867202;115;3921;737;1001;1
    d;11;1183780801;125;4307;984;332;1
    d;12;1183694401;114;3854;11;225;1
    d;13;1183608001;133;4790;157;480;1
    d;14;1183521601;135;4871;0;364;1
    d;15;1183435201;142;5121;736;898;1
    d;16;1183348801;118;3914;500;578;1
    d;17;1183262401;134;4759;470;335;1
    d;18;1183176001;122;4302;771;761;1
    d;19;1183089602;149;5408;308;445;1
    d;20;1183043514;72;2534;178;297;1
    d;21;1182902401;3059;8065;334;486;1
    d;22;1182816001;240;9431;435;521;1
    d;23;1182729602;381;12444;204;96;1
    d;24;1182643201;135;5059;628;696;1
    d;25;1182556801;130;4535;782;899;1
    d;26;1182470401;152;5438;197;753;1
    d;27;1182384001;184;6704;113;316;1
    d;28;1182373685;13;411;1019;115;1
    d;29;0;0;0;0;0;0
    m;0;1183262401;3190;78494;152;602;1
    m;1;1182373685;4641;64336;873;265;1
    m;2;0;0;0;0;0;0
    m;3;0;0;0;0;0;0
    m;4;0;0;0;0;0;0
    m;5;0;0;0;0;0;0
    m;6;0;0;0;0;0;0
    m;7;0;0;0;0;0;0
    m;8;0;0;0;0;0;0
    m;9;0;0;0;0;0;0
    m;10;0;0;0;0;0;0
    m;11;0;0;0;0;0;0
    t;0;1184644801;755;17589;559;855;1
    t;1;1182729602;381;12444;204;96;1
    t;2;1182902401;3059;8065;334;486;1
    t;3;1182816001;240;9431;435;521;1
    t;4;1182384001;184;6704;113;316;1
    t;5;1182470401;152;5438;197;753;1
    t;6;1183089602;149;5408;308;445;1
    t;7;1183435201;142;5121;736;898;1
    t;8;1182643201;135;5059;628;696;1
    t;9;1183521601;135;4871;0;364;1
    h;0;1184734501;37757;1663897
    h;1;1184735101;1560;75649
    h;2;1184655301;2707;52378
    h;3;1184658901;2309;29868
    h;4;1184662501;5689;166692
    h;5;1184666101;4951;132382
    h;6;1184669701;4482;128149
    h;7;1184673301;1305;389
    h;8;1184676901;1304;380
    h;9;1184680501;1463;9641
    h;10;1184684101;7479;320802
    h;11;1184687701;10266;215760
    h;12;1184691301;7682;338884
    h;13;1184694901;1533;11403
    h;14;1184698501;144097;127520
    h;15;1184702101;6260;290490
    h;16;1184705701;7891;351298
    h;17;1184709301;258228;2123273
    h;18;1184712901;65965;2951165
    h;19;1184716501;29618;1321867
    h;20;1184720101;51062;2405040
    h;21;1184723701;48907;2124114
    h;22;1184727302;50111;2361284
    h;23;1184730901;51224;2258344

    Thanks for the help guys. I didn't set my array to
    the right size. Also sorry about the formatting. I
    will do better next time.A list would have made that more flexible:
    http://java.sun.com/docs/books/tutorial/collections/index.html
    Also, it may make sense to define a class to represent one row of data, rather than just using an array for that, too.

  • Jsp variables to javascript array, for loop dont work.

    This works fine. con.getmake passes a different variable each time to the javascript array using a manual index.
    <script>
    make[0] = "<%= con.getmake() %>" ;
    document.write(make[0]);
    make[1] = "<%= con.getmake() %>" ;
    document.write(make[1]);
    make[2] = "<%= con.getmake() %>" ;
    document.write(make[2]);
    make[3] = "<%= con.getmake() %>" ;
    document.write(make[3]);
    </script>
    If I try and do the same with a for loop, It seems as though all the elements hold the same first variable retrieved from con.getmake, I am not getting the next variable from my java class.
    <script>
    for (var i= 0; i <= 2; i++)
    make[i] = "<%= con.getmake() %>" ;
    document.write(make);
    </script>

    Hi,
    Java is parsed once on the server which creates a HTML page, then it is passed to the client's browser where the javascript is executed. So con.getmake() is only executed once in java. You've got to execute your loop in java not javascript :
    <script>
    <%
    for (int i= 0; i <= 2; i++)
    %>
    document.write("<%= con.getmake() %>");
    <%
    %>
    </script>

  • Would like some help converting an array of strings into multiple parsed string arrays

    Hello everyone.
    this is a very novice question and I sincerely apologize for that, but i need some direction!
    i have an array of strings:
    (('J01',), ('0', '0', '0', '1'))
    (('J02',), ('0', '1', '0', '1'))
    (('J03',), ('0', '0', '0', '0'))
    ect...
    i would like to know what are some of the best ways to gain access to this information (aka, parse it). The field lengths are not static and all those ones and zeros could very possibly be two digits at times (0 = off state, 1-100 = on state), so simply pulling characters out of a given position of the string will not always work.
    what i would like to achieve is to make either separate arrays for each desirable element, eg:
    array one:
    J01
    J02
    J03
    array two:
    0
    0
    0
    array three:
    0
    1
    0
    and so on.
    or maybe even a matrix (if that’s feasible).
    other than that I am totally up for suggestions!!
    thank you very much,
    Grant.

    Assuming fixed structure (not necessarily length of the different numbers or names).

Maybe you are looking for

  • Only able to edit one page from a project then must shut down to open another

    Hi!  I have upgraded to Muse CC 2014 on a Windows 7 machine, when I open a project I can only open a single page from the planning window. It will not allow me to open another page when double clicking on the page icon. If I close the first page open

  • Syncing and backing up!

    Is there a way to Sync a phone that has been used for quite a while but was never originally synced?   I need back up my apps and whatever else gets backed up through an iTunes sync because I can't update to ios7, but it only lets me restore or start

  • How to convert a string list to number list

    Hi I have a table1 that codeid is a number(2) and other table2 that obtain the codeidlist in a varchar2(50) where I save the codeid that I selected from table 1, I can be one o more : 1,2,4,5 etc. I wanna make this but It gives an error: Invalid Numb

  • Keynote - files too big to email/share, looking for PDF resolution solution

    Has anyone worked out how to change a keynote presentation PDF resolution when preparing for sharing? The file I get is too big to email (6 photos gave me 55mb) as it appears to retain the input resolution of the embedded photos?

  • Selected/activated button overlay in Buttons over Video

    I have six different buttons over video, with one overlay. The buttons are assigned to each of six audio tracks. When I select and activate a button the overlay goes from white to red, and the audio changes to the specified audio track. So far, so go