Save array to column

Hello, 
I have attached a simplified VI that saves data after taking measurements from my measurment instrument.  Each iteration in the while loop represents a measurement.  The data is currently saved in just two columns.  Can you assist me in saving the data after each while loop iteration in different columns.  
For the attached VI, I would like to get the data spread over 8 columns:
x0data y0data x1data y1data x2data y2data x3data y3data
Thanks,
hiNi
Solved!
Go to Solution.
Attachments:
Append To file.vi ‏13 KB

Easiest is gathering the data and writing it all at once, as mentioned. I made a change to your VI doing that. You might need a Transpose array or 2 to get the look you want.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV
Attachments:
Append To file.vi ‏14 KB

Similar Messages

  • Summing 2D Array by Columns

    Im trying to sum a 2D array by column
    Say I have 5 rows and 5 columns im trying to get the sum of all the values in the second column.
    What I have so far and have been hassling with for a while is:
    public static float sumCol(int[][] table, int rowsize, int colsize)
          int[] c = new int[colsize];
          float sum=0;
          for (int row=0; row < rowsize; row++)
            for (int col=0; col < colsize; col++)
                c[col] = table [row][col];
                sum = myMethods.sum(c);
          return sum;the sum method calculates the sum of an array
    If you can help me and just give me some pointers on how to get this, 2D arrays I think play tricks on your mind.

    I dont understand why this is giving an out of bounds
    when i call it
    public static float sumCol(int[][] table, int
    rowsize, int colsize)
    int[] c = new int[colsize];
    float sum=0;
    for (int row=0; row < rowsize; row++)
    c[row] = table [row][colsize];
    sum = myMethods.sum(c);
    return sum;
    Because number of columns is not the same as number of rows.
    I still don't understand why you are creating an array. You don't need one.
    Kaj

  • Save System-Wide Column Formats privilege unavailable

    OBIEE 11.1.1.5
    I go into the Manage Privileges screen and under the Formatting->Save System-Wide Column Formats option, there are no roles listed
    and there doesn't appear to be any way to add a role. So now I have no way to save a system-wide default even logged in as an
    administrator. Every other privilege is fine except this one. Any ideas how this might have occurred and how to add a role to the
    privilege?

    MuRam,
    You are posting a link to OBIEE 10g documentation, when the OP has clearly stated he is dealing with OBIEE 11.1.5.
    I am facing the same issue - Manage Privileges > Formatting > Save System-Wide Column Formats - there is no link for me to click on that allows me to manage that privilege.
    Anyone know how to fix this?
    Thanks.

  • Save array data

    Hi all,
    I need help to solve a problem like following.
    I have a table 'results' with the columns
    result_id number PK
    method varchar2(200)
    readout varchar2(60)
    result number
    Also I have built a page with an array (realized through text fields) like this one:
    x1_1 x1_2
    x2_1 x2_2
    x3_1 x3_2
    x100_1 x100_2
    All elements in the array have the same method. In column readout the name of the array element has to be stored. The input of the text fields have to be stored in column result.
    I think an example makes it more clearly
    method = malinoe
    x1_1 = 15 x1_2 = 9
    x2_1 = 3 x2_2 = 7
    x3_1 = 10 x3_2 = 11
    x100_1 = 2 x100_2 = 3
    After fill in the values into the text field array you have to click the Button 'SAVE' and all values have to be stored in the table results:
    first row:
    result_id = 1
    method = malinoe
    readout = x1_1
    result = 15
    second row:
    result_id = 2
    method = malinoe
    readout = x1_2
    result = 9
    third row:
    result_id = 3
    method = malinoe
    readout = x2_1
    result = 3
    last row:
    result_id = 200
    method = malinoe
    readout = x100_2
    result = 3
    Has anybody an working example or idea how I can solve this problem?
    Thanks for help,
    ben
    Message was edited by:
    ben512

    I think that here is the best approach htmldb_collection.
    On load form fill the text items with data.
    On save fill the collection elements and then iterating through them save them in table.
    Here is QBE code for iteratiting through forms controls and if some control has name P||PAGE_ID_FIELD_NAME then this is ok control...Use just the logic of iteration through form items.
    Here is example from my source code:
    FUNCTION QBE (
            ln_page_id     NUMBER
          , ls_table    IN VARCHAR2
          , ls_select   IN VARCHAR2 DEFAULT NULL
          , ls_where    IN VARCHAR2 DEFAULT NULL
          , ls_order_by IN VARCHAR2 DEFAULT NULL
          , ln_search_type NUMBER   DEFAULT 3
          , ls_scope_mode  VARCHAR  DEFAULT 'U' 
              ) RETURN VARCHAR2
       AS  
         wrong_search_type EXCEPTION;
         wrong_date_field EXCEPTION;                
         wrong_scope_mode EXCEPTION;
        ls_sql       VARCHAR2 (32567 CHAR);
        lb_need_and  BOOLEAN := FALSE;
        lb_has_where BOOLEAN := FALSE;
        ls_field_name VARCHAR2 (128);
        lb_process_current_field BOOLEAN;
        lb_is_date_field BOOLEAN;
        -- lb_is_date_time_field BOOLEAN;
        lb_is_number_field BOOLEAN;
        lb_is_LOV BOOLEAN;
        lb_is_date_from BOOLEAN;
        c_collection VARCHAR2(32 CHAR) := 'DATE_USED_FROM'; 
       BEGIN
         HTMLDB_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION (c_collection);
         IF ls_scope_mode NOT IN ('U','A') THEN
           RAISE wrong_scope_mode;
         END IF;
          -- Create SELECT part of SQL Statement
          IF (ls_select IS NOT NULL) THEN
            ls_sql := ls_select;
          ELSE
            ls_sql := 'SELECT *';
          END IF;
          -- Create WHERE part of SQL Statement
          IF (ls_where IS NOT NULL) THEN
            ls_sql := ls_sql || ' from ' || ls_table || ' ' || ls_where || ' and ';
          ELSE
            ls_sql := ls_sql || ' from ' || ls_table || ' where ';
          END IF;
          -- Loop through each column in the table specified in ls_table and see if there is a corresponding
          --   HTML DB page item on the page specified in ln_page_id
          FOR x IN (SELECT column_name, data_type FROM USER_TAB_COLUMNS WHERE table_name = UPPER(ls_table) AND ls_scope_mode = 'U'
                    UNION 
                    SELECT column_name, data_type FROM ALL_TAB_COLUMNS WHERE table_name = UPPER(ls_table) AND ls_scope_mode = 'A') LOOP
            lb_is_date_field := FALSE;
            lb_is_number_field := FALSE;   
            --lb_is_date_time_field := FALSE;
            ls_field_name := 'P' || ln_page_id || '_' || x.column_name;
            <<PLAY_IT_AGAIN_SAM>>
            IF x.data_type = 'DATE' THEN
              lb_is_date_field := TRUE;
              ls_field_name := 'P' || ln_page_id || '_' || x.column_name|| '_FROM';
              lb_process_current_field := TRUE;
              lb_is_date_from := TRUE;
              FOR j IN (SELECT c001 FROM htmldb_collections WHERE collection_name = c_collection) LOOP
                IF j.C001 = ls_field_name THEN
                  lb_process_current_field := FALSE;
                  EXIT;
                END IF;
              END LOOP;
              IF lb_process_current_field THEN
                 HTMLDB_COLLECTION.ADD_MEMBER (p_collection_name => c_collection
                                             , p_c001            => ls_field_name
                                             , p_generate_md5    => 'NO');
              ELSE
                ls_field_name := 'P' || ln_page_id || '_' || x.column_name|| '_TO';
                lb_process_current_field := TRUE;
                lb_is_date_from := FALSE;
                     FOR j IN (SELECT c001 FROM htmldb_collections WHERE collection_name = c_collection) LOOP
                       IF j.C001 = ls_field_name THEN
                         lb_process_current_field := FALSE;
                         EXIT;
                       END IF;
                     END LOOP;
                 IF lb_process_current_field THEN
                    HTMLDB_COLLECTION.ADD_MEMBER (p_collection_name => c_collection
                                                , p_c001            => ls_field_name
                                                , p_generate_md5    => 'NO');
                 END IF;
              END IF;
              lb_process_current_field := V(ls_field_name) IS NOT NULL;
            ELSIF IS_NUMBER (V(ls_field_name) ) THEN
              lb_process_current_field := (V(ls_field_name) != -100);
              lb_is_number_field := TRUE;
            ELSE -- ovo je za sve ostale!
              lb_process_current_field := (V(ls_field_name) IS NOT NULL) AND NOT (V(ls_field_name) IN ('-100','%null%','null'));
            END IF;
            IF lb_process_current_field THEN
               .... then do your work....Of course you must obey naming convention - what I can see you have done that so your control name is like:
    x1_1 xi_2.
    Hope this helps

  • Visual C++, CMap object save to blob column

    I have a MFC CMap object, each object stores 160K~ entries of long data. I need to store it on Oracle SQL. we decided to save it as a blob. since we do not want to make additional table. we also thought about saving it as local file and point the SQL column to that file, but we rather just keep it as blob on the server and clear the table every couple of weeks.
    The table has a sequential key as ID, and 2 column of time. I need to add the blob column in order to store on every row that CMap.
    Can you recommend a guide to do so (read/write Map to blob or maybe a clob) ? Thanks.

    The LOB exists in server memory. Your code cannot access that memory for a memcpy or similar calls. Your code deals with a LOB locator variable (another name for a pointer) - and casting this makes no sense. Casting it does not deference it.
    The DBMS_LOB PL/SQL interface exposes the basic interface for LOBs. This, and client drivers, use the OCI (Oracle Call Interface) under the hood.
    The OCI provides a ranges of features - including binding host variables (variables in your code) to bind variables (variables in PL/SQL and SQL calls to the database). See Oracle® Call Interface Programmer's Guide for binding LOBs.
    The functionality of the OCI needs to be exposed by whatever db abstract interface you use. If it does not do that properly, then you can use PL/SQL as the interface. Or call the OCI directly.

  • Apache FOP PDF Save in BLOB column

    Hi,
    I just want to call Apache FOP in an APEX process to create PDF reports and save these reports in a BLOB column in the same database. So I can email these reports in another process using APEX_MAIL. Does anyone know a way to achieve this?
    Thanks

    If I understand correctly, your requirements needs to be broken down into two problems:
    1) click link that pops up a window displaying a new APEX page
    2) an APEX page the displays the document, not downloads it.
    I haven't done #1 (yet).
    However, you may be able to generate a URL that points to the new page as part of the SELECT statement for the Report.
    This has a related question, but no answer yet:
    open pdf in popup browser window
    The key is target="_blank" for the anchor tag.
    To generate the URL, you should use the APEX_UTIL.prepare_URL() function.
    If that doesn't work, a Dynamic Action that does some magical JavaScript stuff may be needed.
    For #2, I lost the URL that showed how to display a PDF as part of a "form" page.
    From what I remember:
    Start with a blank page with one blank HTML region (all the Items go in the HTML region)
    Add an Item for the PK/Doc_ID
    part I forgot Create a Data Manipulation Process
    - Automated Row Fetch
    - On Load - After Header
    - (stuff for your table/view)
    part I forgot Create an (I believe) "File Browser" item type. For Settings:
    - Storage Type "BLOB column specified in Item Source" (and place the column name of the BLOB there)
    - MIME Type Column: (column name) -- since you have multiple types, this is a MUST HAVE
    - Filename Column: (column name) -- I highly recommend you have this.
    - Content Disposition == INLINE <-- this is the kicker
    Also, you will need a Browser Plugin for each of the MIME Types (otherwise, the browser may try to 'download' the file)
    Browsers can handle Image types internally. Adobe's plugin can handle PDFs. I don't know about Word/Excel.
    Again, I don't remember the exact details, but that should cover most of it.
    MK

  • How do you save arrays in tdm files?

    Hi,
    As part of a university project I am trying to save some program data to a .tdm file.  On each channel I wanted a number of different types of data including an analogue wave form and a couple of 1-D DBL arrays.  I have found an NI presentation that says that you can store arrays in them but dont seem to be having any luck.  Any ideas what Im doing wrong?  I am using labview 8.5.
    Regards,
    James

    Hi James,
    in a channel, you can save only one array as data. If you want to save more arrays then use several channels. You can organize them in groups. If the arrays must be in the same channel, then convert them to a spreadsheet string (in string palette) and save the string as a property.
    Greetings,
    shb

  • How do I automatically save array data to a spreadsheet?

    I am setting up a 24 hour test where I would like the gathered array data to automatically save to a spreadsheet every 4 hours. Is there a way to set this up with the Write to Spreadsheet file.vi?
    Solved!
    Go to Solution.

    Sure, you just need a timer that will  tell you when the 4 hours are up.  Take a look at the attached timer, I picked it up on these forums a while ago but I cant remeber who to give credit to for it*.  Just use this timer to trigger a case structure holding the write to spreadsheet function.
    *It is from Bloomy controls
    Message Edited by jmcbee on 03-17-2009 09:39 AM
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Interval Timer.vi ‏21 KB
    Delta Time.vi ‏22 KB

  • Arrays for column data issue

    Post Author: paul.carpenter
    CA Forum: Formula
    Good afternoon all,I'm working on what I thought was a fairly simple report, but have now hit a wall.I have a 1 to many table relationship that requires me to put several fields into columns instead of details.I'm running CRXI with a Progress DB backend.Structure looks as follows: (linked by Product)Table1ProductTable2Product, InventoryType, QuantityData as follows:Product100200300Product,InventoryType,Quantity100,A,15100,B,35100,C,22200,B,25300,C,34What I would like to get out of the report is:Product    InvType-A    InvType-B    InvType-C 100                15                    35                    22                200               0                      25                0300                0                        0                    34I tried building an array on the detail line and filling it based on the InvType then pulling the data out in the summary, but it's just not working for me.Would anyone be willing to give me some insight, perhaps a simple .RPT?Thanks!-email- pauliamspamdot carpenter at empiredie dot com  (remove iamspam)

    Post Author: paul.carpenter
    CA Forum: Formula
    Well that gets data for me, but I can't have the totals and all the headings as I have a lot more data being reported on.I will try and put it into a 2nd footer section, suppress it and pull the fields into formulas to place in the group footer. EDIT: scratch that, can't pull the data out of the cross tab. 

  • How to save data in columns with headers?

    I'm trying to save 10 different types of data into individual columns with headers, but I can either get one giant column of data with the given header at the start of each data set (imbeded in the column) or I can get the headers in different columns, but the data all in one row. This seems like a simple problem, but for the life of me I can't figure it out--HELP!
    I've attached my code...don't laugh, I think I've created a monster trying to figure this out. What I'm trying to get is one column with the header "Power (watts)" and then the power data in that column, one column with the header "angular acceleration (rad/s^2)" and then the angular acceleration data in that column, and so on...
    Thanks!
    Attachments:
    RILE-25.vi ‏335 KB

    Hi
    Take a look at this VI / Block diagram pic
    Here, I am demonstrating how to write data to a file column wise along with relevant column headers
    Hope this helps
    Regards
    Dev
    Attachments:
    header_column data.JPG ‏49 KB
    header_column data.vi ‏20 KB

  • Project save as changes columns displayed

    I use Project Server 2010 and Project Professional 2010.
    One user has a problem on her specific machine that I cannot reproduce on mine. When she opens a project and does 'save as', the version that is saved shows different columns to the ones that were in the original file. For example, the original file had
    'work' displayed and the new one shows 'duration' but not work.

    HFprojects,
    Since I don't use Project Server I'm not familiar with how a local Global file interacts with the Enterprise Global file but it does sound like the user's machine is responding to a local Global that is different from the Enterprise Global used by others
    in the Project Server environment. You could try the following:
    1. Close Project
    2. Find the user's working Global (should be C:\users\[PC name]\App Data\Roaming\Microsoft\MS Project\14\1033) and move it to the trash
    3. Open Project and see if it now works correctly
    John

  • Trying to save array database

    I'm having difficulty saving my database and restoring for my array. I think the problem is that I used the ArrayList class rather than making my own. I know how to do a save if I make the array, but I can't seem to get it to work with the ArrayList class. I'm required to use the ArrayList class for my array rather than make my own, but I also need to have the ability to save. If anyone has the time, I'd really appreciate some input
    Thanks
    MAIN:
    import java.util.*;
    import javax.swing.*;
    public class SquiresProject1 {
         public static void main(String[] args) throws Exception {
              int menuCode, add, delete;
              boolean search = false, repeat = false, done = false;
              String saveChoice;
              //new record meant for an array of 10 in CreativeResources
             ArrayList customer = new ArrayList(10);
              SquiresSave save = new SquiresSave();
             //open file with saved data
              //control loop - enter 0 when finished
             while (!done) {
                   //prompt, get menuCode, parse into an integer
                  menuCode = Integer.parseInt(JOptionPane.showInputDialog(null,
                       "1. Add customer"
                            + "\n2. Delete customer"
                                 + "\n3. Search for a customer"
                                      + "\n4. List all customers"
                                           + "\n5. Save your progress"
                                                + "\n6. Restore from last save point"
                                                     + "\n **Enter 0 to end program**"
                                                          + "\n Please enter a choice: "));
                   switch (menuCode) {
                        //end loop and program
                        case 0:
                             done = true;
                             break;
                        //search for duplicates and add customer
                        case 1:
                             String customerToAdd = JOptionPane.showInputDialog(null,
                                  "Customer's name: ");
                             repeat = customer.contains(customerToAdd);
                             if (repeat == false){
                             customer.add(customerToAdd);
                             JOptionPane.showMessageDialog(null, customerToAdd + " was successfully added to the list");
                             else
                             JOptionPane.showMessageDialog(null, "Sorry, but " + customerToAdd + " is already in the list");
                                                      break;
                        //sort, search for and delete customer
                        case 2:
                             String customerToDelete = JOptionPane.showInputDialog(null,
                                  "Customer to delete: ");
                             customer.remove(customerToDelete);
                             JOptionPane.showMessageDialog(null, customerToDelete + " was successfully removed");
                             break;
                        //sort, search for customer
                        case 3:
                        String customerToSearch = JOptionPane.showInputDialog(null,
                                  "Customer to search for: ");
                             search = customer.contains(customerToSearch);
                             if (search == true){
                             JOptionPane.showMessageDialog(null, customerToSearch + " is in the database");
                             delete = JOptionPane.showConfirmDialog(null, "would you like to delete " + customerToSearch + "?", "Run Again Dialog",     JOptionPane.YES_NO_OPTION);
                                  if (delete == JOptionPane.YES_OPTION){
                                customer.remove(customerToSearch);
                                  JOptionPane.showMessageDialog(null, customerToSearch + " was successfully removed");
                             else
                             JOptionPane.showMessageDialog(null, "Sorry, but " + customerToSearch + " is not in the database");
                             break;
                        //sort, traverse and list array
                        case 4:
                                  JOptionPane.showMessageDialog(null, customer.toArray());
                                                      break;
                        //sort, save progress
                        case 5:
                        save.saveData();
                                                      break;
                        //restore from last save
                        case 6:
                             save.restoreData();
                             break;
                        //invalid choice - ask for input again
                        default:
                             JOptionPane.showMessageDialog(null, "Bad input. Read the choices carefully!");
              //prompt to save data
              saveChoice = JOptionPane.showInputDialog(null,
                   "Would you like to save your data? y/n?");
              if ((saveChoice.equalsIgnoreCase("y")) || (saveChoice.equalsIgnoreCase("yes"))) {
                   save.saveData();
              else
                   JOptionPane.showMessageDialog(null, "You chose not to save your data.\nData not saved!");
              //closing
              JOptionPane.showMessageDialog(null, "Program ending.  Have a nice day!");
    }MY ATTEMPT AT A SAVE/RESTORE METHOD CLASS:
    import java.io.*;
    import java.util.*;
    public class SquiresSave{
    public static int DEFAULT_SIZE = 10;
    private int countOfCustomers;
    private String[] customers;
    private int customerPosition;
         public SquiresSave(int maxCustomers) {
              customers = new String[maxCustomers];
              countOfCustomers = 0;
              customerPosition = 0;
         //constructor
         public SquiresSave() {
              customers = new String[DEFAULT_SIZE];
              countOfCustomers = 0;
              customerPosition = 0;
         public void saveData() {
              int writeCount = 0;
              try {
                   //open database.txt and write array to it
                   PrintWriter outputStream = new PrintWriter(new FileOutputStream("database.txt"));
                   while (writeCount < (countOfCustomers)) {
                        outputStream.println(customers[writeCount]);
                        writeCount++;
                   //close database.txt
                   outputStream.close();
                   System.out.println("Data saved to file: database.txt");
              //catches all IOException errors
              catch (IOException e) {
                   System.out.println("Error writing to file database.txt.\nData not saved!");
    ////////////////////////////////////restores data///////////////////////////////////////
         public void restoreData() {
              try {
                   //open database.txt
                   BufferedReader inputStream = new BufferedReader(
                        new FileReader("database.txt"));
                   String line = inputStream.readLine();
                   countOfCustomers = 0;
                   //read and assign lines to customers until customers is full or file is completely read
                   while ((line != null) && (countOfCustomers < customers.length)) {
                        customers[countOfCustomers] = line;
                        countOfCustomers++;
                        line = inputStream.readLine();
                   inputStream.close();
                   System.out.println("Data restored from file database.txt");
              catch(FileNotFoundException e) {
                   System.out.println("Error reading input file: database.txt.\nData not restored!");
              catch(IOException e) {
                   System.out.println("Error reading data from database.txt.\nData not restored!");
    }

    Hi,
    at first you have to pass the data to your save method and get it from your restore method. You can do that simply with a argument in the methods. See http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html.
    In your example, you could use
                        //sort, save progress
                        case 5:
                             save.saveData(customer);
                             break;
                        //restore from last save
                        case 6:
                             save.restoreData(customer);
                             break;
    ...Then your save/restore methody could look like:
         public void saveData(ArrayList<String> customer) {
              try {
                   //open database.txt and write array to it
                   PrintWriter outputStream = new PrintWriter(new FileOutputStream("database.txt"));
                   for (ListIterator i = customer. listIterator(); i.hasNext();) {
                        outputStream.println((String)i.next());
                   //close database.txt
                   outputStream.close();
                   System.out.println("Data saved to file: database.txt");
              //catches all IOException errors
              catch (IOException e) {
                   System.out.println("Error writing to file database.txt.\nData not saved!");
    ////////////////////////////////////restores data///////////////////////////////////////
         public void restoreData(ArrayList<String> customer) {
              try {
                   //open database.txt
                   BufferedReader inputStream = new BufferedReader(
                        new FileReader("database.txt"));
                   String line = "";
                                        customer.clear();
                   //read and assign lines to customers until customers is full or file is completely read
                   while ((line = inputStream.readLine()) != null) {
                                           customer.add(line);
                   inputStream.close();
                   System.out.println("Data restored from file database.txt");
              catch(FileNotFoundException e) {
                   System.out.println("Error reading input file: database.txt.\nData not restored!");
              catch(IOException e) {
                   System.out.println("Error reading data from database.txt.\nData not restored!");
    ...And please deal with generics. See http://java.sun.com/docs/books/tutorial/extra/generics/index.html. Then you can declare the ArrayList better as ArraList<String>.
    greetings
    Axel
    Edited by: Axel_Richter on Sep 22, 2007 8:48 AM

  • Save array control to .cfg with property nodes.

    Hi there!
    I have a front panel with many (and I mean many!) boolean arrays in tabs, and I want the option to save the values selected by the user to a .cfg file, which will be used to make the same selection again without the tedium of clicking on buttons. The only controls I want to save the value of are 1D boolean arrays of length 7 or 11, and these occur only on some of the tab pages; the others have been setup so that on their iteration a false criteria is met and no code executes.
    I have managed to get references to each control in each tab, and using a 'more specific class' function to narrow it down to Array controls only. However, when this runs, an error from 'convert variant to data' pops up, and use of a probe tells me the reference being called by my property node at the time of the error is that of an array INDICATOR, rather than a control. I thought the 'controls on page' node and subsequently the array control class specifier would mean that references for other types of array wouldn't make it into the true case where the saving to config file happens.
    The indicator in question is an array of a cluster of two strings and a string array, if that makes any sense/has any relevancy, and the error occurs on iteration 1 of the outer loop and iteration 21 of the inner loop, corresponding to the 22nd control reference from the second tab.
    I hope I've made the problem clear.

    There is a property called Is Control? (or Is Indicator?) that will help you sort them out.  I do not recall the exact name of the property but that should get you close enough to find it.
    Lynn

  • Printing Array in columns

    Kinda new to Java and I need to know how I could modify my code to print in a specfic format. I am attempting to print 1000 numbers and this sequence style just is to long for any decent screen.
    I'd like to make it where the info would print in 5 columns:
    array[0] array[1] array[2] array[3] array[4]
    array[5] array[6] array[7]......
      public static String printArray(int array[])// prints an array in sequence
        String output = "";
        for (int i = 0; i < array.length; i++)
          output += array[i] + " ";     
      return output;I'm guessing this would be done in some type of loop but I have no clue how to go about it, I've attempted several times and am getting a little flabergasted.

    As kajbj said. Here's the complete code...
    public static String printArray(int array[])// prints an array in sequence
        StringBuilder output = new StringBuilder();
        for (int i = 0; i < array.length; i++)
          output.append(array);
    if( (i+1)%5 == 0)
    output.append("\n");
    return output.toString();

  • -= Save array to file =-

    Hi, I need to write big ArrayList to text file, but I can't find how to do it at once. I've tried this conbination:
    ArrayList alWords = new ArrayList();
    OutputStream out = new BufferedOutputStream(
        new FileOutputStream("erd.txt"));
    out.write(alWords); // ??????????????Thanks in advance.

    back agian, btw, im at school, making it difficult to make a coherent post,
    sorry I didnt include any smaple code before, to serialize,
    you would construct the ObjectOutputStream, and then connect it to a FileOutputStream
    like this:
    ObjectOutputStream oos=new ObjectOutputStream(newFileOutputStream("FILE.dat"));
    and then
    oos.writeObject(YOUR_OBJ);
    I dont have a book infont of me, but i think that is it, hope it helps,
    ~Andy

Maybe you are looking for