Using the .CSV File

FIMPORT logs on to MAPI using the profile specified in the command line. It opens the .CSV formatted text file specified in the command line, parses the first line of the .CSV file for additional parameters, and parses the second line of the file for column headings.

FIMPORT determines from a table of MAPI and Microsoft Exchange Server message properties whether each column in the .CSV file refers to a standard message property or to a named property. For named properties, the property type is governed by a prefix on the column header, and defaults to TEXT. Then FIMPORT appends, updates or replaces the information in each message with the information from the file.

The text of the FIMPORT2.CSV file that serves as input to FIMPORT is as follows:

Command, Folderpath=@DEFAULT\@PR_IPM_INBOX_ENTRYID, Class=IPM.Note
pr_subject, pr_body, attach, s:Message Number In French
Message Number One,Here is the first message.,fimport2.txt,Un
Message Number Two,Here is the second message.,fimport2.txt,Deux
Message Number Three,Here is the third message.,fimport2.txt,Trois
 

CSV File Format

The first line of the .CSV file is an optional command line that is interpreted along with the typed command line. The second line of the .CSV file, which is required, is a definition of the columns with each column representing a property that will be replaced in each message of the destination folder. The remainder of the file consists of the values for each column. The format is as follows:

<File> == [<Firstline>] <Secondline> <CSVBody> EOF

<Firstline> == ["COMMAND,"]

                 [<Operation> ","]

                 [FOLDERPATH=<Folder path> ","]

                 [CLASS=<MessageClass> ","]

                 [SETREAD ","]

                 [EFD]

                 EOL

<Secondline> == <ColumnList> EOL

<CSVBody> == <Thirdline> [<CSVBody>]

<Thirdline> == <PropValueList> EOL

<ColumnList> == <Column> "," [<ColumnList>]

<PropValueList> == <PropValue> "," [<PropValue>]

<Column> == [<TypePrefix>] <PropName>

<PropName> == any valid property tag string - for standard properties they would typically be prefixed with PR

TypePrefix == L: | S: | T: | U:

Notes

The same number of terms should appear in <Secondline> as in <Thirdline>

Type prefixes

L - PT-LONG

S - PT-STRING

T - PT-SYSTIME

U - PT-UNICODE

B - PT-BOOLEAN

Default is PT-STRING

In the FIMPORT2.CSV sample file shown above, the first line of the file uses special characters signified by the @sign. These special characters cause the process to read the corresponding properties from the environment. The @DEFAULT entry causes the name of the default message store to be used. @IPM_* is a special equate that is passed in to HrMAPIFindFolderEx() which returns the designated property value. These characters can be used on the command line or in the first line of the file.

The ATTACH keyword, which is located in the second (column definitions) line of FIMPORT2.CSV as shown above, is a special value that can be used in place of a property name. It indicates that this column contains a list of files that will be attached to the message rather than a normal property value.