CSV to lines

Hello

I'm using oracle 11g.

I have table below.

Table a:

no name ranks
1        N1           A,B

2        N2           B,B+

3        N3           A,C

..        ....            ............

I want output like below:

no rank name

N1-1A

1 N1 B

N2 2B

N2 2 B +.

N3 3A

C 3 N3

I would appreciate your assistance in this matter.

Thank you

Barilla

Here is an example that shows how do:

WITH

sample_data as

(select null as grp

, null as a list of double where 1 = 0

--------------------------------------------------------

Union all select 'A', 'sam, joe, bob, ray' from dual

Union all select 'B', '(who), (where), (why)' the double

Union all select 'C', 'n, NULL values', the double

was Union all select ',' *? %,, = + @#, ^ $~ ! * ?'     of the double

the Union all select 'E', 'e, d, c, b, a' double

Union all select 'F', 'abc123' from dual

--------------------------------------------------------

)

Select grp

flat surface as possible

, regexp_substr (list, ',?) () [^,] *)', 1, level, 'i', 1) as elmnt

of sample_data

CONNECT

(regexp_count (list, ',') + 1 > = level and)

advance GRP grp = and

prior dbms_random.value is not null

)

order of grp, level;

Result:

GRP POS ELMNT

---  ---  --------

A 1 sam

A joe 2

A bob 3

A radius of 4

1 B (which)

B 2 (where)

B 3 (why?)

C 1 n

C 2

C 3

NULL values C 4

C 5

D      1  *?%

D 2

D      3  =+@#

D      4  ^$~!*?

E 1 e

E d 2

E 3 c

E 4 b

5 E a

F 1 abc123

------------------

22 selected lines

Tags: Database

