Import CSV data to an existing populated XLS file

Hi Guys,
Looking for some assistance, with some powershell I have never done before..  and don't know where to start..
I have a CSV file that contains some data - Several items exported from a standard powershell command.
I also have an XLS file that has been manually populated for the last 6 months with data.
What I want to get to (and have started with exporting the data to csv) is for the script to run, and add the data from the CSV to the XLS in the already exisiting colum heading.
SO in the first row - we need to add the date, followed by adding data under each subsequent column that already has a heading..
Anyone got any suggestions on where to start with this? Any advice greatly appreciated.
Thanks
Allan Harding

I think your question is a bit too broad and vague.
If you are not a scripter then I recommend asking in the Exxcel forum.  THey will help you learn how to use Excel tomerge data tables.
If you want to scrpt this then youneed to start by learning how to write a script.  YOu will want to use Import-Csv and the Excel object model.
If this is critical then I recommend contacting a consultant.
http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx
¯\_(ツ)_/¯

Similar Messages

  • How to import csv data into Oracle using c#

    Hello,
    How to import csv data into Oracle using c #. Where data to be imported 3GB in size and number of rows 7512263. I've managed to import csv data into Oracle, but the time it takes about 1 hour. How to speed up the time it takes to import csv data into oracle. Thank you.
    This is my code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Threading;
    using System.Text.RegularExpressions;
    using System.IO;
    using FileHelpers;
    using System.Data.OracleClient;
    namespace sqlloader
    class Program
    static void Main(string[] args)
    int jum;
    int i;
    bool isFirstLine = false;
    FileHelperEngine engine = new FileHelperEngine(typeof(XL_XDR));
    //Connect To Database
    string constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST="
    + "(ADDRESS=(PROTOCOL=TCP)(HOST= pt-9a84825594af )(PORT=1521 )))"
    + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=o11g)));"
    + "User Id=xl;Password=rahasia;";
    OracleConnection con = new OracleConnection(constr);
    con.Open();
    // To Read Use:
    XL_XDR[] res = engine.ReadFile("DataOut.csv") as XL_XDR[];
    jum = CountLinesInFile("DataOut.csv");
    FileInfo f2 = new FileInfo("DataOut.csv");
    long s2 = f2.Length;
    int jmlRecord = jum - 1;
    for (i = 0; i < jum; i++)
    ShowPercentProgress("Processing...", i, jum);
    Thread.Sleep(100);
    if (isFirstLine == false)
    isFirstLine = true;
    else
    string sql = "INSERT INTO XL_XDR (XDR_ID, XDR_TYPE, SESSION_START_TIME, SESSION_END_TIME, SESSION_LAST_UPDATE_TIME, " +
    "SESSION_FLAG, VERSION, CONNECTION_ROW_COUNT, ERROR_CODE, METHOD, HOST_LEN, HOST, URL_LEN, URL, CONNECTION_START_TIME, " +
    "CONNECTION_LAST_UPDATE_TIME, CONNECTION_FLAG, CONNECTION_ID, TOTAL_EVENT_COUNT, TUNNEL_PAIR_ID, RESPONSIVENESS_TYPE, " +
    "CLIENT_PORT, PAYLOAD_TYPE, VIRTUAL_TYPE, VID_CLIENT, VID_SERVER, CLIENT_ADDR, SERVER_ADDR, CLIENT_TUNNEL_ADDR, " +
    "SERVER_TUNNEL_ADDR, ERROR_CODE_2, IPID, C2S_PKTS, C2S_OCTETS, S2C_PKTS, S2C_OCTETS, NUM_SUCC_TRANS, CONNECT_TIME, " +
    "TOTAL_RESP, TIMEOUTS, RETRIES, RAI, TCP_SYNS, TCP_SYN_ACKS, TCP_SYN_RESETS, TCP_SYN_FINS, EVENT_TYPE, FLAGS, TIME_STAMP, " +
    "EVENT_ID, EVENT_CODE) VALUES (" +
    "'" + res.XDR_ID + "', '" + res[i].XDR_TYPE + "', '" + res[i].SESSION_START_TIME + "', '" + res[i].SESSION_END_TIME + "', " +
    "'" + res[i].SESSION_LAST_UPDATE_TIME + "', '" + res[i].SESSION_FLAG + "', '" + res[i].VERSION + "', '" + res[i].CONNECTION_ROW_COUNT + "', " +
    "'" + res[i].ERROR_CODE + "', '" + res[i].METHOD + "', '" + res[i].HOST_LEN + "', '" + res[i].HOST + "', " +
    "'" + res[i].URL_LEN + "', '" + res[i].URL + "', '" + res[i].CONNECTION_START_TIME + "', '" + res[i].CONNECTION_LAST_UPDATE_TIME + "', " +
    "'" + res[i].CONNECTION_FLAG + "', '" + res[i].CONNECTION_ID + "', '" + res[i].TOTAL_EVENT_COUNT + "', '" + res[i].TUNNEL_PAIR_ID + "', " +
    "'" + res[i].RESPONSIVENESS_TYPE + "', '" + res[i].CLIENT_PORT + "', '" + res[i].PAYLOAD_TYPE + "', '" + res[i].VIRTUAL_TYPE + "', " +
    "'" + res[i].VID_CLIENT + "', '" + res[i].VID_SERVER + "', '" + res[i].CLIENT_ADDR + "', '" + res[i].SERVER_ADDR + "', " +
    "'" + res[i].CLIENT_TUNNEL_ADDR + "', '" + res[i].SERVER_TUNNEL_ADDR + "', '" + res[i].ERROR_CODE_2 + "', '" + res[i].IPID + "', " +
    "'" + res[i].C2S_PKTS + "', '" + res[i].C2S_OCTETS + "', '" + res[i].S2C_PKTS + "', '" + res[i].S2C_OCTETS + "', " +
    "'" + res[i].NUM_SUCC_TRANS + "', '" + res[i].CONNECT_TIME + "', '" + res[i].TOTAL_RESP + "', '" + res[i].TIMEOUTS + "', " +
    "'" + res[i].RETRIES + "', '" + res[i].RAI + "', '" + res[i].TCP_SYNS + "', '" + res[i].TCP_SYN_ACKS + "', " +
    "'" + res[i].TCP_SYN_RESETS + "', '" + res[i].TCP_SYN_FINS + "', '" + res[i].EVENT_TYPE + "', '" + res[i].FLAGS + "', " +
    "'" + res[i].TIME_STAMP + "', '" + res[i].EVENT_ID + "', '" + res[i].EVENT_CODE + "')";
    OracleCommand command = new OracleCommand(sql, con);
    command.ExecuteNonQuery();
    Console.WriteLine("Successfully Inserted");
    Console.WriteLine();
    Console.WriteLine("Number of Row Data: " + jmlRecord.ToString());
    Console.WriteLine();
    Console.WriteLine("The size of {0} is {1} bytes.", f2.Name, f2.Length);
    con.Close();
    static void ShowPercentProgress(string message, int currElementIndex, int totalElementCount)
    if (currElementIndex < 0 || currElementIndex >= totalElementCount)
    throw new InvalidOperationException("currElement out of range");
    int percent = (100 * (currElementIndex + 1)) / totalElementCount;
    Console.Write("\r{0}{1}% complete", message, percent);
    if (currElementIndex == totalElementCount - 1)
    Console.WriteLine(Environment.NewLine);
    static int CountLinesInFile(string f)
    int count = 0;
    using (StreamReader r = new StreamReader(f))
    string line;
    while ((line = r.ReadLine()) != null)
    count++;
    return count;
    [DelimitedRecord(",")]
    public class XL_XDR
    public string XDR_ID;
    public string XDR_TYPE;
    public string SESSION_START_TIME;
    public string SESSION_END_TIME;
    public string SESSION_LAST_UPDATE_TIME;
    public string SESSION_FLAG;
    public string VERSION;
    public string CONNECTION_ROW_COUNT;
    public string ERROR_CODE;
    public string METHOD;
    public string HOST_LEN;
    public string HOST;
    public string URL_LEN;
    public string URL;
    public string CONNECTION_START_TIME;
    public string CONNECTION_LAST_UPDATE_TIME;
    public string CONNECTION_FLAG;
    public string CONNECTION_ID;
    public string TOTAL_EVENT_COUNT;
    public string TUNNEL_PAIR_ID;
    public string RESPONSIVENESS_TYPE;
    public string CLIENT_PORT;
    public string PAYLOAD_TYPE;
    public string VIRTUAL_TYPE;
    public string VID_CLIENT;
    public string VID_SERVER;
    public string CLIENT_ADDR;
    public string SERVER_ADDR;
    public string CLIENT_TUNNEL_ADDR;
    public string SERVER_TUNNEL_ADDR;
    public string ERROR_CODE_2;
    public string IPID;
    public string C2S_PKTS;
    public string C2S_OCTETS;
    public string S2C_PKTS;
    public string S2C_OCTETS;
    public string NUM_SUCC_TRANS;
    public string CONNECT_TIME;
    public string TOTAL_RESP;
    public string TIMEOUTS;
    public string RETRIES;
    public string RAI;
    public string TCP_SYNS;
    public string TCP_SYN_ACKS;
    public string TCP_SYN_RESETS;
    public string TCP_SYN_FINS;
    public string EVENT_TYPE;
    public string FLAGS;
    public string TIME_STAMP;
    public string EVENT_ID;
    public string EVENT_CODE;
    I hope someone can give me a solution. Thanks

    The fastest way is to use external tables or sql loader (sqlldr). (If you use external tables or sql loader, you don't use C# at all).

  • I'm getting a 'The Management Pack element is not declared' error when trying to import CSV data into my *extended* WindowsComputer class

    Background:
    I have a class called SUS_WindowsComputerMP, that is an extension of the Microsoft class, Microsoft.Windows.Computer
    I'm trying to import CSV data into this extended class and to the base class as well.
    Question:
    What am I doing wrong? I have a feeling that the Import CSV Format file is different for importing data into *extended* classes like mine, because the XML structure below would work for non-extended classes.
    "...Creating new CSVImporter
    Data Filename: D:\Peter\CMDB II\Exported MPs\TestMPs\SUS_WindowsComputer.csv
    Format Filename: D:\Peter\CMDB II\Exported MPs\SUS_WindowsComputerMP.xml
    Validating against XSD schema...
    The 'ManagementPack' element is not declared.
    Validation completed.
    Format file D:\Peter\CMDB II\Exported MPs\SUS_WindowsComputerMP.xml contains an invalid root element. Expected: root node with name \"CSVImportFormat\"
    Could not initialize a Management Object Creator from format file D:\Peter\CMDB II\Exported MPs\SUS_WindowsComputerMP.xml. Import thread exiting.
    My import format XML is this:
    <CSVImportFormat>
    <Class Type="ClassExtension_a3ae3e0f_d578_43dc_aa3e_9037a094763c" >
    <Property ID="WindowsServerID" />
    <Property ID="PrincipalName" />
    <Property ID="NetbiosComputerName" />
    <Property ID="IPAddress" />
    <Property ID="NetbiosDomainName" />
    <Property ID="DNSName" />
    <Property ID="OSVersionDisplayName" />
    <Property ID="SerialNo" />
    <Property ID="ServerDescription" />
    <Property ID="AssetTagNo" />
    <Property ID="ServerNameRow" />
    <Property ID="ChassisType" />
    <Property ID="InstallDate" />
    <Property ID="IsVirtualMachine" />
    <Property ID="BusinessUnitCustomersEnum" />
    <Property ID="RegionLocationEnum" />
    <Property ID="OtherFunctionRoleEnum" />
    <Property ID="ProductTypeEnum" />
    <Property ID="ObjectStatus" />
    <Property ID="AssetStatus" />
    <Property ID="CriticalityEnum" />
    <Property ID="EnvironmentEnum" />
    <Property ID="CostCodeClassEnum" />
    <Property ID="DataClassificationEnum" />
    <Property ID="Manufacturer" />
    </Class>
    </CSVImportFormat>

    Hello,
    Can anyone please help me out with this weird issue.
    thanks,
    orton

  • Using PowerShell to import CSV data from Vendor database to manipulate Active Directory Users

    Hello,
    I have a big project I am trying to automate.  I am working in a K-12 public education IT Dept. and have been tasked with importing data that has been exported from a vendor database via .csv file into Active Directory to manage student accounts. 
    My client wants to use this data to make bulk changes  to student user accounts in AD such as moving accounts from one OU to another, modifying account attributes based on State ID, lunchroom ID, School, Grade, etc. and adding new accounts / disabling
    accounts for students no longer enrolled.
    The .csv that is exported doesn't have headers that match up with what is needed for importing in AD, so those have to be modified in this process, or set as variables to get the correct info into the correct attributes in AD or else this whole project is
    a bust.  He is tired of manually manipulating the .csv data and trying to get it onto AD with few or no errors, hence the reason it has been passed off to me.
    Since this information changes practically daily, I need a way to automate user management by accomplishing the following on a scheduled basis.
    Process must:
    Check to see if Student Number already exists
    If yes, then modify account
    Update {School Name}, {Site Code}, {School Number}, {Grade Level} (Variables)
    Add correct group memberships (School / Grade Specific)
    Move account to correct OU (OU={Grade},OU=Students,OU=Users,OU={SiteCode},DC=Domain,DC=net)
    Remove incorrect group memberships (School / Grade Specific)
    Set account status (enabled / disabled)
    If no, create account
    Import Student #
    Import CNP #
    Import Student name
    Extract First and Middle initial
    If duplicate name exists
    Create log entry for review
    Import School, School Number, Grade Level
    Add to correct Group memberships (School / Grade Specific)
    Set correct OU (OU={Grade},OU=Students,OU=Users,OU={SiteCode},DC=Domain,DC=net)
    Set account Status
    I am not familiar with Powershell, but have researched enough to know that it will be the best option for this project.  I have seen some partial solutions in VB, but I am more of an infrastructure person instead of scripting / software development. 
    I have just started creating a script and already have hit a snag.  Maybe one of you could help.
    #Connect to Active Directory
    Import-Module ActiveDirectory
    # Import iNOW user information
    $Users = import-csv C:\ADUpdate\INOW_export.csv
    #Check to see if the account already exists in AD
    ForEach ( $user in $users )
    #Assign the content to variables
    $Attr_employeeID = $users."Student Number"
    $Attr_givenName = $users."First Name"
    $Attr_middleName = $users."Middle Name"
    $Attr_sn = $users."Last Name"
    $Attr_postaldeliveryOfficeName = $users.School
    $Attr_company = $users."School Number"
    $Attr_department = $users."Grade Level"
    $Attr_cn = $Attr_givenName.Substring(0,1) + $Attr_middleName.Substring(0,1) + $Attr_sn
    IF (Get-ADUser $Attr_cn)
    {Write-Host $Attr_cn already exists in Active Directory

    Thank you for helping me with that before it became an issue later on, however, even when modified to be $Attr_sAMAaccountName i still get errors.
    #Connect to Active Directory
    Import-Module ActiveDirectory
    # Import iNOW user information
    $Users = import-csv D:\ADUpdate\Data\INOW_export.csv
    #Check to see if the account already exists in AD
    ForEach ( $user in $users )
    #Assign the content to variables
    $Attr_employeeID = $users."Student Number"
    $Attr_givenName = $users."First Name"
    $Attr_middleName = $users."Middle Name"
    $Attr_sn = $users."Last Name"
    $Attr_postaldeliveryOfficeName = $users.School
    $Attr_company = $users."School Number"
    $Attr_department = $users."Grade Level"
    $Attr_sAMAccountName = $Attr_givenName.Substring(0,1) + $Attr_middleName.Substring(0,1) + $Attr_sn
    IF (Get-ADUser $Attr_sAMAccountName)
    {Write-Host $Attr_sAMAccountName already exists in Active Directory
    PS C:\Windows\system32> D:\ADUpdate\Scripts\INOW-AD.ps1
    Get-ADUser : Cannot convert 'System.Object[]' to the type 'Microsoft.ActiveDirectory.Management.ADUser'
    required by parameter 'Identity'. Specified method is not supported.
    At D:\ADUpdate\Scripts\INOW-AD.ps1:28 char:28
    + IF (Get-ADUser $Attr_sAMAccountName)
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-ADUser], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.Management.Commands.GetAD
    User

  • Importing CSV dates - wrong format

    Hi,
    I have some CSV data I want to import into Numbers and the CSV has dates. I work with "British" style dd/mm/yy dates but the CSV is "American" mm/dd/yy. How can I persuade Numbers to translate between the two styles?
    Thanks,
    Dave

    Run this script or drag & drop the csv on the script icon (saved as an application).
    The embedded dates will be changed from US format to English (French) one.
    The edited csv file will be saved in the Temporary items folder an opened by Numbers.
    --[SCRIPT csvUStocsvUSEN]
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/01/04
    --=====
    property theApp : "Numbers"
    property permitted : {"public.comma-separated-values-text", "public.csv"}
    --=====
    on run
    if my parle_anglais() then
    set myPrompt to "Choose a csv file…"
    else
    set myPrompt to "Choisir un fichier csv…"
    end if -- parleAnglais
    set allowed to my permitted
    if 5 = (system attribute "sys2") then (*
    it's Mac OS X 10.5.x with a buggued Choose File *)
    set allowed to {}
    end if -- 5 = (system…
    my commun(choose file with prompt myPrompt of type allowed without invisibles) (* un alias *)
    end run
    --=====
    on open (sel)
    my commun(item 1 of sel) (* an alias *)
    end open
    --=====
    on commun(le_csv)
    local uti, en_texte, nom_fichier, p2t
    tell application "System Events"
    try
    set uti to type identifier of disk item ("" & le_csv)
    on error
    set uti to "???"
    end try
    end tell
    if uti is not in permitted then
    if my parleanglais() then
    error "The document “" & le_csv & "” isn’t a csv one !"
    else
    error "Le document « " & le_csv & " » n’est pas un fichier csv !"
    end if
    end if
    set les_lignes to paragraphs of (read le_csv)
    repeat with l from 1 to count of les_lignes
    set une_ligne to item l of les_lignes
    if une_ligne contains "/" then
    set une_ligne to my decoupe(une_ligne, ",")
    repeat with c from 1 to count of une_ligne
    set maybe to my decoupe(item c of une_ligne, "/")
    if (count of maybe) = 3 then
    set item c of une_ligne to my recolle({item 2 of maybe, item 1 of maybe, item 3 of maybe}, "/")
    end if -- count of maybe…
    end repeat
    set item l of les_lignes to my recolle(une_ligne, ",")
    end if
    -- set item l of les_lignes to my remplace(item l of les_lignes, ",", ";") -- Useful for French systems
    end repeat
    set en_texte to my recolle(les_lignes, return)
    set nom_fichier to (do shell script "date +%Y%m%d%H%M%S.csv")
    set p2t to (path to temporary items from user domain)
    set lenouveaucsv to ("" & p2t & nom_fichier)
    tell application "System Events" to make new file at end of p2t with properties {name:nom_fichier}
    set la_longueur to count of en_texte
    write en_texte to file lenouveaucsv
    tell application "System Events"
    repeat while size of file lenouveaucsv < la_longueur
    delay 0.2
    end repeat
    end tell
    tell application "Numbers" to open file lenouveaucsv
    end commun
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    replaces every occurences of d1 by d2 in the text t
    on remplace(t, d1, d2)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d1
    set l to text items of t
    set AppleScript's text item delimiters to d2
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end remplace
    --=====
    on parle_anglais()
    return (do shell script "defaults read 'Apple Global Domain' AppleLocale") does not start with "fr_"
    end parle_anglais
    --=====
    -- [/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) mardi 4 janvier 2011 09:39:38

  • Import XML data to textfields in a PDF file

    Can I use LiveCycle Designer 8.2 to auto populate textfields in a PDF-file with data from a XML-file when the user opens the PDF-file? If so, how will I do it? Is there any guide?
    It works fine in the Livecycle Designer preview but when I open the PDF-file all textfields are empty. It also works fine if I import data from a OLEDB-connection.
    Regards
    Mikael Forssell

    I'm looking for a solution for the same thing. I have a pdf form with fields bound to an xml file, but Acrobat will only import the data manually (Forms / Manage Form Data / Import Data) and Reader doesn't work at all.
    Tech Support says that when in Livecycle, you're working in an xml environment, so the 'Preview PDF' works. Acrobat and Reader aren't xml environments, so they won't display the data.
    What we need is a javascript programmer who can figure this out. Possibly using the remerge function. Anyone???
    Don.

  • Populating XLS file using ODI

    Hi,
    I have a requirement i will receive on a daily basis a file from SAP having some data.I need to integrate the data coming in a XLS file.
    What i know till now is i can create Oracle table from the Text file.
    Now i would like to know if there is any way to create Excel file from that database?
    If yes how could i achieve that?
    Thanks,
    Mahesh

    Hi Mahesh
    This is already given in oracle blog ( Using Microsoft Excel as a Target in an Interface ).
    https://blogs.oracle.com/dataintegration/entry/using_microsoft_excel_as_a_sou
    Thanks.

  • Dates change from Numbers generated xls file when copy/pasted

    I've saved a Numbers '09 file as xls and sent it to an Excel 2003 for Windows user.  The file looks great when they open it in Excel 2003.  But, when they copy and paste data into a different Excel 2003 file, the date changes about 4 years, which seems to make this a 1900/1904 issue.   But why?  If Excel 2003 opened up the original xls file generated by Numbers ok, why can't the dates be copy and pasted into another Excel 2003 spreadsheet?  

    Apple uses a year pattern that starts with the first day of the first leap year in the 20th century.
    Microsoft originally adopted a year pattern that began with the first day of the last year of the 19th century (1900) which, although it was a year divisible by 4, was not a leap year.
    Later, MS added the 1904 start pattern, but kept the1900 start pattern as well.
    What is likely happening in the case you describe is this:
    When Numbers traslates the document into Excel format and saves it, Numbers apparenly includes the flag that tells Excl 'use the 1904 start for dates.' Excel open the file, reads the code, and sets the calendar accordingly.
    When the Excel 2003 user then copies the data frm that document, the copy picks up only the date serial number(s), and does not get the coded flag identifying which date system is in use.
    That data is then pasted into the new Excel document, and with no flag to tell it different, Excel uses its 'normal' setting—the calendar starts on January 1, 1900—and all dates are interpreted as being four years earlier than they were in the original Numbers table or in the first Excel sheet.
    I'd assume there is a setting that can be changed in Excel. Where to find it/how to use it would be a good question for an Excel community discussion site. (Although it's possible an answer might arrive here as well.)
    Regards,
    Barry

  • Downloading data from internal table to xls file leading zeros are not disp

    Hai abap gurus,
    when i am downloading data from internal table to excle file. some field values in a column are with leading zeros and some others dont have leading zeros.but in the output it is showing without leading zeros. then how to get with exact values.
    Ex:
    <b>ECC Code.</b>
    045234
      88567
    098456 
    but output is giving like this:
    45234
    88567
    98456
    how to get the actual values.....
    plz help me in this matter.

    Dear Kiran,
    Those field in the internal table having Leading Zeroes, make those fields' datatype as character.
    Then use the function module to download the content of the internal table to the excel file.
    Regards,
    Abir
    Don't forget to Reward Points  *

  • Creating stored procedure to import csv data into tables

    I am trying to create a stored procedure to import data from a csv file into a table. I tried using sqlldr but could not run it at school due to access permissions that they will not change. So I looked at the utl_package and from what I can see it requires a "virtual" directory, which conflicts with the access permissions again at school. So can I create a stored procedure that will just read data from a csv file into a table without the need to write or create a file/directory.
    Thankyou

    Satyaki_De wrote:
    Since, you are talking about so much restriction - i don't think you will get that.
    One alternative solution can be -> write a java based pl/sql procedure and try load that by parsing it. But, for that you need execute privileges on dbms_java package.
    Do you have that? I doubt.
    Regards.
    Satyaki De.Nope not allowed to use java, and im new to oracle. Why can't a stored procedure in pl/sql just read a file and put the data into a table I create prior?

  • Import CSV Data from a server into SQLite  - Help me do this or talk me out of it?

    There is a portion of a MySQL database (no more than 500 records, 6 fields) that I would like to download into a local SQLite db every time a user signs in.
    The reason I want to do this is because there are a lot of weird  group by statements I want to chart, and I don't want to have to go back to the server over and over again.
    So what I've done is created an empty local SQLite db that matches my MySQL table. 
    Is there a way to import all these records without having to do a "foreach" statement? 

    You will need to read the data into an ArrayCollection likely with HTTPService and then use a for loop to build and run the Insert ... Values() sql statements.
    Preferably wrapped in transaction.

  • Importing CSV data

    Hi!
    I'm trying to import data into a table in my APEX application.
    Everything was fine until I try to import decimal numbers.
    This is a problematic row:
    770;6;1;20130930;AA;20130930;NP;MB;03234495;;R;00;HR;0000;B;P1111;;00000000000000000000;HRK;;;;;XXX;;;;;;-157.492.093,16;-157.492.093,16;01;92963223473;;
    Number is -157.492.093,16.
    Table column is defined as number (17,2)
    My import parameters are:
    Separator ;
    Charset UTF-8
    Group separator .
    Decimal separator ,
    I've used the default Data Loading page...
    Does anyone know how to fix this?
    Regards,
    Ivan

    Ivan,
    put up a sample app on apex.oracle.com
    what you have SEEMS correct.
    You have properly identified the 'group separator' as a period and a 'decimal separator' as a comma.
    The only idea I have is:
    You may need to 'declare' the number format on the next page after the initial "load data" page.
    I have had to add a format for my DATE columns.
    eg FORMAT for the number:
    S999G999G999G999G990D00
    MK

  • Importing CSV into table - problem with tab-deliminated files

    Hi All,
    I have written an application based on well-known Uploading excel sheet using Oracle Application Express (APEX) example from the following site:
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    All works as expected...
    However the code in the example assumes that the CSV file is really comma-delimited file:
    v_line := REPLACE (v_line, ',', ':');
    Now, I have noticed that when different people use "Save as CSV" function in Excel they sometimes get different results. For example sometimes you get a file which is semicolon delimited (';').
    However, I need to process a file which is tab-delimited file. Thinking is was quite simple task I simply change the above line of code to:
    v_line := REPLACE (v_line, chr(9), ':');
    where chr(9) is the ASCII code for horizontal TAB
    I was very surprised however to see that if I process the tab-delimited file with the above line I receive an extra character between EVERY CHARACTER. To give you an example:
    1) When processing a normal comma or semicolon delimited file using v_line := REPLACE (v_line, *','*, ':'); or v_line := REPLACE (v_line, *';'*, ':'); I receive correct results:
    SQL> select contract_value,dump(CONTRACT_VALUE) from sdpr_upload;
    CONTRACT_VALUE DUMP(CONTRACT_VALUE)
    354000 Typ=1 Len=6: 51,53,52,48,48,48
    555569 Typ=1 Len=6: 53,53,53,53,54,57
    2) When processing a TAB-DELIMITED file using v_line := REPLACE (v_line, chr(9), ':'); I get this:
    SQL> select contract_value,dump(CONTRACT_VALUE) from sdpr_upload;
    CONTRACT_VALUE DUMP(CONTRACT_VALUE)
    3 5 4 0 0 0 Typ=1 Len=13: 0,51,0,53,0,52,0,48,0,48,0,48,0
    5 5 5 5 6 9 Typ=1 Len=13: 0,53,0,53,0,53,0,53,0,54,0,57,0
    Now the BIG QUESTION ARE:
    Where do these 0's come from? How to get rid of them?
    Many thanks for any pointers!
    Pawel.

    Thanks for the tip, however the problem is to actually load the tabbed file.
    I think the issue lies somewhere else. I see some weird characters in the export file when viewing it in Linux vi. So I am guessing this could be some unnicode conversion problem rather than any issue with the application or script.
    Is there anyway one could upload a UNICODE text file into Apex?

  • Is it possible to import NEF raw files and also import the tags from the existing XMP sidecar files?

    I use Daminion to organise, tag and filter my photo collection. It allows me to place all of the tags in sidecar .xmp files. It uses the Adobe libraries to create these files. When I import the photos into Lightroom 3 or 5, Lightroom does not currently read the tags in the sidecar files.
    Does anyone know if there is a way to get Lightroom to read the .xmp tag info?
    Is there a setting in Lightroom that I am missing?

    I'm just a raw beginner when it comes to Lightroom. I know it has tagging capabilities, but they seem quite outside of Lightroom's main focus which, as I see it, is photo tweaking.
    Daminion of the other hand is totally focussed on management of a large and diverse digital assets collection (Photos, Video, Audio, Office documents, PDF's Vector graphics CAD). At this point I am using the stand-alone version of Daminion, but I will probably upgrade  to the networked version when the collection has been whipped into shape enough to be shared sucessfully.
    This is not intended as a commentary on Lightrooms capabilities. As I mentioned I am beginning to learn to use it.
    I generally try to use the best tool for each task. I really like Daminion for it's asset management focus; Lightroom for Photo editing. You CAN drive nails with a wrench but why would you want to?

  • Import table data in right order to avoid violating foreign key constraints

    Gentlemen
    I am trying to import table data into an existing 10g schema using datapump import in table mode.
    However, in order to avoid violating foreign key constraints, the tables must be loaded in a specified order. I tried specifying the order in the TABLES parameter:
    TABLES=table1,table2,table3 etc.
    However, datapump seems to chose its own order leading to errors like the following:
    ORA-31693: Table data object "SCHEMAX"."TABLE3" failed to load/unload and is being skipped due to error:
    ORA-02291: integrity constraint (SCHEMAX.TABLE3_TABLE1#FK) violated - parent key not found
    I want to try to avoid having to disable all foreign keys because there are hundreds of them.
    Any advice?
    Yours
    Claus Jacobsen, Denmark

    Thanks Anantha.
    Since I am only loadding data (the constraints are already defined in the target database), I am not sure whether this approach would work. Meanwhile I have solved the problem of moving data from one system to another using another, tedious and far from elegant approach that I would prefer to not eloborate on:-)
    However, I have also discovered another probable reason why the foreign key constraints were violated, other than wrong order of table data loading. It turns out almost every single table in the schema contains a trigger supposed to generate a unique row ID from a sequence on insert such as:
    CREATE OR REPLACE TRIGGER "SCHEMAX"."TABLEX#B_I_R"
    BEFORE INSERT
    ON TABLEX
    FOR EACH ROW
    DECLARE
    BEGIN
    SELECT tablex_seq.nextval INTO :NEW.ID FROM dual;
    END;
    If the import mechanism fires this trigger, and the sequences in the source and the target systems are not synchronized, then I guess that referred records a more than likely to end up with wrong ID's compared to the row ID's in the referring rows?
    Spooky. Anybody can confirm this theory?
    Yours
    Claus
    Message was edited by:
    user586249

Maybe you are looking for