Skip to main content
Delphix

How to Change the Delimiter on a File (KBA1161)

 

 


Note

Note:

This KBA has been ARCHIVED because new product functionality makes this information of limited or questionable utility. 

This document is archived for historical reference only.

 

At a Glance   

Masking Versions: This is applicable to all Delphix Masking versions.
Description: This page specifically details how to change the End of Record (EOR) delimiter on a file so that it can be masked using File Masking should the EOR not be one of the predefined EOR. 
Built-in EOR: The built-in End of Record delimiters are:
 
Solution: Connection Issue - Username or Password error
  1. Use the CLI to test the connection using 'fetch'
  2. If error, use the CLI to change the 'maskingjob serviceconfig' and set username or password.
Solution: Issue - No masking jobs
  1. Make sure that the Masking Jobs are configured as 'Multi Tenant' (UI: Overview > Job Configuration).
  2. Use the CLI to test the connection using 'fetch'
  3. Use the CLI and use 'ls' to list fetched jobs.

Issue - the End of Record delimiter not matching

Sometimes the End of Record (EoR) orEnd is specific to an application and needs to be changed. This can be due to the Masking Engine can't specify the specific EoR delimiter or the delimiter is a sequence of character. 

Since the EoR, in this case, can't be specified in the masking engine we need to change it.

Resolution

The resolution to this issue is to work around the limitation by changing the EoR - since there are no scripting capabilities for masking jobs related to text files this needs to be done before the file is masked.   

Unix
The character conversion can be performed using perl with the following command. This example changes from CR to LN.

perl -p -e 's/\r/\n/g' input.file > output.file

Windows PowerShell

In PowerShell on Windows, the following can be used. This example changes from CR to LN.

$original_file ='input.txt'
$text = [IO.File]::ReadAllText($original_file) -replace "`r", "`n"
[IO.File]::WriteAllText($original_file, $text)