CSV File
Code Insight 6.14.2 SP1
The -path_search_replace_csv (-p) flag takes one value: the location of a CSV file that maps the file paths from the workspace XML, indicated by -input (-f), to the paths on the Scan Server, indicated by -scan_server (-s).
The CSV file has the following format:
/Path/To/Find/In/XML/File/One,Path/To/Replace/It/With/On/Scan/Server/1
/Path/To/Find/In/XML/File/Two,Path/To/Replace/It/With/On/Scan/Server/2
/Path/To/Find/In/XML/File/Three,Path/To/Replace/It/With/On/Scan/Server/3
Paths will be found and replaced exactly as shown in the CSV file. No regular expressions are allowed.
The path to be found will be matched only to the beginning of each path in the XML file being imported, which limits the possibility of accidentally changing parts of other paths. The portion of a path that matches is the only portion that is replaced.
Every path to be found will be tried on every path in the XML file being imported.
Matches are attempted in the order listed in the CSV file. If a match is found, the matching portion of the path is replaced before the next match is attempted. For each path, this allows for repeated changes as the search/replace map is iterated over.
Paths may contain any combination of forward slashes and backslashes. Backslashes must be escaped with other backslashes.
Any path that contains at least one backslash must be wrapped in double-quotes. For example, if you export from a Windows machine and import onto a Linux machine, your CSV file might look like the following:
"C:\\Path\\To\\Find\\In\\XML\\File\\One",Path/To/Replace/It/With/On/Scan/Server/1
"C:\\Path\\To\\Find\\In\\XML\\File\\Two",Path/To/Replace/It/With/On/Scan/Server/2
"C:\\Path\\To\\Find\\In\\XML\\File\\Three",Path/To/Replace/It/With/On/Scan/Server/3
In addition, two operators are available: CONVERT_TO_FORWARD_SLASH and CONVERT_TO_BACKSLASH. Place either in the first field of a line. The second value in that line is ignored. The conversion is performed on each forward slash and backslash in the entire file path.