Batch file structure

The following section gives you the guidelines to create a batch file for Import folders, files and metadata to SharePoint Libraries (Batch File Mode) and Import folders, files and metadata to SharePoint Libraries (Batch File Mode)  task type.

The first row of the batch file should contain the following field names as headers. The reserved headers used by Dockit in batch file are as follows:

  1. Path: The 'Path' column should contain the path of the source document / folder.
  2. Destination Path: The 'Destination Path' column should contain the target location where the source gets moved.
  3. New Name: The 'New Name' should contain the name in which the source document(s) gets moved to target location.
  4. New Folder: The column 'New Folder' is an optional column in the batch descriptor file. Using this column, you can provide the relative path to be created in the respective destination location given under 'Destination Path' column prior to importing the content. For instance, please see the batch descriptor file snippet given below:
Path Destination Path New Folder
M:\My Document\Sample File.xlsx http://sharepoint/technical documents/folder1 folder2/folder3

Dockit automatically creates the folders (folder2/folder3) specified in the column 'New Folder' underneath the specified destination location (folder1). The 'Sample File.xlsx' will be imported into the new destination location 'http://sharepoint/technical documents/folder1/folder2/folder3'.

  1. Link Name: The column Link Name is an optional column in the batch descriptor file, created specifically to handle Link to a document content types in SharePoint. Using this column, you can provide the Document Name to create a link with the given name in the respective destination location. Dockit enables this feature for Link to a document content type and its child content types only.

Path Destination Path Link Name URL Content Type Manager
M:\file1.aspx http://vyapin/project documents/folder1 Sample Test.doc http://www.google.com Link to a document John Doe
M:\file1.aspx http://vyapin/project documents/folder1/sub1 Microsoft Corporation http://www.microsoft.com External URL John Doe

In the above examples, the 'External URL' content type is a derived / child content type of ‘Link to a document’ content type. Since Dockit expects a file in the 'Path' column to be available in the source location, you must provide an existing file's path (dummy file) in the 'Path' column. Dockit does not import the dummy file during the import process. In the above example, the file 'M:\file1.dummy' is available in the specified location, but will not be imported to the document library.

6. You can also use wildcard notations in order to process the sub-folders & files in the given folder. Please see the wildcard usage below:

Wildcard characters

Example

Description

*.*

D:\My Documents\folder1\*.*

Process all folders and files underneath the folder added for import

*

D:\My Documents\folder2\*

Process all folders only (excluding files) underneath the folder added for import

.*

D:\My Documents\folder3\.*

Process all files only (excluding folders) underneath the folder added for import

. D:\My Documents\folder4\. Process top level files only.

The field names should be followed separated by a delimiter character such as comma (,), semi-colon (;) etc. The delimiter character used in the external metadata file should be same as 'Format' string value available in the registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4\Engines\Text).

The following table shows the equivalent Format string for 'List Separator' in the registry key:

List Separator Equivalent Format String
, (comma) CSVDelimited
; (semi-colon) Delimited(;)
* (asterisk) Delimited(*)

Sample format of a CSV / TEXT batch file:

Note: Refer the above Point for the separator to be used in the batch file

“Path”,“Destination Path“,”New Folder”
“C:\My Documents\Sample Brochure.doc”,“http://sharepoint/libone1“,”Folder1”
“C:\My Sales\Sample Sales Template.xlsx”,“http://sharepoint/libone2“,”FolderA/FolderAA/FolderAAA”
“C:\My Sales\Sample Product Demo.ppt”,“http://sharepoint/libone3/folder“,”Folder3

You can also use the same batch file as metadata file by adding the required custom columns in headers (in addition to default headers 'Path' and 'Destination Path'). Sample format of a file is as follows:

“Path”,“Destination Path“,”New Folder”,"Title","Description"
“C:\My Documents\Sample Brochure.doc”,“http://sharepoint/libone1“,”Folder1”,"Test Document1", "To add custom columns"
“C:\My Sales\Sample Sales Template.xlsx”,“http://sharepoint/libone2“,”FolderA/FolderAA/FolderAAA”,"Test Document2", "To add custom columns"
“C:\My Sales\Sample Product Demo.ppt”,“http://sharepoint/libone3/folder“,”Folder3”,"Test Document2", "To add custom columns"

Alternatively you can use separate CSV / XLSX file as metadata file. For more information about how to prepare metadata file, click Create Metadatafile