Using an array within an array, and exporting to CSV

I am gathering data about an AD user, including group membership and I want to output that to a CSV. Easy enough right? Not so much :) I am successfully generating 2 arrays, one has user data and the 2nd has group membership, but it's not exporting properly
to CSV. I've tried the -notypeinformation but it's still showing up.
My code is below, followed by contents of CSV file in text format.
cls
#declare array to use
$user_main = @()
$arrGroups = @()
$user = Get-ADUser -Filter {samaccountname -eq "MyUserName"} -Properties *
$temp_user.Name = $user.Name
$temp_user.SAMname = $user.SamAccountName
$temp_user.lastpwchange = $user.PasswordLastSet
$temp_user.lastlogon = $user.LastLogonDate
#get group membership
$groups = $user.memberof
foreach ($group in $groups)
$temp1 = $group.Split(",")
$group_name = $temp1[0].Substring(3, $temp1[0].Length -3)
#$arrGroups += New-Object -TypeName psobject -Property $temp
$arrGroups += $group_name
$user_main += New-Object -TypeName psobject -Property $temp_user
#$user_main | select * | Format-Table
#$arrGroups
$new = $user_main + $arrGroups
Export-Csv -InputObject $new -Path c:\test\test.txt -NoTypeInformation -Encoding "utf8"
Write-Host ""
Write-Host "Done"
The resulting text file contains:
"Count","Length","LongLength","Rank","SyncRoot","IsReadOnly","IsFixedSize","IsSynchronized"
"45","45","45","1","System.Object[]","False","True","False"
So I have 2 issues. One is the "export-csv -notype" isn't working quite right, not sure why. And secondly, you can see the System.Object[] entry, which I believe is my array of groups. I need that to display the names of the groups the user belongs
to.
Any help is greatly appreciated!

Hi Robert,
I’m writing to just check in to see if the suggestions were helpful. If you need further help,
please feel free to reply this post directly so we will be notified to follow it up.
If you have any feedback on our support, please click here.
Best Regards
Anna
TechNet Community Support

