How to export out the date into the csv file?

Hi, I had been trying to export out the value of the date to csv file.
This is the  script:
$strADPath = 'LDAP://dc=test,dc=com'
function ConvertLargeIntegerToDate([object]$LargeInteger){
try
$int64 = ConvertLargeIntegerToInt64 ($LargeInteger)
if ($int64 -gt 0)
$retDate = [datetime]::fromfiletime($int64)
else
$retDate = $null
return $retDate
catch
return $null
$objSearch = New-Object DirectoryServices.DirectorySearcher
$objSearch.Filter = '(&(objectClass=user)(samaccountname=user1))'
$objSearch.SearchRoot = $strADPath
$objSearch.PageSize = 1000
$objSearch.SearchScope = "subtree"
$objResults = $objSearch.Findall()
$dateAccountExpires = ConvertLargeIntegerToDate $objUser.accountexpires[0]
Write-Host "date Account expires: " $dateAccountexpires
$objResults| ForEach-Object{
$_.GetDirectoryEntry()
} |
Select-Object -Property @{Name="sAMaccountName";Expression={$_.sAMAccountName}},
@{Name="cn";Expression={$_.cn}},
@{Name="name";Expression={$_.name}},
@{Name="manager";Expression={$_.manager}},
@{Name="givenName";Expression={$_.givenName}},
@{Name="accountExpires";Expression={$_.dateAccountExpires}},
@{Name="department";Expression={$_.department}} |
Export-Csv -Path 'D:\test44.csv'
This is what I get in PowerShell ISE:
This is what I had get for the csv file for the expire date:

hi FWN,
the code had giving me error saying that it could not call method on a null-value expression.
$temp = $_.Properties
the code had gave error saying that it could not call method on a null-value expression.
$properties | %{ $res.$_ = $temp.Item($_) }
the code had gave error saying that it could not call method on a null-value expression.
with lot of thanks
noobcy

Similar Messages

  • How to find out the Trace file

    Hi Dba's
    I need to find out the trace file with the Request id. how can i find out it?
    Thanks

    There are many ways to create a trace file in the apps. Pl provide details on how you enabled trace, as that will determine where the trace file is created.Concurrent requests trace files are always created under USER_DUMP_DEST directory.

  • How to export all the site files to the new computer

    I'll be buying a new computer soon and need to export all the
    site files (usernames and passwords) to that. I know how to export
    individual site information, but the passwords are encrypted. Also,
    is there way to save all sites at once and then just transfer that
    to the new machine?

    This is a multi-part message in MIME format.
    ------=_NextPart_000_0039_01C852A0.8D4985F0
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Choose Site > Manage Sites and then use the Export feature
    in the Site =
    Manager. You'll have an option to export all settings
    (including =
    username and password). DW stores them in .ste files, which
    you can =
    later use the Site Manager to Import.=20
    By the way, the Import/Export features work with multiple
    files, just do =
    a multi-select before clicking the Export button and select
    multiple =
    .ste files when importing.
    Best - Joe
    Joseph Lowery
    Vice President of Marketing, WebAssist
    Author of Dreamweaver CS3 Bible
    "Mikkola" <[email protected]> wrote in
    message =
    news:[email protected]...
    > I'll be buying a new computer soon and need to export
    all the site =
    files=20
    > (usernames and passwords) to that. I know how to export
    individual =
    site=20
    > information, but the passwords are encrypted. Also, is
    there way to =
    save all=20
    > sites at once and then just transfer that to the new
    machine?
    >
    ------=_NextPart_000_0039_01C852A0.8D4985F0
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=3DContent-Type content=3D"text/html; =
    charset=3Diso-8859-1">
    <META content=3D"MSHTML 6.00.6000.16587"
    name=3DGENERATOR>
    <STYLE></STYLE>
    </HEAD>
    <BODY>
    <DIV><FONT face=3DArial size=3D2>Choose Site
    &gt; Manage Sites and then =
    use the=20
    Export feature in the Site Manager. You'll have an option to
    export all =
    settings=20
    (including username and password). DW stores them in .ste
    files, which =
    you can=20
    later use the Site Manager to Import.
    </FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>By the way, the
    Import/Export features =
    work with=20
    multiple files, just do a multi-select before clicking the
    Export button =
    and=20
    select multiple .ste files when
    importing.</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Best -
    Joe</FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Joseph
    Lowery<BR>Vice President of =
    Marketing, <A=20
    href=3D"
    http://www.webassist.com">WebAssist</A><BR>Author
    of <A=20
    href=3D"
    http://www.idest.com/dreamweaver/">Dreamweaver
    CS3 =
    Bible</A></FONT></DIV>
    <DIV><FONT face=3DArial
    size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>"Mikkola"
    &lt;</FONT><A=20
    href=3D"mailto:[email protected]"><FONT
    face=3DArial=20
    size=3D2>[email protected]</FONT></A><FONT
    face=3DArial =
    size=3D2>&gt; wrote=20
    in message </FONT><A =
    href=3D"news:[email protected]"><FONT=20
    face=3DArial =
    size=3D2>news:[email protected]</FONT></A><FONT=20
    face=3DArial size=3D2>...</FONT></DIV><FONT
    face=3DArial size=3D2>&gt; =
    I'll be buying a=20
    new computer soon and need to export all the site files
    <BR>&gt; =
    (usernames and=20
    passwords) to that. I know how to export individual site
    <BR>&gt; =
    information,=20
    but the passwords are encrypted. Also, is there way to save
    all <BR>&gt; =
    sites=20
    at once and then just transfer that to the new=20
    machine?<BR>&gt;</FONT></BODY></HTML>
    ------=_NextPart_000_0039_01C852A0.8D4985F0--

  • Whenever I try to export my form data into a csv it is not formatted correctly

    Whenever I try to export my data into a CSV and open it in notepad it does not place each row on a seperate line. Is there any way to insert a return at the end of the form or data so that each row is on a seperate line?

    FormsCentral produces CVS files that use CR (Carriage Return) as the row delimiter.  NotePad requires CRLF (Carriage Return + Line Feed).  If you use a different text editor (WordPad, NotePad++) you will find each record on its own line (assuming you do not have word wrap enabled).

  • How to export oracle 10g data into parts (in excel or csv or txt)

    is there any methods to export the data from oracle 10g in the form of excel or csc or txt. i already downloaded the sql developer tool but it only exports the data of upto one lakh rows ,but i have two tables of more than 3 lakh and 10 lakh rows respectively.for this i used where command to break the file through sql developer but that didnt work
    plz help me out if any thing possible
    i need to again import this data into microsoft sql if there is any direct method plz let me know

    I wrote my own pl/sql tool to make csv upload/download tool, but the learning process is a bit painful and long, especially for beginner like me (end up using dynamic sql package because we pass in table name as parameter).
    For your purpose, maybe the best way is to download a plug-in for Excel that can connect to your Oracle DB. There are many such products so you need to google around. For me, no need right now.
    Another option is to use a commercial tool like Toad, or other products from same company.

  • Exporting xmltype table data into xml/txt file

    I want to export data stored in oracle as xmltype table into xml format file.
    I want to use alternatives to the method shown below as my xml file is large.
    set long 10000000
    spool c:\\StudentXMLJan08.xml
    SELECT
    XMLElement("Student",
    XMLForest(s.studentid "studentid",
    s.firstname "firstname",
    s.lastname "surname"),
    XMLElement("enrollments",
    (SELECT XMLAGG(
    XMLForest(sc.coursecode "courseid"))
    FROM studentcourse sc
    WHERE sc.studentid = s.studentid
    and sc.is_approved='Y'
    and sc.takenyear='2008'
    and sc.takenterm='1')))
    FROM student s
    where s.statuscode in (select studentstatuscode from studentstatus where studentstatusactive=1)
    order by s.studentid;
    spool off
    please help, thank you

    How's this one for size
    SQL> create or replace view DEPARTMENT_XML of xmltype
      2  with object id
      3  (
      4    'DEPARTMENT'
      5  )
      6  as
      7  select xmlElement
      8         (
      9           "Departments",
    10           (
    11             select xmlAgg
    12                    (
    13                      xmlElement
    14                      (
    15                      "Department",
    16                      xmlAttributes( d.DEPARTMENT_ID as "DepartmentId"),
    17                      xmlElement("Name", d.DEPARTMENT_NAME),
    18                      xmlElement
    19                      (
    20                        "Location",
    21                        xmlForest
    22                        (
    23                           STREET_ADDRESS as "Address", CITY as "City", STATE_PROVINCE as "State",
    24                           POSTAL_CODE as "Zip",COUNTRY_NAME as "Country"
    25                        )
    26                      ),
    27                      xmlElement
    28                      (
    29                        "EmployeeList",
    30                        (
    31                          select xmlAgg
    32                                 (
    33                                   xmlElement
    34                                   (
    35                                     "Employee",
    36                                     xmlAttributes ( e.EMPLOYEE_ID as "employeeNumber" ),
    37                                     xmlForest
    38                                     (
    39                                       e.FIRST_NAME as "FirstName", e.LAST_NAME as "LastName", e.EMAIL as "EmailAddre
    ss",
    40                                       e.PHONE_NUMBER as "Telephone", e.HIRE_DATE as "StartDate", j.JOB_TITLE as "Job
    Title",
    41                                       e.SALARY as "Salary", m.FIRST_NAME || ' ' || m.LAST_NAME as "Manager"
    42                                     ),
    43                                     xmlElement ( "Commission", e.COMMISSION_PCT )
    44                                   )
    45                                 )
    46                            from HR.EMPLOYEES e, HR.EMPLOYEES m, HR.JOBS j
    47                           where e.DEPARTMENT_ID = d.DEPARTMENT_ID
    48                             and j.JOB_ID = e.JOB_ID
    49                             and m.EMPLOYEE_ID = e.MANAGER_ID
    50                        )
    51                      )
    52                    )
    53                  )
    54             from HR.DEPARTMENTS d, HR.COUNTRIES c, HR.LOCATIONS l
    55            where d.LOCATION_ID = l.LOCATION_ID
    56              and l.COUNTRY_ID  = c.COUNTRY_ID
    57           )
    58         )
    59    from dual
    60  /
    View created.
    SQL> create or replace trigger DEPARTMENT_DML
      2  instead of INSERT or UPDATE or DELETE
      3  on DEPARTMENT_XML
      4  begin
      5    null;
      6  end;
      7  /
    Trigger created.
    SQL> declare
      2    cursor getDepartments is
      3      select ref(d) XMLREF
      4        from DEPARTMENT_XML d;
      5    res boolean;
      6    targetFolder varchar2(1024) :=  '/public/Departments';
      7  begin
      8    if dbms_xdb.existsResource(targetFolder) then
      9       dbms_xdb.deleteResource(targetFolder,dbms_xdb.DELETE_RECURSIVE_FORCE);
    10    end if;
    11    res := dbms_xdb.createFolder(targetFolder);
    12    for dept in getDepartments loop
    13      res := DBMS_XDB.createResource(targetFolder || '/Departments.xml', dept.XMLREF);
    14    end loop;
    15  end;
    16  /
    PL/SQL procedure successfully completed.
    SQL> select path
      2    from path_view
      3   where equals_path(RES,'/public/Departments/Departments.xml') = 1
      4  /
    PATH
    /public/Departments/Departments.xml
    SQL> select xdburitype('/public/Departments/Departments.xml').getXML()
      2    from dual
      3  /
    XDBURITYPE('/PUBLIC/DEPARTMENTS/DEPARTMENTS.XML').GETXML()
    <Departments>
      <Department DepartmentId="60">
        <Name>IT</Name>
        <Location
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    C:\Temp>ftp localhost
    Connected to mdrake-lap.
    220- mdrake-lap
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 mdrake-lap FTP Server (Oracle XML DB/Oracle Database) ready.
    User (mdrake-lap:(none)): SCOTT
    331 pass required for SCOTT
    Password:
    230 SCOTT logged in
    ftp> cd /public/Departments
    250 CWD Command successful
    ftp> ls -l
    200 EPRT Command successful
    150 ASCII Data Connection
    -rw-r--r--   1 SCOTT    oracle         0 NOV 10 20:18 Departments.xml
    226 ASCII Transfer Complete
    ftp: 71 bytes received in 0.01Seconds 7.10Kbytes/sec.
    ftp> get Departments.xml -
    200 EPRT Command successful
    150 ASCII Data Connection
    <Departments><Department DepartmentId="60"><Name>IT</Name><Location><Address>2014 Jabberwocky Rd</Address><City>Southlak
    e</City><State>Texas</State><Zip>26192</Zip><Country>United States of America</Country></Location><EmployeeList><Employe
    e employeeNumber="103"><FirstName>Alexander</FirstName><LastName>Hunold</LastName><EmailAddress>AHUNOLD</EmailAddress><T
    elephone>590.423.4567</Telephone><StartDate>2006-01-03</StartDate><JobTitle>Programmer</JobTitle><Salary>9000</Salary><M
    anager>Lex De Haan</Manager><Commission></Commission></Employee><Employee employeeNumber="105"><FirstName>David</FirstNa
    me><LastName>Austin</LastName><EmailAddress>DAUSTIN</EmailAddress><Telephone>590.423.4569</Telephone><StartDate>2005-06-
    25</StartDate><JobTitle>Programmer</JobTitle><Salary>4800</Salary><Manager>Alexander Hunold</Manager><Commission></Commi
    ssion></Employee><Employee employeeNumber="106"><FirstName>Valli</FirstName><LastName>Pataballa</LastName><EmailAddress>
    VPATABAL</EmailAddress><Telephone>590.423.4560</Telephone><StartDate>2006-02-05</StartDate><JobTitle>Programmer</JobTitl
    e><Salary>4800</Salary><Manager>Alexander Hunold</Manager><Commission></Commission></Employee><Employee employeeNumber="
    107"><FirstName>Diana</FirstName><LastName>Lorentz</LastName><EmailAddress>DLORENTZ</EmailAddress><Telephone>590.423.556
    7</Telephone><StartDate>2007-02-07</StartDate><JobTitle>Programmer</JobTitle><Salary>4200</Salary><Manager>Alexander Hun
    old</Manager><Commission></Commission></Employee><Employee employeeNumber="104"><FirstName>Bruce</FirstName><LastName>Er
    nst</LastName><EmailAddress>BERNST</EmailAddress><Telephone>590.423.4568</Telephone><StartDate>2007-05-21</StartDate><Jo
    bTitle>Programmer</JobTitle><Salary>6000</Salary><Manager>Alexander Hunold</Manager><Commission></Commission></Employee>
    </EmployeeList></Department><Department DepartmentId="50"><Name>Shipping</Name><Location><Address>2011 Interiors Blvd</A
    ddress><City>South San Francisco</City><State>California</State><Zip>99236</Zip><Country>United States of America</Count
    ry></Location><EmployeeList><Employee employeeNumber="120"><FirstName>Matthew</FirstName><LastName>Weiss</LastName><Emai
    lAddress>MWEISS</EmailAddress><Telephone>650.123.1234</Telephone><StartDate>2004-07-18</StartDate><JobTitle>Stock Manage
    r</JobTitle><Salary>8000</Salary><Manager>Steven King</Manager><Commission></Commission></Employee><Employee employeeNum
    ber="122"><FirstName>Payam</FirstName><LastName>Kaufling</LastName><EmailAddress>PKAUFLIN</EmailAddress><Telephone>650.1
    23.3234</Telephone><StartDate>2003-05-01</StartDate><JobTitle>Stock Manager</JobTitle><Salary>7900</Salary><Manager>Stev
    en King</Manager><Commission></Commission></Employee><Employee employeeNumber="121"><FirstName>Adam</FirstName><LastName
    Fripp</LastName><EmailAddress>AFRIPP</EmailAddress><Telephone>650.123.2234</Telephone><StartDate>2005-04-10</StartDate><JobTitle>Stock Manager</JobTitle><Salary>8200</Salary><Manager>Steven King</Manager><Commission></Commission></Employee
    <Employee employeeNumber="124"><FirstName>Kevin</FirstName><LastName>Mourgos</LastName><EmailAddress>KMOURGOS</EmailAddress><Telephone>650.123.5234</Telephone><StartDate>2007-11-16</StartDate><JobTitle>Stock Manager</JobTitle><Salary>5800<
    /Salary><Manager>Steven King</Manager><Commission></Commission></Employee><Employee employeeNumber="123"><FirstName>Shan
    ta</FirstName><LastName>Vollman</LastName><EmailAddress>SVOLLMAN</EmailAddress><Telephone>650.123.4234</Telephone><Start
    Date>2005-10-10</StartDate><JobTitle>Stock Manager</JobTitle><Salary>6500</Salary><Manager>Steven King</Manager><Commiss
    ion></Commission></Employee><Employee employeeNumber="128"><FirstName>Steven</FirstName><LastName>Markle</LastName><Emai
    lAddress>SMARKLE</EmailAddress><Telephone>650.124.1434</Telephone><StartDate>2008-03-08</StartDate><JobTitle>Stock Clerk
    </JobTitle><Salary>2200</Salary><Manager>Matthew Weiss</Manager><Commission></Commission></Employee><Employee employeeNu
    mber="127"><FirstName>James</FirstName><LastName>Landry</LastName><EmailAddress>JLANDRY</EmailAddress><Telephone>650.124
    .1334</Telephone><StartDate>2007-01-14</StartDate><JobTitle>Stock Clerk</JobTitle><Salary>2400</Salary><Manager>Matthew
    Weiss</Manager><Commission></Commission></Employee><Employee employeeNumber="126"><FirstName>Irene</FirstName><LastName>
    Mikkilineni</LastName><EmailAddress>IMIKKILI</EmailAddress><Telephone>650.124.1224</Telephone>
    <StartDate>2002-06-07</St
    artDate><JobTitle>Public Relations Representative</JobTitle><Salary>10000</Salary><Manager>Neena Kochhar</Manager><Commi
    ssion></Commission></Employee></EmployeeList></Department></Departments>226 ASCII Transfer Complete
    ftp: 40392 bytes received in 0.08Seconds 480.86Kbytes/sec.
    ftp>

  • How To Export from Mac address book to CSV file

    In Mac's address book: How do you export a highlighted group of *contacts to a cvs file* (so that I can import in groups by my categories into Google contacts- that way it is easier to sort/designate the contacts one I get the contacts there into Google).
    I can sync them all- but then I'd have to put them into their categories one at a time, there are too many...
    thx missy
    (I'm used to ms office and pc's)

    Okay, *I got this issue worked out;here's how.* (Unfortunately the mac app AB2CSV doesn't open up to the screens it's supposed to in order to choose and convert or save contacts to a csv file and did crash my address book- which was very scary to see my 1533 contacts vanish!! )
    Luckily somehow I had made an archive file of them all and got them back into my mac Calendar unscathed -so I lucked out...
    Today at my local Apple Store in Nashville *I was shown a better way-and I'm glad to share this with you*:(They also set up my mobile me and my itouch to sync my contacts and emails too-plus got my contacts synced up to my GoogleApps acnt- so now I am in the clouds, backed up, and liberated-in spite of myself!!)
    *iWorks Numbers* works similar to msExcel, so you *open up Numbers* ;get on to a *new blank page*;also *open Address Book* and highlight the contacts from your address book and *drag them right on to your Numbers page*; like magic it looks like an excel spread sheet (you can choose the columns/headers you want to use ie name,phone #,street,city, email, etc even the notes); then you go up to *Share in the menu*; *choose csv file*; and *save it*...Thank you Apple store Green Hills!! you saved me today!!

  • How to export contacts and change vcf to csv file

    I need to export the contacts so I can make updates and import them into my marketing system. iCloud exports in only ,vcf, which cannot be imported anywhere I can find.( that is the entire file, not one contact at a time)  I am very frustrated and don't understand Apple using this format for exporting.Every other application I can think of uses .csv and none takes .vcf for import.
    Help!

    You might want to try an app that can export in CSV format, like My Contacts Backup.

  • How to insert 3D Model data into an EPUB file?

    Afternoon,
    I am trying to insert a 3D model into an epub document. Does anybody know how to do this either within InDesign or with any other Adobe Program? The model I have is a Sketchup model and any export file type I try cannot be opened directly within InDesign.
    In terms of working with an EPUB file Mac had the ibooks Author software which lets you insert Collada data and view a 3D Model within an ebook however this only lets me maintain my file as a ibook but in terms of the business I need to maintain EPUB compatibility as they are more uniformly compatible across our clientèle.
    Can anyone shed some light on how to achieve the output I require?
    Spoke to adobe support and they expressed about using 3rd party external coders to achieve this but i know very little about code unfortunately.
    Regards,
    G

    InDesign doesn't natively support placing 3D models. It would have to be done with coding. If you can't do the coding yourself, you may have to pay for the service from an EPUB coding expert. You could also investigate third party EPUB software to see if they support it. Here is a recently-mentioned example (I don't know if they support it):
    http://iampariah.com/blog/creative-pro/fill-indesigns-fixed-layout-epub-gaps-with-circular flo.php

  • How to export a report data with a custom file name?

    Hello:
    Env: OBIEE 11g Answers/Interactive Dashboards
    I have a tabular report (built in Answers) and displayed in a Dashboard. I want to export the report data in csv format prefixed with the <OBIEE user login name>_<Name of the Report>_<current timestamp> on a certain folder.
    Any ideas appreciated..
    Thanks
    Sankar Bala
    Edited by: 589151 on Mar 7, 2012 6:14 AM

    This does not help solve my problem.
    Tabular Report->Place it in a section in a dashboard->Report Links (Export Option turned on). When doing the export, I want to change the file name as the <Login Name>_<File Name>_<Time Stamp>.csv when doing the export into csv from the dashboard.
    Regards
    Sankar

  • How To Re-Input More Data To A Text File?

    I was wondering if anyone could tell me how to re-input more data into a text file? I don't want to over-write the text file, but just add more data to it. The current code i have is:
    import java.util.Scanner;
    import java.io.*;
    class trialanderror002 {     
    public static void main(String args[]){     
         Scanner input = new Scanner(System.in);
         String str;
    FileOutputStream out;
    PrintStream p;
    try{
         out = new FileOutputStream("c:\\products.txt");
         p = new PrintStream(out);
         System.out.println("Please insert text to be written to file...");
         str = input.next();
         p.println (str);
         p.close();
    catch (Exception e){
         System.err.println ("Error writing to file");
    Basically, after each time the program is ran, i'd like to insert another line of data into products.txt.
    Is there a way for me to loop the program too and not remove the data from the text file?
    thanx...

    just one more question...
    i've figured out the code to retrieve the text file and print it to screen...but how do i go about only printing parts of my text file?
    So supposing my text file has 5 lines of data/text etc, how would i make it print the first line?...or the second line?...or the third....etc etc...
    the current code i now have is:
    package Assignment1;
    import java.util.Scanner;
    import java.io.*;
    class trialanderror002 {     
    public static void main(String args[]){     
         Scanner input = new Scanner(System.in);
         String str;
    FileOutputStream out;
    PrintStream p;
    try{
         out = new FileOutputStream("c:\\trial.txt", true);
         p = new PrintStream(out);
         System.out.println("Please insert text to be written to file...");
         str = input.next();
         p.println (str);
         p.close();
    catch (Exception e){
         System.err.println ("Error writing to file");
              try {
              FileReader file = new
              FileReader("c:\\trial.txt");
              BufferedReader buff = new
              BufferedReader(file);
              boolean eof = false;
              while (!eof){
                   String line = buff.readLine();
                   if (line == null)
                        eof = true;
                   else
                        System.out.println(line);
              buff.close();
              }catch (IOException e){
                   System.out.println("Error -- " + e.toString());
    }

  • Split records into Multiple csv files using a Threshold percentage

    Hi Gurus,
    I have a requirement to split the data into two csv file from a table using a threshold value(in Percentage) .
    Assume that If my source select query of interface fetches 2000 records , I will provide a threshold value like 20%.
    I need to generate a csv1 with 400 records(20% of 2000) and the rest of the records into another csv2.
    For implementing this I am trying to use the following process.
    1) Create a procedure with the select query to get the count of records.
    Total Records count: select count(1) from source_table <Joins> <Lookups> <Conditions>;
    2) Calculate the Record count to first CSV using the threshold_value.
    CSV1_Count=Total records count /threshold_value
    3) Create a view that fetches the CSV1_Count(400) records for CSV1 as follows.
    Create view CSV1_view as select Col1,Col2,Col3 from source_table <Joins> <Lookups> <Conditions>
    Where rownum<=CSV1_Count;
    4) Generate CSV1 file using View 'CSV1_View'
    5) Generate CSV2 File using the Interface with same select statement (with columns ) to generate a CSV.
    select Col1,Col2,Col3 from source_table ST <Joins> <Lookups> <Conditions>
    Left outer join (Select Col1 from CSV1_View ) CS on CS.Col1=ST.Col1 where CS.Col1 is null;
    Which gives the Total records minus the CS1_View records.
    The above process seems a bit complex and very simple . If any changes in my Interface I also need to change the procedure (counts the no:of records).
    Please provide your comments and feedback about this and looking for your inputs for any new simple approach or fine tune the above approach.
    Thanks,
    Arjun

    Arjun,
    This are my thoughts and Lets do it in 3 Steps
    Step 1.  ODI Procedure
    Drop table Temp_20 ;
    Create table Temp_20 as select * from table where rownum < ( SELECT TRUNC( COUNT(1) /5) FROM TABLE ) .
    [ ** This way iam fetching approx 20% of the table data and loading into Temp table . 1/5 th is 20%  so i am dividing count by 5
    I don't believe View will help you especially with RowNum as if you run the same query with rownum < N the rows order might differ . so Temp table is great ]
    Step 2 .  Use OdiSqlUnload  with select columns  from temp_20
    Step 3 . Use again OdiSqlUnload  with  select columns from table where  ( uk keys ) not in ( selecy uk_keys from temp_20)
    [** this way you can pick the remaining 80% ** and the data will be not repeat itself across 20% and 80% , as might happen with view ]
    what do you think ?

  • Import data from excel/csv file in web dynpro

    Hi All,
    I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
    How can I read/import data from excel / csv file in web dynpro table context?
    Any help is appreciated.
    Thanks a lot
    Aakash

    Hi,
    Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
    jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
    Create a workbook from a file on the local file system, as illustrated in the following code fragment:
              import java.io.File;
              import java.util.Date;
              import jxl.*;
             Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
    On getting access to the worksheet, once can use the following code piece to access  individual sheets. These are zero indexed - the first sheet being 0, the  second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
              Sheet sheet = workbook.getSheet(0);
    After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
    Cell a1 = sheet.getCell(0,0);
    Cell b2 = sheet.getCell(1,1);
    Cell c2 = sheet.getCell(2,1);
    String a1 = a1.getContents();
    String b2 = b2.getContents();
    String c2 = c2.getContents();
    // perform operations on strings
    However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
      String a1 = null;
      Double b2 = 0;
      Date c2 = null;
                        Cell a1 = sheet.getCell(0,0);
                        Cell b2 = sheet.getCell(1,1);
                        Cell c2 = sheet.getCell(2,1);
                        if (a1.getType() == CellType.LABEL)
                           LabelCell lc = (LabelCell) a1;
                           stringa1 = lc.getString();
                         if (b2.getType() == CellType.NUMBER)
                           NumberCell nc = (NumberCell) b2;
                           numberb2 = nc.getValue();
                          if (c2.getType() == CellType.DATE)
                            DateCell dc = (DateCell) c2;
                            datec2 = dc.getDate();
                           // operate on dates and doubles
    It is recommended to, use the close()  method (as in the code piece below)   when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.              
              // Finished - close the workbook and free up memory
              workbook.close();
    The API class files are availble in the 'jxl.jar', which is available for download.
    Regards
    Raghu

  • What is the best way to export the data out of BW into a flat file on the S

    Hi All,
    We are BW 7.01 (EHP 1, Service Pack Level 7).
    As part of our BW project scope for our current release, we will be developing certain reports in BW, and for certain reports, the existing legacy reporting system based out of MS Access and the old version of Business Objects Release 2 would be used, with the needed data supplied from the BW system.
    What is the best way to export the data out of BW into a flat file on the Server on regular intervals using a process chain?
    Thanks in advance,
    - Shashi

    Hello Shashi,
    some comments:
    1) An "open hub license" is required for all processes that extract data from BW to a non-SAP system (including APD). Please check with your SAP Account Executive for details.
    2) The limitation of 16 key fields is only valid when using open hub for extracting to a DB table. There's no such limitation when writing files.
    3) Open hub is the recommended solution since it's the easiest to implement, no programming is required, and you don't have to worry much about scaling with higher data volumes (APD and CRM BAPI are quite different in all of these aspects).
    For completeness, here's the most recent documentation which also lists other options:
    http://help.sap.com/saphelp_nw73/helpdata/en/0a/0212b4335542a5ae2ecf9a51fbfc96/frameset.htm
    Regards,
    Marc
    SAP Customer Solution Adoption (CSA)

  • How to find out which data control do the page layout components come from?

    hi,
    work in Jdev 11.1.2.3
    After have drag and drop data control into pages designer, how to find out which data control do the page layout component (such as a field in form layout) come from?
    --i cannot find data control related information in the property pallete for the page layout component.
    Regards.

    This information can be found in the page definition file.
    Select the field in the page and then click the binding tab.

Maybe you are looking for

  • Synced photo albums do not show up on ipad until rebooted - latest OS

    Very annoying.  Latest iTunes and iOS on iPad.  Windows 8 PC OS.  Sync works terribly.  Videos don;t sync.  Photos sync, but new albums show up only after I reboot.  iTunes is not accurate about space used and space remainign.  What's the deal- this

  • WAD - open Document in the new window

    Hi All, in my old web application 3.5 I had the possibility to open the HTML file from MIME repository. All what I had to do was to press the button. Now I have the new web application 7.x and put the same document into the KM. In the next step I wou

  • Java plug-in 1.4.1 proxy configuration issue causes JTextField TAB problems

    I have an applet that has multiple JTextFields in it. I recently updated my Java plug-in to version 1.4.1, and now using TAB to navigate among text fields does not always work when I first bring up a browser and load the applet. I've found, however,

  • TO ALL WITH A SCREEN CRACK IN THEIR NANO

    If you remember, I posted a thread a few days ago about my nano's screen crack. I called up their technical support line (1-800-275-2273) and spoke with someone about it. They said that I will have to take my nano to my local apple store during a sch

  • How do i change my review name?

    the name that shows up when you write reviews... how do you change it???