How do I call two csv files into ews?

I have to call two csv files into a script with ews:
Param([string]$calInputFile = "C:\Algemene agenda\Data docenten.txt" )
Param([string]$calMailboxFile ="C:\Algemene agenda\Alle docenten.txt"
# Load all Entries
$calagenda = Import-Csv $calInputFile
$calMailbox = Import-Csv $callMailboxfile
This do not work.
How can I do this???

OH!!  Why didn't I see this before?  s-:  You are having problems with the Param definition, but it appears you are having troubles pulling the data into the script.  You can only have a single Param definition for a script.  Try
the following instead:
Param(
    [string]$calInputFile
= "C:\Algemene agenda\Data docenten.txt",
    [string]$calMailboxFile
="C:\Algemene agenda\Alle docenten.txt"
## Load all Entries
$calagenda = Import-Csv $calInputFile
$calMailbox = Import-Csv $callMailboxfile
To define multiple parameters, you have your Param definition (with its parentheses) and all parameters are defined inside it, separated by commas.

Similar Messages

  • How do I compare two csv files and not disable the user if the username is found in the 2nd file using powershell?

    Hi Guys
    I have two csv files with the following headers and I need to import both files into the script to check whether the StaffCode is present in the Creation/Renewal of Contract csv in a DisableAccount Script so I can stop any action to disable the account as
    the staff has renewed the contract with the company so the account should not be disabled.
    However my accounts are still being disabled. I am not sure now to construct the query so that it detects that the account is to be left alone if the staffcode is present in both files
    I does recognize that the $staffcodeN in the renewal file matches the $staffcode in the termination file
    but still proceeds to disable or set an expiry date to the account anyway based on the termination file. 
    How do I stop it from doing that?
    1)In the Creation/Renewal of contract file the following headers are present
         -  TranCode,StaffCode,LastName,FirstName,SocialSecurityNo,DateJoin,Grade,Dept,LastUpdateDate,EffectiveDate
    2)In the Disable of contract file the following headers are present
        - TranCode,StaffCode,LastName,FirstName,SocialSecurityno,LastDateWorked,Grade,Dept,LastUpdateDate,
    My data is not very clean , I have a-lot of special characters such as = , ' ,/ and \ characters to remove first before i can compare the data
    Thanks for the help in advance.
    Yours Sincrely
    Vicki
    The following is a short snippet of the code 
    $opencsv = import-csv "D:\scripts\Termination.csv"
    $opencsv2 = import-csv "D:\scripts\RenewContractandNewStaff.csv"
    foreach ($usertoaction in $opencsv) 
    $Trancode = $usertoactionTranCode
    $StaffCode = $usertoaction.StaffCode.replace("=","").replace('"','')
    $LastName = [string]$usertoaction.LastName.Replace("/","\/").Replace(",","\,")
    $FirstName = [string]$usertoaction.FirstName.Replace("/","\/").Replace(",","\,")
    $socialsecurityno = $usertoaction.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoin = $usertoaction.DateJoin.replace("=","").replace('"','')
    $LastDateWorked = $usertoaction.LastDateWorked.replace("=","").replace('"','')
    $Grade = [string]$usertoaction.Grade
    $Dept = [string]$usertoaction.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $AccountExpiry = [datetime]::Now.ToString($LastDateWorked)
    foreach ($usertoaction2 in $opencsv2) 
    $TrancodeN = $usertoaction2.TranCode
    $StaffCodeN = $usertoaction2.StaffCode.replace("=","").replace('"','')
    $socialsecurityNoN= $usertoaction2.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoinN = $usertoaction2.DateJoin.replace("=","").replace('"','')
    $GradeN = [string]$usertoaction2.Grade
    $DeptN = $usertoaction2.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $EffectiveDate = $usertoaction.EffectiveDate.replace("=","").replace('"','')
    $LastName2 = [string]$usertoaction2.LastName.Replace(",", "").Replace("/","").trim()
    $FirstName2 = [string]$usertoaction2.FirstName.Replace("/","").trim()
    # Use DirectorySearcher to find the DN of the user from the sAMAccountName.
    $Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $Root = $Domain.GetDirectoryEntry()
    $Searcher = [System.DirectoryServices.DirectorySearcher]$Root
    $Searcher.Filter = "(sAMAccountName=$samaccountname)"
    $doesuserexist1 = $Searcher.Findall()
    if ($doesuserexist1 -eq $Null)
    {Write-Host $samaccountname "account does not exist"}
    elseif ($StaffCodeN -match $staffcode)
    write-host "user has renewed the contract, no action taken"
    else
    if(($lastupdatedate -ne $null)-or($LastDateWorked -ne $null))
                        write-host "Setting Account Expiry to"$accountexpirydate
    #$ChangeUser.AccountExpires = $accountexpirydate
               #$Changeuser.setinfo()
    if ($UserMailforwarding -ne $null)
    #Set Account expiry date to Last Date Worked
    # $ChangeUser.AccountExpires = $accountexpirydate
    # $Changeuser.setinfo()
     write-host "staff" $displayname "with staff employee no" $samaccountname "has                          
    mailforwarding" 
    Write-host "Please disable the account manually via Active Directory Users & Computers and 
    Elseif ($accountexpirydate -lt $todaysdate)
    #disable the account

    Hi Vicki,
    This Forum has an insert-codeblock function. Using it will make your script far more readable
    Your script is missing some parts, it is impossible to follow the problem.
    You are performing the same string cleaning action on $opencsv2 for each element in $opencsv, when doing it once should suffice. Why not start it all by cleaning the values and storing the cleaned values in new arrays?
    The Compare-Object function is great, why not take it out for a stroll on these lists, it might just safe you lots of unnecessarily complicated code ...
    You are creating a new $Domain, $Root and $Searcher object each iteration, when doing it once should suffice. Probably not much of a time-saver, but every little thing contributes.
    Try pinpointing the problem by doing extensive logging, not only by writing which action was taken, but writing the inidividual information (variables, mostly) before evaluation occurs. Your if/elseif/else looks sound, so if it's still not doing what you
    want, the ingoing data must be different from what you think should be there.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • How would I merge two csv files in Powershell

    Hello,
    I have two CSV Files.  Each has a list of virtual machines in them. One CSV file has the name of the VM as well as details about the RAM, CPU, VM Details (from VMM).  The other CSV File has the name of the VM as well as the IP address.
    How would I merge these two together?  For any VM's that do not exist in either file I wouldn't want to drop these VM names either. 
    Thanks.

    Thank you mjolinor for your suggestion.  This is not quite working for me.  What I'm seeing in the csv3.csv file all the  column details from the $firstCSV, and I'm seeing the headings included from the $secondCSV but all the details
    of the headings from the $secondCSV are empty.  Here is some more information for you:
    My $firstCSV file has the following headings:
    VMName  ChargedWA  BillingWA  VMOperatingSystem  VMHost  vCPUs  MemoryGB  StorageGB 
    My $secondCSV file has the following headings:
    VMName  IPAddress  SubnetMask  Gateway  DNSServers  MACAddress  device0  Totalspce0  freespce0  device1  Totalspce1  freespce1  device2  Totalspce2  freespce2
    Each CSV input file has in common the column of VMName.  Most values in VMName are common to both input files but there are some values in VMName that are not in the other input file.  I'm looking to find the following:
    When the same VMname exists in both files, write out all columns for that record from both files into the merged file.
    When a VM name is in $firstCSV but not the second...still write out this record with the values from the $firstCSV.  The column headings from the $secondCSV would be empty for this record.
    When a VM name is in $secondCSV but not the first...still write out this record with the values from the $secondCSV.  The column headings from the $firstCSV would be empty for this record.
    It's funny how I think I've described my issue in my initial post but as I describe it more I further define the details.  I hope I've described my issue for all to understand.
    Thank you.

  • How do you call two actionscript files in another as3

    My problem is that i what to call two actionscript files in another one, but cant do it.
    This is are the two codes i want to play at the same time in my scene:
    Code 1
    * Inventory System Manager
    * DATE: 07/24/2010
    * AS3
    * UPDATES AND DOCUMENTATION AT: http://www.FreeActionScript.com
    package 
        import flash.display.Sprite;
        import com.freeactionscript.inventorySystem.InventorySystem;
        public class Main extends Sprite
            private var _inventorySystem:InventorySystem;
            public function Main()
                //InventorySystem(reference to stage in the fla)
                _inventorySystem = new InventorySystem(this);
    Code 2
    * Player Movement - 8-way keyboard
    * VERSION: 1.0
    * DATE: 9/23/2010
    * AS3
    * UPDATES AND DOCUMENTATION AT: http://www.FreeActionScript.com
    package 
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.KeyboardEvent;
        import flash.ui.Keyboard;
        public class Main extends MovieClip
            // player
            private var _player:MovieClip;
            // player settings
            private var _playerSpeed:Number = 4;
            // movement flags
            private var _movingUp:Boolean = false;
            private var _movingDown:Boolean = false;
            private var _movingLeft:Boolean = false;
            private var _movingRight:Boolean = false;
             * Constructor
            public function Main()
                createPlayer();
                // add listeners
                stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);           
                stage.addEventListener(KeyboardEvent.KEY_DOWN, myOnPress);
                stage.addEventListener(KeyboardEvent.KEY_UP, myOnRelease);
             * Creates player
            private function createPlayer():void
                _player = new Player();
                _player.x = stage.stageWidth / 2;
                _player.y = stage.stageHeight / 2;
                stage.addChild(_player);
             * EnterFrame Handlers
            private function enterFrameHandler(event:Event):void
                // Move up, down, left, or right
                if ( _movingLeft && !_movingRight )
                    _player.x -= _playerSpeed;
                    _player.rotation = 270;
                if ( _movingRight && !_movingLeft )
                    _player.x += _playerSpeed;
                    _player.rotation = 90;
                if ( _movingUp && !_movingDown )
                    _player.y -= _playerSpeed;
                    _player.rotation = 0;
                if ( _movingDown && !_movingUp )
                    _player.y += _playerSpeed;
                    _player.rotation = 180;
                // Move diagonally
                if ( _movingLeft && _movingUp && !_movingRight && !_movingDown )
                    _player.rotation = 315;
                if ( _movingRight && _movingUp && !_movingLeft && !_movingDown )
                    _player.rotation = 45;
                if ( _movingLeft && _movingDown && !_movingRight && !_movingUp )
                    _player.rotation = 225;
                if ( _movingRight && _movingDown && !_movingLeft && !_movingUp )
                    _player.rotation = 135;
                //i will do
                if (_player.x > 550)
                    _player.x = 550;
                    _player.x = +_player.x;
                else if (_player.x < 50)
                    _player.x = 50;
                    _player.x = +_player.x;
                if (_player.y > 350)
                    _player.y = 350;
                    _player.y = +_player.y;
                else if (_player.y < 50)
                    _player.y = 50;
                    _player.y = +_player.y;
                trace ("Valor en x: " + _player.x);
                trace ("Valor en y: " + _player.y);
             * Key Press Handlers
            public function myOnPress(event:KeyboardEvent):void
                switch( event.keyCode )
                    case Keyboard.UP:
                        _movingUp = true;
                        break;
                    case Keyboard.DOWN:
                        _movingDown = true;
                        break;
                    case Keyboard.LEFT:
                        _movingLeft = true;
                        break;
                    case Keyboard.RIGHT:
                        _movingRight = true;
                        break;
             * Key Release Handlers
            public function myOnRelease(event:KeyboardEvent):void
                switch( event.keyCode )
                    case Keyboard.UP:
                        _movingUp = false;
                        break;
                    case Keyboard.DOWN:
                        _movingDown = false;
                        break;
                    case Keyboard.LEFT:
                        _movingLeft = false;
                        break;
                    case Keyboard.RIGHT:
                        _movingRight = false;
                        break;
    Hope you help me =)

    You need to have a reference to an instance of one class in the other class or the other way round in order to communicate between the two. Alternatively you can call a static function of one class from an instance of the other class.
    Anyway, I suggest reading about object-oriented programming first (can be even a Java book) to understand how things work. Such basics really help and it's never shame to read it.
    Good luck

  • How do I combine two PDF files into one?

    I want to merge two PDF files into one to make things easier when I take the file(s) to a professional printer.
    Can I do this in Preview?
    Thanks.

    You can't do in Preview.
    You can combine individual PDFs into one PDF using one of these freeware utilities.
    PDFMergeX @ http://www.malcom-mac.com/blog/pdfmergex/
    joinPDF @ http://www.macupdate.com/info.php/id/16604
    Combine PDFs @ http://www.monkeybreadsoftware.de/Freeware/CombinePDFs.shtml>
    PDFLab (join & split) @ http://pdflab.en.softonic.com/mac
     Cheers, Tom

  • How do i merge two pdf files into one

    How do i merge 2 pdf files into one.

    Open up the first pdf in Preview
    Then from Menu
    select from Edit Menu
    Select Insert (your choice of)
              Page from Scanner
              Page from File (select your PDF file)
              Blank Page
    You can then save as your first file or rename it

  • How to upload above20000 records csv files into oracle table,Oracle APEX3.2

    Can any one help me how to CSV upload more than 20,000 records using APEX 3.2 upload process.i am using regular upload process using BOLB file
    SELECT blob_content,id,filename into v_blob_data,v_file_id,v_file_name
    FROM apex_application_files
    WHERE last_updated = (select max(last_updated)
    from apex_application_files WHERE UPDATED_BY = :APP_USER)
    AND id = (select max(id) from apex_application_files where updated_by = :APP_USER);
    I tried to upload but my page getting time out. my application best working up to 1000 records. after that its getting timed out.Each record is storing 2 secornds in the oracle table.So 1000 records it taking 7 minuts after that APEX upload webpage getting timed out
    please help me with source how to speed upload csv file process or help another best with with source example.
    Thanks,
    Sant.
    Edited by: 994152 on Mar 15, 2013 5:38 AM

    See this posting:
    Internet Explorer Cannot Display
    There, I provided a couple of links on this particular issue. You need to change the timeout on your application server.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How can I combine two video files into one finished file?

    I'm making a video of a guitar player.  I'm using two cameras simultaneously.  One gives the overall wide shot, and the other is zoomed in on his hands.  Both cameras run at the same time.  I would like to use the wide shot as the main video, and occasionally fade in clips from the zoomed in shot to show details of his playing.  I can manually line up both files so they are synchronized.  How do I cut a clip out of the main (wide) shot, leave the gap there, and insert a clip from the closeup?  I'm putting the two video files on two of the video timelines and synchronizing them that way.
    Any suggestions on how to proceed?

    The effect you are looking for is 'Picture in Picture'. If you want the gap to be there for the duration of the timeline add some 'black video' - from the Tasks Pane> New Item - on the video track above the main track. Resize / position it to where you wish it to be.
    Then with your second clip (now on video track 3)
    Do the same sizing / positioning for it.
    split video and audio and delete or disable the audio.
    Cut it where you want the various start/ends of the fade to be.
    Delete, or just disable (right-click) the unnecessary segments.
    Apply fade in / out to the remaining segments.
    [EDIT]
    Also check out the 'Presets' in Video Effects. There are a variety of PiP presets that may do what you need.
    [/EDIT]
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

  • How to import data from CSV file into a table by using oracle forms

    Hi,
    I have a CSV file and i want to insert in oracle database in a table by using a button in oracle forms.
    the user can select CSV file by using open dialog .
    can any one help me to find method to make import and select file from the client machine ?
    thx.

    1. create table blob
    CREATE TABLE IB_LOVE
      DOC          BLOB,
      CONTRACT_NO  VARCHAR2(20 BYTE)                NOT NULL
    )2. use the code below to insert:
           INSERT INTO ordmgmt.ib_love
                       (contract_no, doc
                VALUES (:control.contract_no_input, NULL
           lb$result :=
             webutil_file_transfer.client_to_db (:b2.file_name, v_file_blob_name, v_col_blob_name,
                                                 'CONTRACT_NO = ' || :control.contract_no_input);
           :SYSTEM.message_level := 25;
           COMMIT;
           :SYSTEM.message_level := 0;3. use the code below to download
         if :control.CONTRACT_NO_INPUT is not null then
              vboolean :=   webutil_file_transfer.DB_To_Client_With_Progress(
                               vfilename,  --filename                       
                              'IB_LOVE', ---table of Blob item                       
                              'DOC',  --Blob column name                       
                              'CONTRACT_NO = ' || :CONTROL.CONTRACT_NO_INPUT, ---where clause to retrieve the record                       
                              'Downloading from Database', --Progress Bar title                       
                              'Wait to Complete'); --Progress bar subtitle  client_host('cmd /c start '||vfilename);
              client_host('cmd /c start '||vfilename);                 
         else
              errmsg('Please choose contract no');
         end if;4. use the code below to open file dialog
    x:= WEBUTIL_FILE.FILE_OPEN_DIALOG ( 'c:\', '*.gif', '|*.gif|*.gif|', 'My Open Window' ) ;
    :b2.FILE_NAME:=X;

  • How do I import a CSV file into numbers so the columns show

    Thanks for the help.  I have a CSV file generated by the Google Keyword tool; when I open it in numbers all the values go into the same row.  I get the correct number of rows but only one column with five values in each one.  I read on here to check and see if the extension is correct and it is csv.  I've also dragged the file onto the number icon in the dock and get the same result.  Google gives you the option of exporting as a tsv file. Did that and I got the exact same result.  I've looked at the CSV file in textedit and it doesn't show any commas, but seems to have tabs.  But the tsv file doesn't open correctly either.  I'm at a loss. 

    If the file is created as TSV one, its name extension must be .txt.
    Numbers open such files flawlessly.
    Yvan KOENIG (VALLAURIS, France) mardi 4 octobre 2011 11:53:27
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • JCS: how to load users with csv file into Identity Console

    In my Java Cloud Service: When I go to Identity Console I have a function "Load users" under "Manage Users".
    How should this CSV file look like?
    How can I add roles to the users?
    I loaded yesterday a file and I still get the message "Maximum number of simultaneous uploads per identity domain exceeded. No more uploads will be accepted at this time. Select UTF-8 encoded CSV file you wish to upload. Maximum file size is 256 KB."
    When will this file be process? Can I cancel this process? How do I get notified about a result?
    kind regards
    Robert

    see http://docs.oracle.com/cloud/131/trial_paid_subscriptions/CSGSG/cloud-manage-user-accounts.htm#BCFDAIJA  Adding a Batch of User Accounts
    file has to have a header:
    First Name,Last Name,Email,User Login

  • How to read/write .CSV file into CLOB column in a table of Oracle 10g

    I have a requirement which is nothing but a table has two column
    create table emp_data (empid number, report clob)
    Here REPORT column is CLOB data type which used to load the data from the .csv file.
    The requirement here is
    1) How to load data from .CSV file into CLOB column along with empid using DBMS_lob utility
    2) How to read report columns which should return all the columns present in the .CSV file (dynamically because every csv file may have different number of columns) along with the primariy key empid).
    eg: empid report_field1 report_field2
    1 x y
    Any help would be appreciated.

    If I understand you right, you want each row in your table to contain an emp_id and the complete text of a multi-record .csv file.
    It's not clear how you relate emp_id to the appropriate file to be read. Is the emp_id stored in the csv file?
    To read the file, you can use functions from [UTL_FILE|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABGGEDF] (as long as the file is in a directory accessible to the Oracle server):
    declare
        lt_report_clob CLOB;
        l_max_line_length integer := 1024;   -- set as high as the longest line in your file
        l_infile UTL_FILE.file_type;
        l_buffer varchar2(1024);
        l_emp_id report_table.emp_id%type := 123; -- not clear where emp_id comes from
        l_filename varchar2(200) := 'my_file_name.csv';   -- get this from somewhere
    begin
       -- open the file; we assume an Oracle directory has already been created
        l_infile := utl_file.fopen('CSV_DIRECTORY', l_filename, 'r', l_max_line_length);
        -- initialise the empty clob
        dbms_lob.createtemporary(lt_report_clob, TRUE, DBMS_LOB.session);
        loop
          begin
             utl_file.get_line(l_infile, l_buffer);
             dbms_lob.append(lt_report_clob, l_buffer);
          exception
             when no_data_found then
                 exit;
          end;
        end loop;
        insert into report_table (emp_id, report)
        values (l_emp_id, lt_report_clob);
        -- free the temporary lob
        dbms_lob.freetemporary(lt_report_clob);
       -- close the file
       UTL_FILE.fclose(l_infile);
    end;This simple line-by-line approach is easy to understand, and gives you an opportunity (if you want) to take each line in the file and transform it (for example, you could transform it into a nested table, or into XML). However it can be rather slow if there are many records in the csv file - the lob_append operation is not particularly efficient. I was able to improve the efficiency by caching the lines in a VARCHAR2 up to a maximum cache size, and only then appending to the LOB - see [three posts on my blog|http://preferisco.blogspot.com/search/label/lob].
    There is at least one other possibility:
    - you could use [DBMS_LOB.loadclobfromfile|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i998978]. I've not tried this before myself, but I think the procedure is described [here in the 9i docs|http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl12bfl.htm#879711]. This is likely to be faster than UTL_FILE (because it is all happening in the underlying DBMS_LOB package, possibly in a native way).
    That's all for now. I haven't yet answered your question on how to report data back out of the CLOB. I would like to know how you associate employees with files; what happens if there is > 1 file per employee, etc.
    HTH
    Regards Nigel
    Edited by: nthomas on Mar 2, 2009 11:22 AM - don't forget to fclose the file...

  • How to append two CSV files using ftp

    Hi
    Please let me know the FTP command to append the two .CSV files into one .CSV file.
    e.g.
    Let me explain:
    one CSV file has the fields F1 , F2, F3 , F4 and has 5 records
    another CSV file has the same sequence of fields F1, F2, F3, F4 and has 10 records
    after appending both the files , I must get 15 records.
    Thanks
    Alok

    Ok I will try out.
    I am illustrating my requirement as follow
    File#1 (type .CSV)
    F1     F2     F3     F4
    100   566    89     86   
    235   256    56     12
    File#2 (type .CSV)
    F1     F2     F3     F4
    56     56     98     102
    12     23     36      523
    23      56     56    89
    Now we want to Append File#1 to File#2 as follow: 
    F1    F2    F3     F4
    100   566    89     86   
    235   256    56     12   
    56     56     98     102
    12     23     36      523
    23      56     56    89
    Please suggest now that which command would be appropiate.
    Alok

  • How to import old iPhone SMS.CSV file into new iPhone?

    Hey everyone,
    So I've spent a couple days on this as I just upgraded to the iPhone5S from my 4S.  Long story short, my backup restore didn't work after multiple tries (gave me the file is corrupt or not compatible with the iPhone error). 
    I tried:
    -reinstalling itunes
    -updating itunes
    -combining the 5S backup with the old 4S backup
    -tinyumbrella
    and a few of other things as I've forgot now.
    The most important things I needed was the contact list and SMS history.  I've got the contact list from extracting is successfully from the iTunes backup folder and using iCloud, but cannot figure out how to import the SMS.CSV file into my iPhone5S.
    Any suggestions on how I can get my SMS messages from my iPhone4s into my 5S?
    If anyone has any other suggestions on getting my Backup Restore to work that would be awesome too!
    Thanks!

    A word on SMS text messages. It is pracitcally impossible to import an SMS text-messages file to a new iPhone and have the Messages app on the new device read the messages.
    You can transfer, however contacts and other individual data (such as calendars and notes) from one iphone to the next. I had my old Nokia which whose contacts I exported to a CSV file. I then imported the file to my iphone which converted the file into multiple contacts in the Contacts app on the iphone. You can use a contact management app such as this one in order to import the contact file to the new iPhone.

  • Question about reading csv file into internal table

    Some one (thanks those nice guys!) in this forum have suggested me to use FM KCD_CSV_FILE_TO_INTERN_CONVERT to read csv file into internal table. However, it can be used to read a local file only.
    I would like to ask how can I read a CSV file into internal table from files in application server?
    I can't simply use SPLIT as there may be comma in the content. e.g.
    "abc","aaa,ab",10,"bbc"
    My expected output:
    abc
    aaa,ab
    10
    bbb
    Thanks again for your help.

    Hi Gundam,
    Try this code. I have made a custom parser to read the details in the record and split them accordingly. I have also tested them with your provided test cases and it work fine.
    OPEN DATASET dsn FOR input IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET dsn INTO record.
      PERFORM parser USING record.
    ENDDO.
    *DATA str(32) VALUE '"abc",10,"aaa,ab","bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"bbc"'.
    *DATA str(32) VALUE '"a,bc","aaaab",10,"bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"b,bc"'.
    *DATA str(32) VALUE '"abc","aaaab",10,"bbc"'.
    FORM parser USING str.
    DATA field(12).
    DATA field1(12).
    DATA field2(12).
    DATA field3(12).
    DATA field4(12).
    DATA cnt TYPE i.
    DATA len TYPE i.
    DATA temp TYPE i.
    DATA start TYPE i.
    DATA quote TYPE i.
    DATA rec_cnt TYPE i.
    len = strlen( str ).
    cnt = 0.
    temp = 0.
    rec_cnt = 0.
    DO.
    *  Start at the beginning
      IF start EQ 0.
        "string just ENDED start new one.
        start = 1.
        quote = 0.
        CLEAR field.
      ENDIF.
      IF str+cnt(1) EQ '"'.  "Check for qoutes
        "CHECK IF quotes is already set
        IF quote = 1.
          "Already quotes set
          "Start new field
          start = 0.
          quote = 0.
          CONCATENATE field '"' INTO field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            CONDENSE field.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
    *      WRITE field.
        ELSE.
          "This is the start of quotes
          quote = 1.
        ENDIF.
      ENDIF.
      IF str+cnt(1) EQ ','. "Check end of field
        IF quote EQ 0. "This is not inside quote end of field
          start = 0.
          quote = 0.
          CONDENSE field.
    *      WRITE field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      CONCATENATE field str+cnt(1) INTO field.
      cnt = cnt + 1.
      IF cnt GE len.
        EXIT.
      ENDIF.
    ENDDO.
    WRITE: field1, field2, field3, field4.
    ENDFORM.
    Regards,
    Wenceslaus.

Maybe you are looking for

  • Calling a Bean with parameters

    I would like to be able to call a JSF managed bean with a call such as How can I code to use a href directly to call a faces managed bean method without using listener? Thanks in advance.

  • I had PSE12 on my PC, it died and Ive replaced with an iMac. I have the serial

    I'm new to forum....I do have the serial number for PSE12 for my PC, is it transferrable to my iMac?

  • Authorizations in Credit Control Configuration

    Dear Friends I am configuring "automatic credit control " for our client. The requirement is 4 levels of authorizations. I've completed the settings  for credit check at transaction level. Now, How do I maintain the Authorizations (4 levels) I am  aw

  • Bleed/Doc Size?

    Hello, I am just on my trial of Ilustrator CS5, I am looking at a business card document that was made for me, I now want to use a printer that uses a slightly smaller size. So I have adjusted the size of the two artborads to the size specified by th

  • Problem while upating user form

    Hello experts ! I have problem while updating my user form. I have a matrix , where i have already entered details in first row. now when i again navigate to that particular document where i entered the details the in the row, and add details in the