Similar Messages

  • Can't duplicate movieclips as an array within an array

    Hello.
    I have an animation that loads an xml into it and traces back
    an array within an array. I have tried to apply this to duplicated
    movieclips thereby creating a structured set of links. What I am
    trying to do is this:
    Chicken Nuggets
    __Compression
    __Texture
    __Disgust
    Mega Warhead
    __Taste
    __Hardness
    __Pain
    This traces fine but I can't seem to get the duplicated
    movieclips to assemble in this fashion.
    The code for the XML is as follows:
    var controlArray:Array;
    var variable:Array;
    var testTopic = new Array ();
    var test = new Array ();
    var controlsXML:XML = new XML();
    controlsXML.ignoreWhite = true;
    controlsXML.onLoad = function(success:Boolean){
    if (success){
    var mainnode:XMLNode = controlsXML.firstChild;
    var controlNodes:Array =
    controlsXML.firstChild.firstChild.firstChild.firstChild.childNodes;
    var list:Array = new Array();
    for (var i:Number = 0; i < controlNodes.length; i++) {
    var personnode:XMLNode = controlNodes
    .attributes.Name;
    trace(personnode);
    testTopic.push (new struct (personnode));
    var specificNode:Array = controlNodes.childNodes;
    for (var j:Number = 0; j < specificNode.length; j++){
    var itemnode:XMLNode = specificNode[j].attributes.Variable;
    trace(itemnode);
    test.push (new struct2 (itemnode));
    printer ();
    printer2 ();
    } else {
    trace('error reading XML');
    controlsXML.load ("controls3.xml");
    The code for the movieclip duplication is as follows:
    x = 50;
    function printer ()
    for (m = 0; m < testTopic.length; m++)
    duplicateMovieClip ( slotTopic, "slotTopic" + m, m );
    slotTopic = eval ( "slotTopic" + m );
    slotTopic._y += x;
    slotTopic.slotTopicContent.text = testTopic[m].personnode;
    function printer2 ()
    for (k = 0; k < test.length; k++)
    duplicateMovieClip ( slot, "slot" + k, k );
    slot = eval ( "slot" + k );
    slot._y += x;
    slot.slotContent.text = test[k].itemnode;
    function struct (personnode)
    this.personnode = personnode;
    function struct2 (itemnode)
    this.itemnode = itemnode;
    On the stage are two movieclips, titled "slotTopic" and
    "slot". Within those are dynamic text boxes titled respectively
    "slotTopicContent" and "slotContent". When I preview this file it
    only displays the text within the "slot" movieclip and it lists all
    six of the subtopics with no break. So, there are two dilemmas:
    1) The movieclips won't duplicate into the structured set of
    links that I want.
    2) "slotTopic" is not displaying text at all.
    If anyone has any advice, I'd really appreciate it.
    Thx!

    ok, I'm sorry but there are quite a few things wrong here.
    first though, when posting code please use the 'attach code'
    button.
    1) i can't imagine that you have a XML structure as deep as
    your calling to or the need for it with the limited amount of
    infomation your pulling, in addition your storing the info in
    attributes, so I can't see how this would work, it may 'trace' out
    the right text (somehow) but it's not getting into the arrays
    properly.
    2) you do not assign an attribute value to a XMLNode, and
    then try to push it into an array.
    3) you do not call a method (struct or struct2) using the
    'new' operator. this is how you envoke a new 'class' instance.
    4) do not use 'x' as a variable name as it is a reserved var
    in flash, assigned to an Object instance.
    5) the duplicateMovieClip() method needs to be called upon
    the existing clip as in:
    slotTopic.duplicateMovieClip('slotTopic'+m, m);
    additionally you can pass the _y placement within the
    initObject.
    6) you do not need to use eval, it isn't doing anything here,
    you will gain the correct path by calling duplicateMovieClip
    correctly.
    7) the reason why slotTopic is not being displayed at all is
    because of the second loop, you are duplicating the clips
    (incorrectly) into the same depths thereby replacing all of the
    contents of the slotTopic depths previously constructed.
    the solution to this problem is to construct both items with
    the same loop but increament one of the depth assignments by a
    specific number, in other words at depths much higher or at least
    different, than that of the first element, as in:
    slotTopic.duplicateMovieClip('slotTopic'+m, m, {_y:50});
    slot.duplicateMovieClip('slot'+(m+100), m+100, {_y:50});
    again I'm sorry man, but it will take some work to sort this
    out.

  • How to add an Array within an array?

    Hi friends can any body guides me how to add array within array.
    Actually i am getting Array from server side and i have to append one more node(Array) in same array and send it back to them.
    here is the structure of my array that i am getting from server side.
    temp = Array (@4445e09)   
        [0] = mx.utils.ObjectProxy (@4314821)   
            Mylanguages = Array (@4445b69)   
                [0] = Object (@449ac91)   
                    Mylanguage = "English"   
                    Mylanguage_code = "EN"   
                    Mylanguage_id = "1"   
                    selected = "Y"   
                length = 1   
            currentpage = "1"   
            definition_id = "20"   
            delete_record = "Y"   
            edit_record = "Y"   
            insert_record = "Y"   
            numberofpages = "1"   
            numberofrecords = "1"   
            object = Object (@4432449)   
            productgroups = Array (@43cea51)   
            type = null   
            uid = "111111"   
        length = 1
    I have to add an array similar to like Mylanguages  containing object which contain some info like some ids. and my array becomes
    ttemp = Array (@4445e09)   
        [0] = mx.utils.ObjectProxy (@4314821)   
            Mylanguages = Array (@4445b69)   
                [0] = Object (@449ac91)   
                    Mylanguage = "English"   
                    Mylanguage_code = "EN"   
                    Mylanguage_id = "1"   
                    selected = "Y"   
                length = 1   
            currentpage = "1"   
            definition_id = "20"   
            delete_record = "Y"   
            edit_record = "Y"   
            insert_record = "Y"   
            numberofpages = "1"   
            numberofrecords = "1"   
            object = Object (@4432449)   
            productgroups = Array (@43cea51)
           AddedNOde= Array (@4445b69)   
                [0] = Object (@449ac91)   
                    id= "10"   
                    tempId= "100"   
                    Mylanguage_id = "1"   
                length = 1           
            type = null   
            uid = "111111"   
        length = 1   
    please tell me how it possible.
    Thanks in Advance
    Regards
    Vineet osho

    Hi Vineet,
    You can simply add another Array as shown below:
    for each(var obj:Object in temp)
         obj.AddedNOde = YourNewArray;
    By doing above NewArray is added to  all the objects of temp Array.
    Thanks,
    Bhasker
    Message was edited by: BhaskerChari

  • I exported a iphoto slideshow to desktop, converted it to mpg file by using BURN app, burned to DVD and exported to a USB flashdrive. The DVD looks great but flashdrive is extremely fuzzy. What is the difference and how can I make flashdrive sharper?

    I exported an iphoto slideshow to desktop, converted it to mpg file by using the BURN app, burned it to a DVD and exported it to a USB flash drive. The DVD looks great and very sharp but the slideshow on the USB flash drive is extremely fuzzy. What is the difference and how can I make the slideshow on the flash drive look as sharp as the DVD?

    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  For iPhoto 9.4.3 and earlier select Size = Medium or Large. For iPhoto 9.5 and later selct 480p.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best quality video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process.
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailer like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago.
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them.
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.

  • ¿How to get activities templates collection from sr template and export to csv using powershell?

    Hi friends.
    I want to build a script that obtains the collection of activities templates from a sr template (filtering the sr template by displayname)  and export the list (template activities displaynames) to csv file.
    Thanks for advance.
    Cheers

    Import-Module SMLets -Force
    $templateName =  "SS-Internas" 
    $template = Get-SCSMObjectTemplate -DisplayName $templateName
    $templateAct = $template.ObjectCollection.PropertyCollection | Where { $_.Path  -eq '$Context/Property[Type=''CustomSystem_WorkItem_Library!System.WorkItem'']/Title$'}
    $report=@()
    foreach($value in $templateAct.MixedValue){
    $obj = New-Object PSObject -Property @{
    "DisplayName" = $value 
    $report += $obj
    $filePath = "E:\ACT_"+$templateName+".csv"
    $report | export-csv $filePath -NoTypeInformation -Encoding UTF8
    (Get-Content $filePath) | % {$_ -replace '"', ""} | out-file -FilePath $filePath -Force -Encoding UTF8

  • Import from dsv files and export to csv files

    hi every body..
    how can I create a project in NetBeans which does:
    1- import a .dsv (Delimiter-Separated Values) file content and save it to array
    - the values in this format separated by fixed commas
    example
    "AIG" "Insurance" "64.91" "25/11/06"
    2- export into .csv file (Comma Separated Value)
    -the values in this format separated by commas
    example:
    AIG,Insurance,64.91,25/11/06

    Well, you need to learn Java so you can read files, divide the data by the delimiters, and then write it out as a csv file.
    Can't really give better instructions than that...maybe start by reading the basic tutorials?
    We don't give out full program code here so you'll need to ask more precise questions. Such as what is it that you're having problems with.

  • Problem in using CLOB Data from a Data and exporting into File

    Hi,
    UTL_FILE Error Occured while using UTL_FILE with CLOB Data.
    UTL_FILE: A write error occurred.
    The Below Code is for reference:
    DECLARE
    C_AMOUNT CONSTANT BINARY_INTEGER := 32767;
    L_BUFFER VARCHAR2(32767);
    L_CHR10 PLS_INTEGER;
    L_CLOBLEN PLS_INTEGER;
    L_FHANDLER UTL_FILE.FILE_TYPE;
    L_POS PLS_INTEGER := 1;
    BEGIN
         FILE_NAME:=UTL_FILE.FOPEN('EXPORT_DIR','EXPORT_FILE'||'.sql','W');
         FOR C1_EXP IN (SELECT INSERT_STRING FROM EXPORTED_DUMP) LOOP
         L_CLOBLEN := DBMS_LOB.GETLENGTH(C1_EXP.INSERT_STRING);
         DBMS_OUTPUT.PUT_LINE('THE CLOB LEN '||L_CLOBLEN);
         DBMS_OUTPUT.PUT_LINE('THE POSITION '||L_POS);
         WHILE L_POS < L_CLOBLEN LOOP
    L_BUFFER := DBMS_LOB.SUBSTR(C1_EXP.INSERT_STRING, C_AMOUNT, L_POS);
         DBMS_OUTPUT.PUT_LINE('THE BUFFER IS '||L_BUFFER);
    EXIT WHEN L_BUFFER IS NULL;
    UTL_FILE.PUT_LINE(FILE_NAME, C1_EXP.INSERT_STRING);
    L_POS := L_POS + LEAST(LENGTH(L_BUFFER)+1,c_amount);
    END LOOP;
         END LOOP;
    UTL_FILE.FCLOSE(FILE_NAME);
    EXCEPTION
    WHEN UTL_FILE.INTERNAL_ERROR THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: An internal error occurred.');
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_FILEHANDLE THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: The file handle was invalid.');
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_MODE THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: An invalid open mode was given.');
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_OPERATION THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: An invalid operation was attempted.');
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_PATH THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: An invalid path was give for the file.');
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.READ_ERROR THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: A read error occurred.');
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.WRITE_ERROR THEN
    DBMS_OUTPUT.PUT_LINE ('UTL_FILE: A write error occurred.');
    UTL_FILE.FCLOSE_ALL;
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('Some other error occurred.');
    UTL_FILE.FCLOSE_ALL;
    END;

    Hi user598986!
    OK, I understood that there is a problem with your code. But please would you be so kindly to tell us here what error exactly happens (the errormessage). Mabay after that someone will be able to help you.
    yours sincerely
    Florian W.
    P.S. If you enclose your code into tags it will be shown formated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can I use Adobe PS Elements to edit and export photos for the Web?

    I want to change the image resolution, size and file format.

    Or from the menu in Expert Mode:
    Image >> Resize >> Image Size
    Then save in your preferred format:
    File >> Save As

  • How to Query remote PC's registry by OU for 2 values and export to CSV file.

    I'm new to scripting and to Powershell but this is what I have managed to put together so far. Of course it fails. We have two custom entries in the registry that I want to query remote workstations for these values, Monitor 1 and Monitor 2. Output to a
    CSV along with the workstations name. Because of our AD structure I figured its just easier to input the OU individually as seen in the script. That portion of the script seems to work. I get the following error in bold when I run the script: I've Google'd
    and tinkered with this for a week now with no resolution and seem to be going in circles.  And yes, I had help to get this far.
    Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found.
    At C:\utils\RegMonitor2.ps1:33 char:5
    +     $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.pro ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : IOException
    Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found.
    At C:\utils\RegMonitor2.ps1:33 char:5
    +     $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.pro ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : IOException
    # 1) Searches Active Directory for all Computers under said OU
    # 2) Searches remote registry of those machines for the mentioned Monitor and Monitor2 subkeys.
    # 3) Exports CSV (Can be opened and saved as excel format later) with ordered columns Computername, Monitor1 value, monitor2 value.
    # ================================================================
    $SearchPath = "OU=XXX,OU=XXX,OU=XXX,DC=XXX,DC=XXX,DC=XXX"
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
    $objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$SearchPATH")
    $objSearcher.PageSize = 1000
    $objSearcher.Filter = "(objectClass=computer)"
    $objSearcher.SearchScope = "Subtree"
    $colProplist = "name"
    $colResults = $objSearcher.FindAll()
    $Store = @()
    $Hive = [Microsoft.Win32.RegistryHive]"LocalMachine";
    foreach ($result in $colResults)
    # Use $result.properties.name to retreive ComputerName
    $obj = New-Object PsObject
    $obj | Add-member -type noteproperty -name "Computername" -Value $result.properties.name
    $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.properties.name);
    $ref = $regKey.OpenSubKey("SYSTEM\CurrentcontrolSet\control\Session Manager\Environment");
    $obj | Add-member -type Noteproperty -name "Monitor1" -value $ref.OpenSubKey("Monitor")
    $obj | Add-member -type Noteproperty -name "Monitor2" -value $ref.OpenSubKey("Monitor2")
    $store += $obj
    $store | Select-Object Computername,Monitor1,Monitor2 | Export-CSV -noTypeInformation -Path "Pathtosave.csv"
    People are always promising the apocalypse. They never deliver.
    Ok, I have modified the end of the script a bit, and no more error: Instead I get an unexpected output.
    foreach ($result in $colResults)
        # Use $result.properties.name to retreive ComputerName
        $obj = New-Object PsObject
        $obj | Add-member -type noteproperty -name "Computername" -Value $result.properties.name
        $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.properties.name);
        $ref = $regKey.OpenSubKey("SYSTEM\CurrentcontrolSet\control\Session Manager\Environment");
        $obj | Add-member -type Noteproperty -name "Monitor1" -value $ref.OpenSubKey("Monitor")
        $obj | Add-member -type Noteproperty -name "Monitor2" -value $ref.OpenSubKey("Monitor2")
        $store += $obj
    $store | Select-Object Computername,Monitor1,Monitor2 | Export-CSV -noTypeInformation -Path "C:\Utils\Data.csv"
    Unexpected output:
    "Computername","Monitor1","Monitor2"
    "System.DirectoryServices.ResultPropertyValueCollection",,
    "System.DirectoryServices.ResultPropertyValueCollection",,
    "System.DirectoryServices.ResultPropertyValueCollection",,

    Hi,
    What do your registry values look like in the Monitor and Monitor2 subkeys?
    EDIT: This might help:
    # Retrieve list of computers using Get-ADComputer and process each
    Get-ADComputer -Filter * -SearchBase 'OU=Test PCs,DC=domain,DC=com' | ForEach {
    # Verify PC is alive
    If (Test-Connection $_.Name -Quiet -Count 1) {
    # Connect to registry
    $remoteHive = [Microsoft.Win32.RegistryHive]“LocalMachine”;
    $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($remoteHive,$($_.Name))
    # Open the Environment key
    $ref = $regKey.OpenSubKey('SYSTEM\CurrentcontrolSet\control\Session Manager\Environment')
    # Create an ordered hashtable with the data from string values named 'String Value One/Two' in Monitor and Monitor2 subkeys
    # You'll need to adjust these values based on your actual data
    # If you are running v2, remove [ordered] below (so the line reads $props = @{)
    $props = [ordered]@{
    Computer=$_.Name
    Monitor =$ref.OpenSubKey('Monitor').GetValue('String Value One')
    Monitor2=$ref.OpenSubKey('Monitor2').GetValue('String Value Two')
    # Create a custom object based on the hashtable above
    New-Object PsObject -Property $props
    } | Sort-Object Computer | Export-Csv .\MonitorRegistryCheck.csv -NoTypeInformation
    # The line above sorts the output object by the computer name and then exports the object to a CSV file
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Special characters and exporting to CSV

    I'm trying to concatentate a number of strings and cells containing strings to return a single string which will also contain double and single quotes. Such as
    "The is 'my' return string and I need "this" in double quotes".
    Is this possible?
    The second part of this is that i then need to export this as a CSV file however when I've exported double and single quotes from Numbers they appear in the CSV as some unprintable weird figure rather than " and '.
    Any suggestions would be greatly appreciated, I can't see any documentation going to this level of detail. I've never had this issue with other spreadsheet programs.
    Thanks,

    oops
    I used smart double quotes not smart single ones.
    I edited the doc and here are curly single quotes.
    imported in neoOffice with utf8
    imported in neoOffice with macRoman
    imported in openOffice with utf8
    imported in openOffice with macRoman
    You may find the files in my iDisk :
    <http://public.me.com/koenigyvan>
    Download :
    For_iWork:iWork '09:for_Numbers09:around CSV.zip
    CAUTION
    As my system is French, the CSV are using the semi-colon as separator.
    Take care of that when you import in one Office application.
    I just wish to add that opening a csv describing a spreadsheet in TextEdit is a bit curious
    Yvan KOENIG (VALLAURIS, France) mercredi 14 avril 2010 16:18:16

  • Array that is dynamic and multidimensional

    I have a 2 dimisional string array that I'd like to remove records from.
    It seems a simple thing but I'm haveing trouble finding a solution.
    I see things on sets and arrylist etc but all examples are a single dimision.
    There are resultsets that are related to SQL statement that is close but I already have and array that did not come from a SQL statement.
    Is there a java class that can help me with this?

    Using your suggestion and some help from other post in this forum I was able to build this sample code.
    Using this, it is relitivly simple to get data in but it is more difficult to update or get data out of.
    I will likely continue to build on this till it is a class that I can use simular to a 2 diminsional string array.
    The following would be helpful.
    1. A java class or other developed class that does this.
    This seems like it would be common.
    2. An easier way to update and read data from the array within anouther array.
    String [] array1 = new String [2];
                    String [] array2 = new String [2];
                    array1[0]= "jrm1a";
                    array1[1]= "jrm1b";
                    array2[0]= "jrm2a";
                    array2[1]= "jrm2b";
                    ArrayList tad = new ArrayList();
                    tad.add(array1);
                    tad.add(array2);
                    System.out.println("arraylist: " + tad);
                    String [] str2 = (String [])tad.get(1);
                    String str3 = str2[1];
                    System.out.println("str3: " + str3);

  • Arrays within custom Classes - same array for different instances?

    Hello all,
    I have made a very simple custom class for keeping track of groups of offices for a company.  The class has a Number variable to tell it how many different offices there are, and an Array to store the individual offices by name.  It looks like this.
    class officeCluster
        static var _className:String = "officeCluster";
        // variables
        var numOffices:Number;
        var locationArray:Array = new Array();
        // functions
        function officeCluster()
            trace("officeCluster constructor");
    Very simple!
    Now, it is my understand that when I create different instances of the class, they will each have their own version of "numOffices" and their own version of "locationArray".
    When I run traces of "numOffices", this seems to be true.  For example,
    trace(manufacturingOfficeCluster.numOffices);
    trace(servicesOfficeCluster.numOffices);
    yields
    5
    4
    In the output panel, which is correct.  However, there is trouble with the locationArray.  It seems that as I assign different values to it, regardless of what instance I specify, there is only ONE array- NOT one for each instance.
    In other words,
    trace(manufacturingOfficeCluster.locationArray[1].theLocation);   // theLocation is a String.  The locationArray itself holds Objects.
    trace(servicesOfficeCluster.locationArray[1].theLocation);
    yields
    New Haven, CT
    New Haven, CT
    even though I have defined elsewhere that they are different!
    Is anyone aware of any issues partaining to using Arrays within Class instances?  Any help would be appreciated!
    note:  I've been able to work around this by creating multiple arrays within the class and using a different one for each instance, but this seems very sloppy.

    Unfortunately, the code segment you attached results in:
    12
    12
    in the output panel.   So the problem must lie elsewhere!  Let me give some more detail...
    There are several files involved. The "officeCluster" class file looks like this:
    class officeCluster
         static var _className:String = "officeCluster";
         // variables
         var numOffices:Number;
         var locationArray:Array = new Array();
         // functions
         function officeCluster()
            trace("officeCluster constructor");
    I have two actionscript files which contain object data for the individual offices.  They look like this...
    var servicesOfficeCluster = new officeCluster();
    servicesOfficeCluster.numOffices = 4;
    var newHope:Object = new Object();
    newHope.locationName = "New Hope Office";
    newHope.theLocation = "New Hope, NJ";
    //more data
    servicesOfficeCluster.locationArray[0] = newHope; //array index is incremented with each entry
    //more Objects...
    and like this...
    var manufacturingOfficeCluster = new officeCluster();
    manufacturingOfficeCluster.numOffices = 5;
    var hartford:Object = new Object();
    hartford.locationName = "Hartford Office";
    hartford.theLocation = "Hartford, CT";
    //more data
    manufacturingOfficeCluster.locationArray[0] = hartford; //array index is incremented with each entry
    //more Objects...
    As you can see, the only difference is the name of the officeCluster instance, and of course the Object data itself.  Finally, these are all used by the main file, which looks like this- I have commented out all the code except for our little test -
    import officeCluster;
    #include "manufacturingList.as"
    #include "servicesList.as"
    /*lots of commented code*/
    manufacturingOfficeCluster.locationArray[1].theLocation = "l1";
    servicesOfficeCluster.locationArray[1].theLocation = "l2";
    trace(manufacturingOfficeCluster.locationArray[1].theLocation);
    trace(servicesOfficeCluster.locationArray[1].theLocation);
    Which, unfortunately, still yields
    12
    12
    as output :\  Any ideas?  Is there something wrong with the way I have set up the class file?  Something wrong in the two AS files?  I'm really starting to bang my head against the wall with this one.
    Thanks

  • History on import and export

    MDM can manage history of files imported or exported ?

    If you use the Port concept for importing and exporting data, there is a Archive Folder.
    Once the file is imported successfully from the Ready Folder, the same file is renamed and saved in the Archive folder.
    Refer to the Port Concept in MDM Console guide and Import Manager reference guide.
    Thesse directories are created automatically when you create a port.
    Hope this helps,
    Please mark helpful answers

  • Export to CSV - order is now by alphabetical column

    I was using 1.2, and exporting to CSV, and the file was in table-layout order, so another app is able to import.
    Now with 1.5 the export is in alphabetical column-name order - and the other app can't handle it.
    Is there some setting to change the export behaviour ?
    cheers, Tim

    Why isn't that method suitable? Both use the exact same mechanism and all rows have to be retrieved anyway. What's more, I'm pretty sure 1.2 still executed the query 2 times extra before actually exporting the set, whereas 1.5.x "only" 1 time extra.
    But it's not a bad idea to keep 1.2 around for some irritating issues, and 1.5 has it's advantage over other ones.
    Regards,
    K.

  • Leading zeros are dropped when exporting as csv

    I have a report that when I export as csv, leading zeros in text columns are dropped in excel. The text columns appear fine in the report, however, when I export the leading zero is gone in excel. For example, in the report my text column could have a value of 0101, when it is exported to excel it has a value of 101. The code behind the link to export to csv is f?p=&APP_ID.:&APP_PAGE_ID.:&SESSION.:FLOW_EXCEL_OUTPUT_R#REGION_ID#
    Is there a way to keep the leading zero in excel?
    Regards
    Mark

    Thanks for your reply. In my query I wrapped the column with double quotes as you suggest, and added the same column for display:
    select '"'||column1||'"' execl_col, column1 disp_col from table where ....
    Using htmldb_application.g_excel_format as a conditional display I can control what is displayed on the screen and export to csv the double quoted text field. I have that part working fine. Using my previous data example, I am now seeing in excel 0101"".
    Did I wrap the field incorrectly with double quotes? How can I exclude the
    double quotes in the export to csv?
    Regards
    Mark

Maybe you are looking for