Data.Copy.xData
Top  Previous  Next


Copies data with common identifier from an [xData] section to the [Data] section

Use Data.Copy.xData to synchronize new data with existing data and for advanced search and replace operations.

This command compares each row in a single column in the [xData] section with each row in a single column in the [Data] section and, if there is a match - for example a common identifier like name, address, phone number etc. that exists in both [xData] and [Data] - copy data from one or more columns in the [xData] section to one or more columns in the [Data] section. If no match - clear the column of that row.

Typical application:
1.Create an [xData] section with data to replace or add with one "search for" column that contains already existing data (or at least parts of existing data) and one or more "replace with" or "add" columns with new data  
2.Extract data from the user directory with Data.Get.ND, Data.Get.AD or Data.Get.LD.Find to the [Data] section  
3.Use Data.Copy.xData to search a column in the [Data] section for rows that matches the "search for" column in [xData] and copy data from matching rows from the "replace with" or "add" columns in [xData] to [Data]  

Data.Copy.xData works almost the same way as Data.Connect.xData but instead of writing matching [xData] row numbers in [Data] the actual data is copied from [xData] to [Data].

Category

Data section

Script section
[Batch], [Undo], [Init], outside Data.Loop..EndLoop statement

Data.Copy.xData xDataSrcCols, DataDstCols, Criteria

xDataSrcCols

List of [xData] section source columns, where to read the "replace with" or "add" data from  
Format: SrcColumn1§[SrcColumn2§][SrcColumn3§].  
Each column in the source list must have a corresponding column in the destination list - there must always be an equal number of columns in xDataSrcCols and DataDstCols  

DataDstCols
List of [Data] section destination columns, where to write the "replace with" or "add" data to  
Format: DstColumn1§[DstColumn2§][DstColumn3§].  
 
Criteria
Criteria that must be met on each row in order to copy data  
Format: colX=sectionnameY | colX<>sectionnameY  
Where X is a column in the [Data] section, "sectionname" refers to a valid [xData] section, and Y is a column in that section.  
It is possible to use '*' and '?' wildcards before and after the "sectionnameY" part, '*' = any number of characters including none, '?' = any single character.  

Full examples
·Find and replace multiple Linux user attribute values at once  
·Find and replace multiple NetWare user attribute values at once  
·Find and replace multiple Windows user attribute values at once