Similar Questions

  • CSV to lines question please

    Hello

    I have a csv list, but I want the csv in rows, something like that - any help is greatly appreciated.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    WITH t

    AS (SELECT "a" id, 1, 2, 3, 4' ordr FROM DUAL)

    UNION

    ID to SELECT 'b', ' 1, 2, 3, 4, 5' ordr FROM DUAL

    UNION

    SELECT 'c' id, 7, 8' ordr FROM DUAL)

    SELECT *.

    T

    want to the result like this-

    ID - ordr

    a 1

    a 2

    a 3

    a 4

    b 1

    b 2

    b 3

    b 4

    b 5

    c 7

    c 8

    Thank you very much.

    Here's how:

    Notes on the Oracle: split delimited by a comma the way of RegExp string, second part

    SQL > WITH t AS (SELECT 'a' id, ordr ' 1, 2, 3, 4' UNION DOUBLE)

    2 id SELECT 'b', ordr ' 1, 2, 3, 4, 5' OF the UNION DOUBLE

    3. SELECT 'c' id, 7, 8' ordr FROM DUAL)

    4. select id

    5, regexp_substr (ordr, ' [^,] +', 1, rn) split

    6 t

    7 cross join (select rownum rn

    8 in (select max (length (regexp_replace (ordr, ' [^,] +'))) + 1 mx)

    9                      from   t

    10                    )

    11. connect by level<=>

    12             )

    where the 13 regexp_substr (ordr, ' [^,] +', 1, rn) is not null

    14 order of 1,2;

    I SHARED

    - ---------

    a 1

    a 2

    a 3

    a 4

    b 1

    b 2

    b 3

    b 4

    b 5

    c 7

    c 8

    11 selected lines.

  • How to manage the pause embedded inside the CSV column line

    Hello

    I'm under pressure to make it work. I've already put this question on the forum of the APEX, but on reflection, I think that it relates more to PL/SQL rather than APEX APEX 4.1 having already utility to manage the Upload of CSV.
    If you already read in the forum of the APEX, please ignore.
    I'm sorry for that. Thanks for reading.

    I need to develop an application that allows the user to upload a CSV file to a table of interface.
    The APEX version on my workplace is 4.0.2.
    I used the code of
    http://dbswh.webhop.NET/HTMLDB/f?p=blog:read:0:article:11000346061523
    It all works fine until recently I find
    If a column in a CSV file cotain a break line (or line spacing) for example (the tester copy and paste this text which has a line break on a column in a spreadsheet)

    It is the first sentence.
    It is the second sentence.

    It will break the 'it's the second sentence In a new column.

    The contents of the CSV read next to Notepad as below
    Date of assessment, Date, assessment provider, name of the assessor, Court, first name, middle name, last name, PRN person record, NHI number, assisted defendant Y/N number, is dependent on O/N, Notes, primary of ethnicity, "the ethnic origin other, please specify", gender, currently in treatment O/N, another Substance, Substance of concern 5 specified
    22/09/2012, Co name of the provider, Warren Edgley, Wellington, sale, 2545554, dgsdf,, 'is the first sentence.
    It's the second sentence. ', Japanese, woman, b.

    This is the CSV UTIL code, please help me how can I replace the line break to a space so that the download process is correct.
      CREATE OR REPLACE PACKAGE BODY "CSV_UTIL" 
    AS
         --strip the beginning and the end quotes, then replace double quotation with single 
       FUNCTION de_quote (p_str IN VARCHAR2, p_enc_by IN VARCHAR2)
          RETURN VARCHAR2
       IS
       v_str VARCHAR2(32767) := p_str;
       BEGIN
          IF (p_enc_by IS NULL)
          THEN
             RETURN p_str;
          ELSE
            
            IF SUBSTR(p_str,-1) = p_enc_by THEN
               v_str := SUBSTR(p_str,1,LENGTH(p_str)-1);
            END IF;
            IF SUBSTR(p_str,1,1) = p_enc_by THEN
               v_str := SUBSTR(v_str,2);
            END IF;  
            RETURN REPLACE (v_str,
                             p_enc_by || p_enc_by,
                             p_enc_by
                            );
          END IF;
       END de_quote;
    
       PROCEDURE parse (p_str IN VARCHAR2, p_enc_by IN VARCHAR2, p_sep IN VARCHAR2)
       IS
          l_n          NUMBER   DEFAULT 1;
          l_in_quote   BOOLEAN  DEFAULT FALSE;
          l_ch         NCHAR (1);
          l_len        NUMBER   DEFAULT NVL (LENGTH (p_str), 0);
       BEGIN
          IF (l_len = 0)
          THEN
             RETURN;
          END IF;
    
          g_words := g_empty;
          g_words (1) := NULL;
    
          FOR i IN 1 .. l_len
          LOOP
             l_ch := SUBSTR (p_str, i, 1);
    
             IF (l_ch = p_enc_by)
             THEN
                l_in_quote := NOT l_in_quote;
             END IF;
    
             IF (l_ch = p_sep AND NOT l_in_quote)
             THEN
                l_n := l_n + 1;
                g_words (l_n) := NULL;
             ELSE
                g_words (l_n) := g_words (l_n) || l_ch;
             END IF;
          END LOOP;
    
          g_words (l_n) := de_quote (g_words (l_n), CHR(10));
          g_words (l_n) := de_quote (g_words (l_n), CHR(13));
          FOR i IN 1 .. l_n
          LOOP
             g_words (i) := de_quote (g_words (i), p_enc_by);
          END LOOP;
       END parse;
    
    /*
    
    Author: Oleg Lihvoinen
    Company: DbSWH
    
    Changes:
    10.02.2011, There was a miscalculation of the file line last position in case it is the end of file
    
    */
    
    
       PROCEDURE upload (p_file_name VARCHAR2, p_collection_name VARCHAR2, p_enc_by IN VARCHAR2, p_sep_by IN VARCHAR2, p_rows NUMBER)
       IS
          v_blob_data    BLOB;
          v_clob_data    CLOB;
          v_clob_len     NUMBER;
          v_position     NUMBER;
          v_char         NCHAR (1);
          c_chunk_len    NUMBER           := 1;
          v_line         VARCHAR2 (32767) := NULL;
          v_data_array   vcarray;
          v_rows         NUMBER           := 0;
          n_seq          NUMBER           := 1;
          dest_offset    NUMBER           := 1;
          src_offset     NUMBER           := 1;
          amount         INTEGER          := DBMS_LOB.lobmaxsize;
          blob_csid      NUMBER           := DBMS_LOB.default_csid;
          lang_ctx       INTEGER          := DBMS_LOB.default_lang_ctx;
          warning        INTEGER;
          l_sep          VARCHAR2(100)    := CASE WHEN p_sep_by = '\t' THEN chr(9) ELSE p_sep_by END;
       BEGIN
          htmldb_collection.create_or_truncate_collection
                                          (p_collection_name      => p_collection_name);
    
          -- Read blob from wwv_flow_files
          SELECT blob_content
            INTO v_blob_data
            FROM wwv_flow_files
           WHERE NAME = p_file_name;
    
          v_position := 1;
          DBMS_LOB.createtemporary (lob_loc      => v_clob_data,
                                    CACHE        => TRUE,
                                    dur          => DBMS_LOB.SESSION
                                   );
          DBMS_LOB.converttoclob (v_clob_data,
                                  v_blob_data,
                                  amount,
                                  dest_offset,
                                  src_offset,
                                  blob_csid,
                                  lang_ctx,
                                  warning
                                 );
          v_clob_len := DBMS_LOB.getlength (v_clob_data);
          IF v_clob_len = 0 THEN
             RETURN;
          END IF;
          
          WHILE (v_position <= v_clob_len + 1)
          LOOP
             v_char := DBMS_LOB.SUBSTR (v_clob_data, c_chunk_len, v_position);
             v_line := v_line || v_char;
             v_position := v_position + c_chunk_len;
    
             -- When the whole line is retrieved and not end of file or end of file
             IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
             THEN
               
                parse (p_str => v_line, p_enc_by => p_enc_by, p_sep => l_sep);
                v_data_array := g_words;
                FOR i IN 1..g_words.count LOOP
                
                   IF i <= 50 THEN
                   
                      v_data_array(i) := g_words(i);
                   ELSE
                      exit;
                   END IF;
                
                END LOOP;
                
                FOR i IN g_words.count + 1..50 LOOP
                   
                   v_data_array(i) := null;
    
                END LOOP;            
                v_rows := v_rows + 1;
                -- exit if uploaded specified number of rows
                IF p_rows IS NOT NULL AND v_rows > p_rows THEN
                   EXIT;
                END IF;
                -- Store data to collection
                n_seq :=
                   htmldb_collection.add_member
                                         (p_collection_name      => p_collection_name,
                                          p_c001                 => v_data_array
                                                                               (1),
                                          p_c002                 => v_data_array
                                                                               (2),
                                          p_c003                 => v_data_array
                                                                               (3),
                                          p_c004                 => v_data_array
                                                                               (4),
                                          p_c005                 => v_data_array
                                                                               (5),
                                          p_c006                 => v_data_array
                                                                               (6),
                                          p_c007                 => v_data_array
                                                                               (7),
                                          p_c008                 => v_data_array
                                                                               (8),
                                          p_c009                 => v_data_array
                                                                               (9),
                                          p_c010                 => v_data_array
                                                                               (10),
                                          p_c011                 => v_data_array
                                                                               (11),
                                          p_c012                 => v_data_array
                                                                               (12),
                                          p_c013                 => v_data_array
                                                                               (13),
                                          p_c014                 => v_data_array
                                                                               (14),
                                          p_c015                 => v_data_array
                                                                               (15),
                                          p_c016                 => v_data_array
                                                                               (16),
                                          p_c017                 => v_data_array
                                                                               (17),
                                          p_c018                 => v_data_array
                                                                               (18),
                                          p_c019                 => v_data_array
                                                                               (19),
                                          p_c020                 => v_data_array
                                                                               (20),
                                          p_c021                 => v_data_array
                                                                               (21),
                                          p_c022                 => v_data_array
                                                                               (22),
                                          p_c023                 => v_data_array
                                                                               (23),
                                          p_c024                 => v_data_array
                                                                               (24),
                                          p_c025                 => v_data_array
                                                                               (25),
                                          p_c026                 => v_data_array
                                                                               (26),
                                          p_c027                 => v_data_array
                                                                               (27),
                                          p_c028                 => v_data_array
                                                                               (28),
                                          p_c029                 => v_data_array
                                                                               (29),
                                          p_c030                 => v_data_array
                                                                               (30),
                                          p_c031                 => v_data_array
                                                                               (31),
                                          p_c032                 => v_data_array
                                                                               (32),
                                          p_c033                 => v_data_array
                                                                               (33),
                                          p_c034                 => v_data_array
                                                                               (34),
                                          p_c035                 => v_data_array
                                                                               (35),
                                          p_c036                 => v_data_array
                                                                               (36),
                                          p_c037                 => v_data_array
                                                                               (37),
                                          p_c038                 => v_data_array
                                                                               (38),
                                          p_c039                 => v_data_array
                                                                               (39),
                                          p_c040                 => v_data_array
                                                                               (40),
                                          p_c041                 => v_data_array
                                                                               (41),
                                          p_c042                 => v_data_array
                                                                               (42),
                                          p_c043                 => v_data_array
                                                                               (43),
                                          p_c044                 => v_data_array
                                                                               (44),
                                          p_c045                 => v_data_array
                                                                               (45),
                                          p_c046                 => v_data_array
                                                                               (46),
                                          p_c047                 => v_data_array
                                                                               (47),
                                          p_c048                 => v_data_array
                                                                               (48),
                                          p_c049                 => v_data_array
                                                                               (49),
                                          p_c050                 => v_data_array
                                                                               (50)                                                                           
                                         );
             
                -- Clear the line
                v_line := NULL;
             END IF;
          END LOOP;
       END;
    END;
    In my applications, I save these lines in a table rather than a collection of APEX because the number of columns can contain greater than 50.
    I want to know how can replace these newline within a column to a space.
    If anyone has any ideas, please let me know.

    Thank you very much in advance.
    Ann
  • adding multiple files *.csv while retaining the original file name in the first column

    Hi guys Cela made some time.

    I am trying to add several *.csv files while retaining the original file name in the first column, the real data set is about 40 cases.

    file a.csv contains:
    1, line an a.csv
    2, line 2 in a.csv

    file b.csv contains:
    1, line a b.csv
    2, line 2 in b.csv

    result output.csv is:

    I would like this:
    a.csv, 1, the line in a.csv
    a.csv, 2, line 2 in a.csv
    b.csv, 1, the line in b.csv
    b.csv, 2, line 2 in b.csv

    Any suggestions to speed up my hobbling attempts would be aprieciated

    Thank you

    -SS

    What you could do is given in attachment.

    Started with 2 files:

    a.csv

    copy of a.csv

    Both with data:

  • Create instant VM only on the hosts listed in csv?

    I am trying to write a script that will create snapshots for all the virtual machines on specific hosts.  I thought I could put a list of hosts in a .csv file so that I could change what VMs host, I want that collide simply by editing the .csv file.  I'm having a brain Peter on the way to do it.  Help?  That's what I have so far:

    Connect-viserver username-password xx xx - xx
    Write-Host ""
    Write-Host "is the creation of snapshots for pod VMs beginning." - foregroundcolor blue - yellow backgroundcolor
    Write-Host ""
    $snapname = "base_05.16.2012".
    $vmcsv = import-csv C:\lab_scripts\snapshot\list_vm_snapshot.csv
    $vms = get-vm-location $line.hostname
    foreach ($vm to $vms)
    {
    Get - VM $vm - location $line.hostname | new-snapshot - name $snapname
    }
    disconnect-viserver vcenter01.vmware.lab - confirm: $FALSE
    Write-Host ""
    Write-Host "creating snapshots for pod VMs is complete." - foregroundcolor blue - yellow backgroundcolor
    Write-Host ""

    Give it a try like this

    connect-viserver xx -user xx -password xx
    Write-Host " " Write-Host "The creation of snapshots for pod VMs is beginning." -foregroundcolor blue -backgroundcolor yellow Write-Host " "
    $snapname = "base_05.16.2012"
    $vmcsv = import-csv C:\lab_scripts\snapshot\list_vm_snapshot.csv foreach($line in $vmcsv)
    {
      Get-VMHost -Name $line.hostname | Get-VM | new-snapshot -name $snapname -Confirm:$false}
    
    disconnect-viserver vcenter01.vmware.lab -confirm:$FALSE
    Write-Host " "Write-Host "The creation of snapshots for pod VMs is complete." -foregroundcolor blue -backgroundcolor yellowWrite-Host " "
    
  • Deploy the CSV file virtual computer

    Hello world!

    I want to deploy multiple VM to a .csv file. I know this is pretty basic, but I don't get to work... What I've done wrong?

    Here's my scrypt:


    $list = import-CSV C:\config1_new_vm.csv
    Write-Output $list

    $vcenter_ip = "192.168.0.14.
    SE connect-VIServer-Server $vcenter_ip-user root - password password

    foreach ($line in $list)
    {
    New-VM-name $line.name - host $line.host Datastore - $line.datastore - DiskMB $line.disk MemoryMB - $line.memory - NumCPU $line.cpu - ID rhel5_64Guest - CD - Description 'RH5 Linux '.
    }

    Here my .csv file:

    2011-10-29_114608.png

    The result is:

    name host datastore. disc; memory; UC

    -----------------------------------

    VM1 h1e0mudag - a.dc.infra.com h1e0mudag-local-storage. 200; 512; 1

    h1e0mudag - a.dc.infra.com; h1e0mudag-local-storage; 300; 513, VM2; 2


    New-VM: could not validate argument on the parameter 'Name '. Argument is null or empty.

    Because I'm French, the message is in French, but for those who do not understand French, it basically means:

    Unable to validate the argument in the parameter 'Name '. The argument is Null or is empty.

    I do not understand... I can select my csv file lines but could not get the colomns... Is New-VM-name $line.name not right?

    Thanks for your replies.

    Pozitim


    Try changing the line

    $list = import-CSV C:\config1_new_vm.csv

    in

    $list = import-CSV C:\config1_new_vm.csv - UseCulture

    By default, PowerShell expects the separator in CSV files to be a comma.
    Your output, it seems as if your regional settings set the separator like semicolumn.
    With the UseCulture switch the cmdlet will use the locale to determine the separator.
  • Assistance with the creation of the VM for the automation of laboratory and criticism

    Being a novice at scripting powershellCLI from scratch, I managed to put together a script to automate the creation of virtual machines for my ESXi5.1 training laboratory. Some of my orders have been adapted from Luc - D blog. Many thanks for your great blog.

    I have a list of virtual computers that have different OS, memory, CPU, disk, NetworkPort, ISOPath, FloppyDrive etc.


    Here's the routine I created to go after using the help of VMware PowerCLI and the reference and examples of the VMware community. I would like to help to be able to optimize the code to speed up the processing, because it does not have enough in the process, I tried to use the | Out-Null but it does not seem to turn off the output. I also wanted to know how read a CSV file parameters and phase of each virtual machine created by feeding one after the other time it has been fully configured, as remotely via VMTools looking for the existence of a file or setting on a virtual machine before the next VM is created in order--something like a configuration of vAPP. I tried the CSV file, but only managed to partially run my script is included below:
    Finally, when it's time to clean up a script to check if the virtual machine is turned on then turn off and delete the inventory and drive of the virtual computer. (I think I could manage removing relatively easily). Hope my request is not a big ask.

    Thanks in advance.


    # Connect to vSphere Host with root

    $date = get-Date

    $ESXhost = Read-Host "enter the host ESX or IP name.

    $username = Read-Host "Username".

    $password = Read-Host "Password."

    SE connect-VIServer-Server $ESXhost - User $username - Password $password


    # Create DC

    $VMname = "Lab_DC".

    New-VM - VMHost $ESXhost - CD - name $VMname - MemoryMB 512 - NumCPU 1 - Version v9 - ID windows7Server64Guest-Floppy - Datastore LUN1-DiskGB 15 - DiskStorageFormat thin - Notes '$VMname AutoDeployed on $date.

    Get - VM $VMname | Get-CDDrive. Game-CDDrive - ISOPath "[Host3] VM/Lab_Local\WIN2K8R2SP1_CUST.» "ISO" - StartConnected $true - confirm: $false

    $DelayValue = "5000".

    $vm = get - VM $VMname | Get-View

    $vmConfigSpec = new-Object VMware.Vim.VirtualMachineConfigSpec

    $vmConfigSpec.BootOptions = new-Object VMware.Vim.VirtualMachineBootOptions

    $vmConfigSpec.BootOptions.BootDelay = $DelayValue

    $vmConfigSpec.flags = new-Object VMware.Vim.VirtualMachineFlagInfo

    $vmConfigSpec.flags.enableLogging = $false

    $vm. ReconfigVM_Task ($vmConfigSpec)

    Get - VM $VMname | Get-NetworkAdapter | Together-NetworkAdapter - NetworkName "Lab_Local" - confirm: $False

    FloppyDrive get - VM $VMname | Game-FloppyDrive - FloppyImagePath "Automate/BootFloppies/LAB-DC.flp [build]" - StartConnected $true - confirm: $false

    Most of the time the foregoing successfully created the virtual machine, but I have about 20 MV that I need to build/remove and the only way I can do it is by adding the individual game published for each virtual computer orders - it isn't nice to handle, so I tried to add a loop foreach to read the name of the virtual machine and the settings for each computer virtual to a CSV file.

    The CSV file is formatted as follows:

    VMName MemoryMB NumCpu Version, ID, Datastore, DiskGB, ISOPath, NetworkName, FloppyPath

    Lab_DC, 512, 1, v9, windows7Server64Guest, Lun1, 15, [Host3] VM/Lab_Local\WIN2K8R2SP1_CUST. ISO, Lab_Local, Automate/BootFloppies/LAN-DC.flp [build]

    Lab_VC, 2048, 1, v9, windows7Server64Guest, Lun2, 20, [Host3] VM/Lab_Local\WIN2K8R2SP1_CUST. ISO, Lab_Local, Automate/BootFloppies/LAN-VC.flp [build]

    I tried to add this to "test" as below, but it seems to work partially. It fails to set the path of the ISO, disk path and the Network Port correctly - could not understand how to properly use the BootOptions so I left it.

    $VMs = import-CSV - UseCulture b:\automate\servers.csv

    New-VM - VMhost Host3 - CD-name $VM. VMName - MemoryMB $VM. MemoryMB - NumCPU $VM. NumCPU-Version $VM. Version - ID $VM. ID-floppy - Datastore $VM. Store data-DiskGB $VM. DiskGB - DiskStorageFormat 'thin' - Notes '$name Auto deployed on $date.

    Get - VM $VM | Get-CDDrive. Game-CDDrive - ISOPath $VM. ISOPath - StartConnected $true - confirm: $false

    Get - VM $VM | Get-NetworkAdapter | Together-NetworkAdapter NetworkName - $VM.NetworkName - confirm: $False

    FloppyDrive get - VM | Game-FloppyDrive - FloppyImagePath $VM. FloppyPath - StartConnected $true - confirm: $false

    This is the result I get from the routine above.

    NameUse of the port
    --------  ----
    Host3root of 443

    WARNING: The 'Description' of type VirtualMachine property is deprecated. Use the property "Note".

    WARNING: The 'Hard drives' property type VirtualMachine is discouraged. The "Get-hard drive" cmdlet instead.

    WARNING: The 'NetworkAdapters"type VirtualMachine property is deprecated. The cmdlet "Get-NetworkAdapter" instead.

    WARNING: The 'UsbDevices' of type VritualMachine property is obsolete. Use the "Get-UsbDevice" cmdlet instead.

    WARNING: The 'CDDrives' of type VitrualMachine property is obsolete. Use the "Get-CDDrive" cmdlet instead.

    WARNING: The 'FloppyDrives"type VirtualMachine property is deprecated. Use the "Get-FloppyDrive" cmdlet instead.

    WARNING: The 'Host' of type VirtualMachine property is deprecated. Use the property "$vmhost".

    WARNING: The "HostId" type VirtualMachine property is deprecated. Use the property "VMHostId".

    Get-FloppyDrive: it lacks an argument for the parameter "VM". Specify a parameter of type ' VMware.VimAutomation.ViCore.Type

    s.V1. [Inventory.VirtualMachine] ' and try again.

    To b:\Automate\Various Scripts\CreateVM.ps1:48 tank: 20

    + Get-FloppyDrive - VM < < < < | Game-FloppyDrive - FloppyImagePath $VM. FloppyPath - StartConnected $true - confirm: $false

    + CategoryInfo: InvalidArgument: (:)) [Get-FloppyDrive], ParameterBindingException)
    + FullyQualifiedErrorId: MissingArgument, VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetFloppyDriv

    e

    Ah, my mistake, I don't check your code.

    Inside the loop, the script must use the variable $_ instead of the variable $VM to the New - VM.

    The variable $_ will have extracted the CSV file line.

    I've updated the code above. Give him another chance.

  • Mobility base layers and App

    Is it possible to export Base layers and App layers form one deployment of Mirage to another?

    It feels ridiculous to resume all the Basic App layer when you have already done just because you do not have an import/export button... am I missing something here? Is it possible to do?

    I had the same problem. This has been fixed by ensuring that there is no such thing as the output directory (the following command fails if the 'exit' subdirectory already exists.

    Wanova.Server.Tools.exe Exportlayers - serveraddress localhost - layersfile "c:\share\layers.csv" outputfolder - c:\share\output

    Also my contained csv file line header, #LayerId, LayerVersion, but it seems to work in both cases

  • Details of the data of the virtual machine store

    Hi all

    Thank you is advanced.

    I'm trying to get the details of the virtual machine and its data store name, freespaceGB to n csv file. After excuting it I'm getting only the out put of the VM last on my list. Hope that I missed something in the addition of the output. Can someone please help.

    Add-PSSnapin VMware.VimAutomation.Core
    SE connect-VIServer 192.168.1.125

    #VMname.csv list of MV #.
    $vm = import-csv c:\scripts\vmname.csv
    {foreach ($line in $vm)
    Get-vm datastore - $line.name. Select-Object $line.name, name, FreeSpaceGB. Export Csv c:\scripts\ds.csv - NoTypeInformation
    }

    The result is that I'm looking is something like that.

    Virtal FreeSpace DS machine name

    VM1 DATA1 13 GB

    The virtual machine should be a calculated property, I've updated the code above.

    Give him another chance.

  • Asynchronous tasks, hash tables, and berries - best way to do this!

    I'm working with a colleague on a script that will deploy a very large number of virtual machines to a CSV file.  We started with a purely synchronous process that was very slow by using a simple foreach loop to deploy a virtual machine, configure, a technique of customization and start all this according to the CSV data.

    The obvious bottleneck in the process is waiting for the clone operation is completed before you perform the remaining tasks.  The synchronous line of New - VM in a foreach loop, it is very slow.

    We have since changed to deploy an asynchronous virtual machine using the foreach loop according to the CSV data in a table.  Once the foreach loop started all clonings, he finishes and then a monitoring task loop 'while' kickoff and then perform the rest tasks.  The while loop is based on code from the LucD found here: http://www.lucd.info/2010/02/21/about-async-tasks-the-get-task-cmdlet-and-a-hash-table/ (thanks Luke!).

    Now code Luke used a hash table, so it had to be modified to use the CSV table at best.  Table CSV contained information to perform the configuration and customization of the virtual machine.  I couldn't really find a way for this very cleanly, I'm looking for suggestions on making it a little better.

    Right now I use a simple counting mechanism to browse table to determine if the cloning operation is complete or not.  The problem with this is that if there are 100 VM being cloned, and I walk through the table one row at a time so he could take a long time between the success of the clone operation and monitoring loop actually pick up on it.  It would be nice to have a way to identify which line in the table has data customization and configuration required without walking through it in a loop, rather referring to an item in the table (TaskID) using another method (is this one?-still find such things powershell).

    Here is the modified version of the code of Luke:

    # $csv is the array in question with the required data.
     
    # Used to count which line in the array
    $csvline = 0
     
    # Count all the running tasks to feed into the while loop
    $tasks = $csv | %{$_.TaskID} | ?{$_ -match "Task"}
    $runningTasks = $tasks | measure | %{$_.count}
     
    while($runningTasks -gt 0){
     
    # Completion Meter
    $percomplete = (1 / $runningTasks)*100
    Write-Progress -activity 'Waiting for cloning operation to complete' -status 'Please wait...' -percentComplete ($percomplete)
     
    # Here is where it starts to get messy, there has to be a better way than using $csv[$csvline] and walking though
    if ((get-task | select id,state | ?{$_.id -eq $csv[$csvline].TaskId}).state -eq "Success"){
    Set-VM $csv[$csvline].name -NumCpu $csv[$csvline].vcpu -MemoryMB $csv[$csvline].MemoryMB -Description $csv[$csvline].Notes -Confirm:$false
    Get-vm -name $csv[$csvline].name | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName $csv[$csvline].Network -StartConnected:$true -Confirm:$false
    Get-VM $csv[$csvline].name | Start-VM -RunAsync -Confirm:$false
    $csv[$csvline].TaskId = ""
    $runningTasks--
    }
    elseif ((get-task | select id,state | ?{$_.id -eq $csv[$csvline].TaskId}).state -eq "Error"){
    $csv[$csvline].TaskId = ""
    $runningTasks--
    }
     
     
    # Increment $csvline
    $csvline++
     
    # Wash rinse repeat over and over (not very pretty)
    # Reset $CSV array line counter when greater than count of lines (minus 1 because the array/count starts at zero).
    if ($csvline -gt ($csv.count - 1)){
    $csvline = 0
    }
     
    # Slow down the runningTasks loop since we are waiting for cloning operations to complete.
    # IMPACT: If you deploy 100 VM's it could take up to 200 seconds AFTER a VM is finished cloning before being noticed by the while loop
    Start-Sleep -Seconds 2
    }
    
    
    

    It would be nice to create a Get-task monitoring loop who does not walk in the table.  But shoot any 'Sucess' ful tasknames and determine which line in the table of $csv it is (using the TaskId element).

    Is it possible to do another nesting a foreach ($line in $csv) inside the Get task monitoring loop and compare the TaskId values?  (It's perhaps faster without worrying - have not yet tested).

    I hope that I have explained things clearly enough.

    Thanks for your time.

    Andy

    Andy, have a look at the thread called error with Get-OsCutomizationNicMapping, he does something similar to what you want to do I guess.

    Inside the loop of Import-Csv, the new virtual machine is created in Async and the Id of the task as well as some specific values of the CSV stored in the part of the value of the hash table.

    Later, these values are used to configure the new virtual machine further.

  • Live captions to help merge data

    Hello
    Got a problem that I hope you data-mergers there can help me with, wrt legends Live.

    My merge data file contains text and image links that all import very well, fortunately to create my document of 30 pages of my 30 csv file line.
    I would now like to 'live' to the image that the "metadata" below the photo caption.  So Ive who put up and everything works very well on my test example where I just paste the image in my image of the document placeholder, the legend is filled correctly.

    BUT when I try to do it via a data merge, the text and the image is correctly positioned, but my the legend box is not. Then realized in order for this legend is filled, I needed to select the menu option ' legends > generate Live Caption "so that the box caption text to be updated."
    However, I have ultimately about 230 lines of datamerge photo links so don't really like the idea of having to be updated for each image, especially if the metadata are constantly being updated.

    Is there something I'm doing wrong, or maybe a global setting that ive missed?
    Thanks a lot for listening
    L

    Data fusion is much longer than the Live captions feature. When LUKE came out, merge data was not converted to endure.

  • OLIVIER-A: GL_BALANCE_F

    Hi all

    I have not anderstand the structure of the < file_glacct_segment_config_jde.csv >.
    Line 2 (which began with a "1") contains fields of F0902 (GMCO, GMMCU). At the end of this line, I can find the SBL and SBLT, fields without the prefix GM.
    What kind of fields are CTG01 to CTG24? These areas come

    Have you seen this = >

    http://download.Oracle.com/docs/CD/E14223_01/BIA.796/e14216/anyimp_configfinance.htm

    BTW - I found your post a little hard to follow - maybe to define the overall situation before diving into the details might mean you get more answers...

    Hope it will be useful...

  • How can I play files CSV lines with a different number of columns?

    Hi all

    I am trying to load CSV with DIAdem 2014 files, and I found there is a great tool, "use".

    However, with the CSV use tool, there are critical problem with my data files. (See photo)

    As you can see the CSV file attached, it includes a lot of lines with different columns.

    And here, use read the number of columns of 1st line (e.g.: 4 columns) and set it as the number of columns to read.

    So I can not load all of the data (e.g.: 53 columns) if first row data were lower than columns.

    Can anyone recommend any approach, please?

    Kind regards

    Young

    Admin 24/03/16 Note: files deleted by request of the user

    I just add a few lines of script and fix the related use. (I just added the code to get a direct look).

    The uri of the file will appear as a new kind of load in the dialog file tiara is intalled by double click

    Would be nice if you could provide some information, how the data was created. Maybe we can it add as official of our web page to use plugin.

    Option Explicit

    Void ReadStore (File)

    File.Formatter.Delimiters = «»
    File.Formatter.LineFeeds = \n
    File.Formatter.DecimalPoint = '. '.

    Dim startLine: startLine = file. GetNextLine()
    <>InStr (startLine, ' [Tenergy Bus Log Data] "" ") then
    call RaiseError()
    end if

    And that not File.Position = File.Size
    Dim groupName: groupName = file. GetNextStringValue (eString)
    If it isn't root. ChannelGroups.Exists (groupName) then
    root. ChannelGroups.Add (groupName)
    end if
    Dim grp: set grp = root. ChannelGroups (groupName)
    Dim i: i = 1
    do for real
    Dim val: val = file. GetNextStringValue (eR64)
    If isempty (val) then
    Exit
    end if
    < i="">
    dial the grp. Channels.Add ("Brand" & I, eR64)
    end if
    protected chObj: set chObj = grp. Channels (i)
    chObj.Values (chObj.Size + 1) = val
    i = i + 1
    loop
    Call File.SkipLine)
    Wend

    End Sub

  • 'Save as csv' sets of quotation marks around the entire line

    Our customer relationships:

    Portal of data-> right click on-> save under-> Select 'Data Type': "Textfile - Auto détection (*.csv)"-> Save.

    Result of savings:

    "TIME V V_ABS.
    "63.0235776 28.6153372301571 0.105263157894737".
    "63.0235936 28.6156034598028 0.105264137235745".

    The values of strings with the same index (a header) are so composed of a single cell due to quotation marks around.

    By me is not get, but by a customer.

    Client standard configuration of region/German language Windows 7.

    No idea, how a customer can save as csv without quotes around the line?

    Sasha

    Checked the file format during the recording of the data of Test File (CSV) Portal.

    When I checked the file in Ultraedit (so that can see the hexadecimal values) the file doesn't have quotation marks around the values.

    But if I open the file in Excel and then saved. Excel has put the quotes like that was indicated in your message.

    It seems that the customer opens the file in Excel.

    Paul

  • CSV starts in column b after a line break

    Hi guys,.

    I'm building a CSV with 4 rows of data added each time the vi is executed. For some reason lines 2-4 start in column B, not as they should. I tried to remove the first index of the array, but that did not help.

    All incoming bays are the same size, as well as the berries are added to the file.  The ball is probably easier to see what is happening with a screen... There are a lot of void / vi.

    Here is my code-

    and looks like the csv-

    I know it's an obvious solution... I'm just blind right now, lol!

    Thank you!

    Christopher

    Hi Pickering,

    your path management is kind of weird: conversion of string on the way and vice versa all the time! Why you don't stick with the path data type?

    -Build tables is done better using BuildArray. InsertIntoArray is a sort of overkill here!

    -Do not include your own LF/CR of the array elements. This is handled internally by the WriteToSpreadsheetFile function.

Maybe you are looking for

  • Satellite M105-S322 - HDD does not detect

    My laptop does not detect the hard drive. I press F2 to go into BIOS and it says hardrive No. I reinstalled the hard drive, but it still says the same thing. I have test the SATA hard drive on the desktop and it detects its. What seems to be wrong? H

  • Satellite A60 - 302 frezes when the DVD or CD has been put in place

    Load music CDs, but if I put it in a data CD or DVD laptop freezes even with the recovery disk it freezes the laptop. I have to manually turn off and start again always tried to load the software just freezes.

  • Help buying a headset bt (wm600)

    Hello. I want to buy a bluetooth headset device (mw600 or another bt headset that OU can recommend to me..) 5 are the headphones with the iPhone competeble for my iphone4 with ios 4 and iOS 5 concerning volume control, microphone and music from iPhon

  • problems to update the SDK 5.0

    I recently installed the complete installation of Blackberry java plugin version 1.5.0.201110141512 and I want to install the blackberry java SDK 5.0.0.25, but I still get this error... the strange thing is the user and the password are valid. Connec

  • Option no. 2.1 in its

    I have a problem with my subwoofer for my system 2.1 speakers. There is no option in the audio option page Realtek HD 2.1... latest version of the driver downloaded from gigabyte page and realtek, no 2.1 always option. How to solve this problem... I