WMI - Output result

Hi 
Am trying to fetch information from my client computers, that they have installed Skye or not  on there computers.
I was able to write a WMI script,  works well, but the output result is written on cmd.
How can i get the output result to excel or notepad..
Please help me with the output script code.
Here is my code 
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
   "SELECT * FROM Win32_Service where displayname like 'Skype%' ",,48) 
For Each objItem in colItems 
   Wscript.Echo "Name: " & objItem.displayName
Next
Thanks
Venky

Hi 
Iam trying to fetch information from my client computers, that they have installed Skye on there computers.
I was able to write a WMI script,  works well, but the output result is written on cmd.
How can i get the output result to excel or notepad..
Please help me with the output script code.
Here is my code 
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
   "SELECT * FROM Win32_Service where displayname like 'Skype%' ",,48) 
For Each objItem in colItems 
   Wscript.Echo "Name: " & objItem.displayName
Next
Thanks
Venky

Similar Messages

  • How to call a SP with dynamic columns and output results into a .csv file via SSIS

    hi Folks, I have a challenging question here. I've created a SP called dbo.ResultsWithDynamicColumns and take one parameter of CONVERT(DATE,GETDATE()), the uniqueness of this SP is that the result does not have fixed columns as it's based on sales from previous
    days. For example, Previous day, customers have purchased 20 products but today , 30 products have been purchased.
    Right now, on SSMS, I am able to execute this SP when supplying  a parameter.  What I want to achieve here is to automate this process and send the result as a .csv file and SFTP to a server. 
    SFTP part is kinda easy as I can call WinSCP with proper script to handle it.  How to export the result of a dynamic SP to a .CSV file? 
    I've tried
    EXEC xp_cmdshell ' BCP " EXEC xxxx.[dbo].[ResultsWithDynamicColumns ]  @dateFrom = ''2014-01-21''"   queryout  "c:\path\xxxx.dat" -T -c'
    SSMS gives the following error as Error = [Microsoft][SQL Server Native Client 10.0]BCP host-files must contain at least one column
    any ideas?
    thanks
    Hui
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Hey Jakub, thanks and I did see the #temp table issue in our 2008R2.  I finally figured it out in a different way... I manage to modify this dynamic SP to output results into
    a physical table. This table will be dropped and recreated everytime when SP gets executed... After that, I used a SSIS pkg to output this table
    to a file destination which is .csv.  
     The downside is that if this table structure ever gets changed, this SSIS pkg will fail or not fully reflecting the whole table. However, this won't happen often
    and I can live with that at this moment. 
    Thanks
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

  • Adding field in standard SAP transaction output results.

    Hi,
    I have to add a new field in standard SAP transaction output results.
    Can any one tell me what are the ways (brief explanation) that I can do this?
    If using exists - then what kind of exists I have to use? And how to find out the possibility with user exists?
    Thanks for your time.
    Thanks.
    Chris.

    Hi,
        There are so many ways to find out the user exits.
    Hi,
    To see SAP Exits -> Use Tcode SMOD
    To See create a project for Customer Exits -> Use Tcode CMOD
    There are projects to which Exits are assigned. Selects the relevant projects.
    What is User Exit:
    http://www.sap-img.com/abap/what-is-user-exits.htm
    How to find then:
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    All Exits List:
    http://www.easymarketplace.de/userexit.php
    Do a search on SAP Exits, Customer Exits, enhancements, etc
    Step 1 :- Execute transaction
    step 2 :- Click on Status Menu
    step 3 :- Double click on the program (screen) __?????___
    Step 4 :- Search source code for the 'Customer-Function' string using the find button. Remember to select 'In main program'.
    Step 5 :- A list of search results should be displayed indicating where all function exits can be found.
    You can now double click on each of them to go to its position in the source code. This also
    allows for the insertion of breakpoints so that you can test if the exits are called in the
    appropriate place.
    Step 6 :-Once you have found the Function Exit within the source code (Find Function Exit) you need to
    access the actual function module it executes. This is done using the following steps:
    Step 6.1 :-
    Step 1
    Locate desired 'Call Customer-function' statement within source code.
    Step 2
    If code is not within main program (module pool) e.g. SAP* then you will need to find this
    out by selecting 'Main Program' from the 'GOTO' menu. The Main program for transaction
    Step 3
    The actual function module name can now be calculated based on the information retrieved,
    it is defined by the following format:
    EXIT_<Program name>_<Exit number>
    eg :- 'EXIT_SAPLMR1M_004'.
    Step 7.1:-
    Once you have found the Exit function module
    Step 1
    Execute transaction CMOD
    Step 2
    Select 'SAP Enhancements' from the 'Utilities' menu.
    Step 3
    Select 'All selections' from the 'Edit' menu.
    Step 4
    Now populate the Component name field with the exit function module and press
    the execute button.
    Step 5
    A list of all Exits(Enhancements) containing that function module should now be displayed.
    Step 5
    You can now double click on the desired exit to display a detailed description of its uses and a list of all
    components contained in it.
    Implementing Function Exit
    This is required in-order to activate Function exit:
    Step 1
    The first step is to enter source code into function module in the usual way i.e. via SE37.
    There will already be an include declaration within the code with the following
    format: Include zx*.
    Double click on this to create it, source code can then be entered within here.
    Although it is good practice to create another include with this to store your
    code, this allows separation of difference enhancements allowing them to be easlity
    removed without de-activating the enhancement.
    Step 2
    Execute transaction CMOD and create new Enhancement. Enter name and press the create
    Button.
    Step 3
    The following screen should be displayed, enter short text then click on the 'Enhancement
    Step 4
    Now enter the Exit name (enhancement) which contains the desired Function Exit.
    Step 5
    Return to initial screen of CMOD and press the activate icon. The exit is now ready for use.
    Please Mark The Helfull Answers & close the thread.
    regards
    dj
    reward for all useful answers.

  • Output results to more columns...

    Hi!
    I have problem, for which I didn't find solution yet.
    I have query and this query returns the unknown count of rows (this row count is unknown in time of developing). I would like output results of this query to more than one result column to the screen.
    Example:
    I would like output results like this:
    Result 1 Result 3 Result5
    Result 2 Result 4
    so the number of the rows is minimal!!!
    It can be called real down/across!
    (not like this:
    Result 1
    Result 2
    Result 3
    Result 4
    Does anybody know the generic solution, how to do?
    Thanks!
    null

    Place the data models as you want and design with additional frames
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by abcdefgh:
    Hi!
    I have problem, for which I didn't find solution yet.
    I have query and this query returns the unknown count of rows (this row count is unknown in time of developing). I would like output results of this query to more than one result column to the screen.
    Example:
    I would like output results like this:
    Result 1 Result 3 Result5
    Result 2 Result 4
    so the number of the rows is minimal!!!
    It can be called real down/across!
    (not like this:
    Result 1
    Result 2
    Result 3
    Result 4
    Does anybody know the generic solution, how to do?
    Thanks!<HR></BLOCKQUOTE>
    null

  • Please assist with modifying this script to read in a list of servers and output results to excel

    Hello,
    I have an excellent script written by Brian Wilhite to gather the last logged in user using Powershell.
    http://gallery.technet.microsoft.com/scriptcenter/Get-LastLogon-Determining-283f98ae/view/Discussions#content
    My Powershell Fu is stumbling to modify this script to the following requirements:
    Currently the script must be loaded first into Powershell, then it can be executed.  I would rather edit the script in my Powershell ISE, add the .txt file to the script itself that gives a list of the servers I need to scan.  Then when I
    press Run Script in my ISE it executes.
    I would also like to output the results of the file to excel (.xls or .csv will do).  Currently the results look as follows:
    Computer : SVR01
    User : WILHITE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    I would prefer it shows up like so:
    Computer User SID Time Currently LoggedOn
    SVR01 WILHITE\BRIAN S-1xxx 9/20/2012 1:07:58 PM FalseSRV02 WILHITE\BRIAN S-2xxx 9/26/2014 10:00:00 AM True
    Any help you can provide would be greatly appreciated.  I'll add the full script to the end of this post.
    Thank you.
    Function Get-LastLogon
    <#
    .SYNOPSIS
    This function will list the last user logged on or logged in.
    .DESCRIPTION
    This function will list the last user logged on or logged in. It will detect if the user is currently logged on
    via WMI or the Registry, depending on what version of Windows is running on the target. There is some "guess" work
    to determine what Domain the user truly belongs to if run against Vista NON SP1 and below, since the function
    is using the profile name initially to detect the user name. It then compares the profile name and the Security
    Entries (ACE-SDDL) to see if they are equal to determine Domain and if the profile is loaded via the Registry.
    .PARAMETER ComputerName
    A single Computer or an array of computer names. The default is localhost ($env:COMPUTERNAME).
    .PARAMETER FilterSID
    Filters a single SID from the results. For use if there is a service account commonly used.
    .PARAMETER WQLFilter
    Default WQLFilter defined for the Win32_UserProfile query, it is best to leave this alone, unless you know what
    you are doing.
    Default Value = "NOT SID = 'S-1-5-18' AND NOT SID = 'S-1-5-19' AND NOT SID = 'S-1-5-20'"
    .EXAMPLE
    $Servers = Get-Content "C:\ServerList.txt"
    Get-LastLogon -ComputerName $Servers
    This example will return the last logon information from all the servers in the C:\ServerList.txt file.
    Computer : SVR01
    User : WILHITE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    Computer : SVR02
    User : WILIHTE\BRIAN
    SID : S-1-5-21-012345678-0123456789-012345678-012345
    Time : 9/20/2012 12:46:48 PM
    CurrentlyLoggedOn : True
    .EXAMPLE
    Get-LastLogon -ComputerName svr01, svr02 -FilterSID S-1-5-21-012345678-0123456789-012345678-012345
    This example will return the last logon information from all the servers in the C:\ServerList.txt file.
    Computer : SVR01
    User : WILHITE\ADMIN
    SID : S-1-5-21-012345678-0123456789-012345678-543210
    Time : 9/20/2012 1:07:58 PM
    CurrentlyLoggedOn : False
    Computer : SVR02
    User : WILIHTE\ADMIN
    SID : S-1-5-21-012345678-0123456789-012345678-543210
    Time : 9/20/2012 12:46:48 PM
    CurrentlyLoggedOn : True
    .LINK
    http://msdn.microsoft.com/en-us/library/windows/desktop/ee886409(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/library/system.security.principal.securityidentifier.aspx
    .NOTES
    Author: Brian C. Wilhite
    Email: [email protected]
    Date: "09/20/2012"
    Updates: Added FilterSID Parameter
    Cleaned Up Code, defined fewer variables when creating PSObjects
    ToDo: Clean up the UserSID Translation, to continue even if the SID is local
    #>
    [CmdletBinding()]
    param(
    [Parameter(Position=0,ValueFromPipeline=$true)]
    [Alias("CN","Computer")]
    [String[]]$ComputerName="$env:COMPUTERNAME",
    [String]$FilterSID,
    [String]$WQLFilter="NOT SID = 'S-1-5-18' AND NOT SID = 'S-1-5-19' AND NOT SID = 'S-1-5-20'"
    Begin
    #Adjusting ErrorActionPreference to stop on all errors
    $TempErrAct = $ErrorActionPreference
    $ErrorActionPreference = "Stop"
    #Exclude Local System, Local Service & Network Service
    }#End Begin Script Block
    Process
    Foreach ($Computer in $ComputerName)
    $Computer = $Computer.ToUpper().Trim()
    Try
    #Querying Windows version to determine how to proceed.
    $Win32OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Computer
    $Build = $Win32OS.BuildNumber
    #Win32_UserProfile exist on Windows Vista and above
    If ($Build -ge 6001)
    If ($FilterSID)
    $WQLFilter = $WQLFilter + " AND NOT SID = `'$FilterSID`'"
    }#End If ($FilterSID)
    $Win32User = Get-WmiObject -Class Win32_UserProfile -Filter $WQLFilter -ComputerName $Computer
    $LastUser = $Win32User | Sort-Object -Property LastUseTime -Descending | Select-Object -First 1
    $Loaded = $LastUser.Loaded
    $Script:Time = ([WMI]'').ConvertToDateTime($LastUser.LastUseTime)
    #Convert SID to Account for friendly display
    $Script:UserSID = New-Object System.Security.Principal.SecurityIdentifier($LastUser.SID)
    $User = $Script:UserSID.Translate([System.Security.Principal.NTAccount])
    }#End If ($Build -ge 6001)
    If ($Build -le 6000)
    If ($Build -eq 2195)
    $SysDrv = $Win32OS.SystemDirectory.ToCharArray()[0] + ":"
    }#End If ($Build -eq 2195)
    Else
    $SysDrv = $Win32OS.SystemDrive
    }#End Else
    $SysDrv = $SysDrv.Replace(":","$")
    $Script:ProfLoc = "\\$Computer\$SysDrv\Documents and Settings"
    $Profiles = Get-ChildItem -Path $Script:ProfLoc
    $Script:NTUserDatLog = $Profiles | ForEach-Object -Process {$_.GetFiles("ntuser.dat.LOG")}
    #Function to grab last profile data, used for allowing -FilterSID to function properly.
    function GetLastProfData ($InstanceNumber)
    $Script:LastProf = ($Script:NTUserDatLog | Sort-Object -Property LastWriteTime -Descending)[$InstanceNumber]
    $Script:UserName = $Script:LastProf.DirectoryName.Replace("$Script:ProfLoc","").Trim("\").ToUpper()
    $Script:Time = $Script:LastProf.LastAccessTime
    #Getting the SID of the user from the file ACE to compare
    $Script:Sddl = $Script:LastProf.GetAccessControl().Sddl
    $Script:Sddl = $Script:Sddl.split("(") | Select-String -Pattern "[0-9]\)$" | Select-Object -First 1
    #Formatting SID, assuming the 6th entry will be the users SID.
    $Script:Sddl = $Script:Sddl.ToString().Split(";")[5].Trim(")")
    #Convert Account to SID to detect if profile is loaded via the remote registry
    $Script:TranSID = New-Object System.Security.Principal.NTAccount($Script:UserName)
    $Script:UserSID = $Script:TranSID.Translate([System.Security.Principal.SecurityIdentifier])
    }#End function GetLastProfData
    GetLastProfData -InstanceNumber 0
    #If the FilterSID equals the UserSID, rerun GetLastProfData and select the next instance
    If ($Script:UserSID -eq $FilterSID)
    GetLastProfData -InstanceNumber 1
    }#End If ($Script:UserSID -eq $FilterSID)
    #If the detected SID via Sddl matches the UserSID, then connect to the registry to detect currently loggedon.
    If ($Script:Sddl -eq $Script:UserSID)
    $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"Users",$Computer)
    $Loaded = $Reg.GetSubKeyNames() -contains $Script:UserSID.Value
    #Convert SID to Account for friendly display
    $Script:UserSID = New-Object System.Security.Principal.SecurityIdentifier($Script:UserSID)
    $User = $Script:UserSID.Translate([System.Security.Principal.NTAccount])
    }#End If ($Script:Sddl -eq $Script:UserSID)
    Else
    $User = $Script:UserName
    $Loaded = "Unknown"
    }#End Else
    }#End If ($Build -le 6000)
    #Creating Custom PSObject For Output
    New-Object -TypeName PSObject -Property @{
    Computer=$Computer
    User=$User
    SID=$Script:UserSID
    Time=$Script:Time
    CurrentlyLoggedOn=$Loaded
    } | Select-Object Computer, User, SID, Time, CurrentlyLoggedOn
    }#End Try
    Catch
    If ($_.Exception.Message -Like "*Some or all identity references could not be translated*")
    Write-Warning "Unable to Translate $Script:UserSID, try filtering the SID `nby using the -FilterSID parameter."
    Write-Warning "It may be that $Script:UserSID is local to $Computer, Unable to translate remote SID"
    Else
    Write-Warning $_
    }#End Catch
    }#End Foreach ($Computer in $ComputerName)
    }#End Process
    End
    #Resetting ErrorActionPref
    $ErrorActionPreference = $TempErrAct
    }#End End
    }# End Function Get-LastLogon

     This should work:
    Get-LastLogon -Computername (Get-content .\Servers.txt) | Export-CSV .\Output.csv -NoTypeInformation
    I just tested it on my test domain and it did the trick.

  • Outputting Results in a single row from a Table

    Afternoon folks,
    I have a scenario in hand and I was hoping to get some pointers. I could write a PL/SQL program and all would be fine. I was hoping if there was a way to do it in SQL and not have to create a whole new sub-program for this. I already have a PL/SQL program that populates a table. I want to use that data now and output it in a certain manner.
    Any help is greatly appreciated and this is not something I need to solve by tonight. :)
    Script to create table and insert records into it:
    drop table FLIGHT_ROUTES;
      CREATE TABLE FLIGHT_ROUTES
       (FLIGHT_NO           VARCHAR2(7),
        ROUTE_ID            NUMBER,
        DAY_OF_OPERATION    NUMBER,
        ORIGIN              VARCHAR2(3),
        DESTINATION         VARCHAR2(3),
        STOPVER             VARCHAR2(3),
        ROUTE_TYPE          VARCHAR2(1)
    REM INSERTING into FLIGHT_ROUTES
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-1001',1,1,'SFO','LAX',null,'D');
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-1001',1,2,'SFO','LAX',null,'R');  -- Record 2
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-2001',2,1,'SFO','JFK',null,'D');
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-2001',2,2,'SFO','JFK','ORD','D');
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-2001',2,3,'SFO','JFK','DEN','R');  -- Record 5
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-3001',3,1,'LAX','JFK','YYZ','D');
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-3001',3,2,'LAX','JFK','YYC','D');
    Insert into FLIGHT_ROUTES (FLIGHT_NO,ROUTE_ID,DAY_OF_OPERATION,ORIGIN,DESTINATION,STOPVER,ROUTE_TYPE) values ('UX-3001',3,3,'LAX','JFK','YUL','D');What I would like to do is output the results by Flight Number, Origin1, Destination1, Origin2, Destination 2 and Origin 3, Destination 3. The maxium number combinations per Flight is 3. The other condition is that the listing should only show the Origin and Destinations and Stopover if it's a Day time Flight. If its a Red Eye, then don't show that option. So, Record 2 would be completely omitted here as it's a Red Eye flight and Record 5 would be omitted for Origin/Destination/Stopover 3 for flight UX-2001.
    Flight_No       Origin1     Destination1    Stopover 1      Origin2          Destination2      Stopver2      Origin3    Destination3     Stopover3
    ============================================================================================================================================================
    UX-1001         SFO         LAX
    UX-2001         SFO         JFK                             SFO              JFK               ORD
    UX-3001         LAX         JFK             YYZ             LAX              JFK               YYC           LAX        JFK              YULEdited by: Roxyrollers on Sep 9, 2011 3:59 PM
    Edited by: Roxyrollers on Sep 9, 2011 3:59 PM
    Edited by: Roxyrollers on Sep 9, 2011 4:00 PM

    Hi,
    Assuming that day_of_operation is what determines whether a row is 1, 2 or 3:
    WITH     got_r_num     AS
         SELECT     f.*
         ,     ROW_NUMBER () OVER ( PARTITION BY  flight_no
                                   ORDER BY          day_of_operation
                           ) AS r_num
         FROM    flight_routes        f
         WHERE     route_type     != 'R'
    SELECT       flight_no                              || ',' ||
           MAX (CASE WHEN r_num = 1 THEN origin      END)     || ',' ||     -- Origin 1
           MAX (CASE WHEN r_num = 1 THEN destination END)     || ',' ||     -- Destination 1
           MAX (CASE WHEN r_num = 1 THEN stopver     END)     || ',' ||     -- Stopover 1
           MAX (CASE WHEN r_num = 2 THEN origin      END)     || ',' ||     -- Origin 2
           MAX (CASE WHEN r_num = 2 THEN destination END)     || ',' ||     -- Destination 2
           MAX (CASE WHEN r_num = 2 THEN stopver     END)     || ',' ||     -- Stopover 2
           MAX (CASE WHEN r_num = 3 THEN origin      END)     || ',' ||     -- Origin 3
           MAX (CASE WHEN r_num = 3 THEN destination END)     || ',' ||     -- Destination 3
           MAX (CASE WHEN r_num = 3 THEN stopver     END)  AS csv_text            -- Stopover 3
    FROM       got_r_num
    GROUP BY  flight_no
    ORDER BY  flight_no
    ;Output:
    CSV_TEXT
    UX-1001,SFO,LAX,,,,,,,
    UX-2001,SFO,JFK,,SFO,JFK,ORD,,,
    UX-3001,LAX,JFK,YYZ,LAX,JFK,YYC,LAX,JFK,YULThis does not assume that origin1 is always on the same row with day_of_operation=1. Origin1 will be from the row with the lowest day_of_operation, not counting red-eyes. Likewise, origin2 will be from the row with the 2nd lowest day_of_operation, whether that value is 2 or not.
    If your data is such that the row with day_of_operation=n will necessarily be the nth lowest one, not counting red-eyes, then you don't need the sub-query got_r_num; just use your real table (with the condition WHERE route_type != 'R'), and use day_of_operation where I used r_num. (This is what Solomon's solution, which I just saw, does.)
    Edited by: Frank Kulash on Sep 9, 2011 4:47 PM
    Edited by: Frank Kulash on Sep 9, 2011 4:53 PM

  • How to output results to a file?

    If there is no Debug capability, how to output test results to a file?  Are there any other ways to do this?
    Thanks!

    Dear Sapport,
    You can use the IWDMessageManger to print the message on the webdynpro application iview screen.
    Please refer to the more details for the Webdynpro Logging and Tracing to find the root cause:-
    [Logging in Web Dynpro (Java) - a guide and tutorial for beginners [Part 1]|Logging in Web Dynpro (Java) - a guide and tutorial for beginners [Part 1]]
    [http://wiki.sdn.sap.com/wiki/display/WDJava/LoggingandTracinginWebDynpro|http://wiki.sdn.sap.com/wiki/display/WDJava/LoggingandTracinginWebDynpro]
    Hope it will resolve your issue.
    Best Regards
    Arun Jaiswal
    Edited by: Arun Jaiswal on Mar 5, 2012 12:47 PM

  • Outputing results into MS Excel

    Hello all, I am writting an application which gets data from MS Access. Is there a way I can get the results from a query and output them into an Excel spreadsheet??? Thank you

    Hi,
    I agree. Why use excel to read an Access file? They are virtually one and the same thing. But you could implement the AbstractTableModel in java and create your own version of Excel. Much more fun.
    best kev

  • Scanning .txt file and outputting results?

    Greetings Everyone. My employer has charged me with a rather
    confusing task. Basically I need to scan a .txt file and retrieve
    some information from it. Here is a little background on the file
    itself.
    This is a feed file containing the information for employees
    such as name, department, employement status etc...Zeros are used
    in place of spaces in this file. What I am charged with is
    retrieving the employment status and name for every single person
    in the file (60,000+).
    I need to write a coldfusion script that can do the
    following.
    1. Scan a .txt file that is sent to me every night and look
    for the 99th character on each line of the .txt file
    2. If the 99th character is a 'T' I need to pull characters
    '10-50' (which contain the name for that person).
    3. Output the results of the scan to a coldfusion page
    displaying the individuals' names.
    If anyone out there can point me in the right direction I
    would be very grateful. I've been looking for websites on this
    topic but I have been unsucessful so far. Should I post this in the
    advanced section of the cf forums? Once again, thank you for any
    help you can give me.

    I guarantee you can do this! And it shouldnt be to hard so
    you can breath a sigh of relief... :)
    I would use <cffile action="read" file="filepath/name.txt"
    variable="fileContents">
    Then you should be able to do something like <cfset
    fileArray = ListToArray(fileContents, "#CHR(13)##CHR(10)#")>
    Now you have an array so you can loop through and try
    something like the following...
    <cfloop index="i" from="1" to="#ArrayLen(fileArray)#"
    step="1">
    <cfif fileArray
    NEQ "">
    <!--- Find 99th Char --->
    <cfset 99thchar = Mid(fileArray, 99, 1)>
    <cfif 99thchar EQ "T">
    <!--- Get Name --->
    <cfset empName = Mid(fileArray
    , 10, 40)>
    <!--- Change 0's to Spaces--->
    <cfset empName = Replace(empName, "0", "#CHR(32)#")>
    <cfoutput>#empName#</cfoutput><br />
    </cfif>
    </cfif>
    </cfloop>
    That should be close to what you could use... You may have to
    tweak it a bit... now if it is going though 60000+ records this may
    take a while...lol You might have to use the cfsetting tag to
    extend the normal request timeout..
    Hope this helps!

  • Can FCP directly output to Beta Cam? if not what is the best output result?

    I wonder which way is the best result to output the video to beta tape for TV broadcasting. I used firewire to DV but once the TV station dup to beta, the picture gettin worst.

    Thinking of CBD as hockey director...
    "I'll take some of that! More of this! And less of those!
    "I want them now! I want it yesterday! And stay awake because the requirements will change tomorrow!"
    On a more serious note...
    I searched around for a beta sp deck that takes fire wire in and could not find one.
    It strikes me that if you (Cantonpro) are already using an iMac you are either sharing the firewire bus, or placing media on your system drive. As noted, neither of these situation are recommended.
    However, if you are on the system drive, then an AJA IO might be a possibility, but almost $2000 plus deck rental seems a bit steep, especially since the capabilities of the AJA would be limited by the iMac. Maybe a higher end canopus converter like this one,
    http://www.canopus.com/products/ADVC500/index.php
    but you are still talking almost $1500 plus deck rental. This solution is a bit more appropriate if you plan on staying with the iMac.
    There are less expensive options that rely on composite video, but then you may as well have the station do the conversion.
    Maybe you should contact a local dub house and see what they have to say, or find out if anyone near you has this equipment already.
    Or, if your work is generating profit, and your business would benefit from the higher quality on-air, start to upgrade your hardware so you will see greater returns in the future.
    Tom

  • Powershell output results log

    Hi guys.
    I have a question and do not know if you can
    help me.
    I do not know much about Powershell,
    but I created a script that disables,
    moves and changes the description of dismissed
    enterprise users through the registration number
    (POBOX in my case).
    The question is would you like to generate a log
    each time this script was executed,
    stating whether or not the actions were
    performed successfully.
    Tested
    with some examples I found on Technet
    but did not work.
    Does anyone havea hint howcan I includethis functionalityin my script?
    $csvFile = ".\list.csv"
    $disabledUsersOU = "<OU DESTINATION>"
    Import-Csv $csvFile | ForEach {
     $f = $_.POBox;
     Get-ADUser -Filter {POBox -eq $f} | Disable-ADAccount
     Get-ADUser -Filter {POBox -eq $f} | Set-ADUser -Description "Disable User Script v4"
     Get-ADUser -Filter {POBox -eq $f} | Move-ADObject -TargetPath $disabledUsersOU
     $user = Get-ADUser -Filter {POBox -eq $f} -Properties MemberOf
     foreach ($group in ($user | Select-Object -ExpandProperty MemberOf))
      Remove-ADGroupMember -Identity $group -Members $user -Confirm:$false
    Thanks a lot.
    David Soares MCTS:MBS - MCTS - MCITP

    You could try something like this:
    $csvFile = ".\list.csv"
    $disabledUsersOU = "<OU DESTINATION>"
    $Results = Import-Csv $csvFile | ForEach {
    $f = $_.POBox;
    Get-ADUser -Filter {POBox -eq $f} | Disable-ADAccount
    Get-ADUser -Filter {POBox -eq $f} | Set-ADUser -Description "Disable User Script v4"
    Get-ADUser -Filter {POBox -eq $f} | Move-ADObject -TargetPath $disabledUsersOU
    $user = Get-ADUser -Filter {POBox -eq $f} -Properties MemberOf,Description,Enabled
    foreach ($group in ($user | Select-Object -ExpandProperty MemberOf))
    Remove-ADGroupMember -Identity $group -Members $user -Confirm:$false
    $user = Get-ADUser $user -properties MemberOf,POBox,Description
    New-Object PSObject -property @{User=$user.samaccountname;POBox=$user.POBox;Description=$user.Description;MemberOf=(($user | select -expand MemberOf) -join ",");Enabled=$user.Enabled;DN=$user.DistinguishedName}
    $Results | Select User,POBox,Description,MemberOf,Enabled | Export-CSV ".\results.csv" -NoType
    All I really added was to create New-Object for each user and each one gets included in $Results, which gets piped to a csv file.  This way you can see what may or may not have succeeded.  The alternative is to evaluate each of the values and compare
    it to what you expect - if any of them are not what you would expect, then User = fail and instead of the new-object line and having all of the output go to $Results you could do:
    Out-File ".\results.log" -InputObject "$($User.sAMAccountName) = FAIL" -append
    (or PASS, or SUCCESS, or whatever works).  The reason I provided the approach above is that you have a complete picture of the results.
    The select in the last line orders the columns in the CSV, otherwise Powershell chooses the order and it isn't usually what you would like.
    I hope this post has helped!

  • A question about output result

    i want to print the query result of a database table into the screen. but i found it difficult to align the results. listed below is an example
    Mary F 28
    Alexandra M 30
    i usd the listed command to print above results:
    System.out.println("\t" + name + "\t" + gender + "\t" + age);
    i had planed to use '\t' to align the output, but i found length of data are different. like "Mary", it is less 8 characters, while "Alexandra" requires 9 characters. this leads to the output is not aligned. the expected result would be like this:
    Mary F 28
    Alexandra M 30
    anyone knows how can i align the output ? thanks a lot!

    by writing something like
    public static String leftAlign( String string, int length)
    StringBuffer buffer = new StringBuffer( length);
    if( string.length() < length)
       buffer.append(string);
       for ( int idx = string.length(); idx < length; ++idx)
         buffer.append( ' ');
    else
       buffer.append( string.substring(0,length);
    return buffer.toString();
    System.out.println( leftAlign( "", 9) + leftAlign( name, 30) + leftAlign( gender, 5) + leftAlign( age, 5) );

  • Output results in rows of 10?

    Is there a way to do this when outputing query results?
    Thanks

    Look at tis tutorial:
    http://tutorial310.easycfm.com/
    Ken Ford

  • Question regarding outputing results of query to pdf file

    Is there a way in which we can output the results of the query to a PDF file in PLSQL?
    Thanks much,
    Madhu

    I have a situation where there needs to be emails sent to the customers on a daily basis.Right now there is scheduled bat file on a particular machine which calls the Form which has the logic to generate the pdf file using Oracle Reports for each of the customer,which is then mailed using Outlook(OLE in form).But now this is kind of a problem as they are constant network problems which hinder the timely sending of the reports.
    I am trying to look for a solution so that we can do everything on database end instead of relying on the newtork.
    Thank you for any suggestions you have regarding implementing this.
    Madhu

  • Output results from loop inside query

    Hi
    Im having an issue outputting vars from a table with multiple
    ID’s
    Basically heres and example of what I I am trying to display
    Show All Project” with the Proj ID of 146 AND 147
    My results should return 2 vars.
    But none are shown…
    Please can someone help me here….
    Thanks again
    Delon

    Change this:
    WHERE ProjID = 146 AND ProjID = 147
    to this
    WHERE ProjID in (146,147)

Maybe you are looking for

  • My iPod isn't recognized by the computer or iTunes.

    I've looked at all the troubleshooting articles about this and none of them seem to help. My iPod just won't show up on iTunes or in "My Computer" when I plug it into the USB port. I've tried the "five R's" and they aren't helping at all, I'd really

  • My macbook pro (ca 2010) keeps on crashing when I am trying to install programs...

    My macbook pro (ca 2010) keeps on crashing when I am trying to install programs from the creative suite. When the creative suite manager is running in the background it also crashes... I have recently updated to os yosemite, does this have anything t

  • Adobe Reader 10.1.9 acting up

    When I try to open a PDF document I get this message 'Problem with Adobe Reader, if it is running exit and try again 0:104'. If I exit and try again I get the same message. I have attempted to uninstall and reinstall but get an erro message there als

  • Microphone on iPad 3 stopped working.reset doesn't work

    HEllo, Can anyone help me in regards to the microphone on ipad3? It was working fine yesterday but today it doesn't work. I tried resetting by holding the home and power button, restored original settings and nothing. Anyone had this problem? What do

  • "mode" can be field name ?

    I migrate sql server to oracle.I have a table having a field named "mode".I can't rename it because application can't work with it.what can i do.?