Hello Unix Shell Script Experts,
I have a script that would mask the columns in .csv file or .txt file.
First the script will untar the .zip files from Archive folder and processes into work folder and finally pushes the masked .csv files into Feed folder.
Two parameters are passed
1) Line of Business example :
VA
and 2) Date YYYYMMDD :
20161101
The script will read the data from a table in a Database where it will have the position of the columns to be masked for all the .csv or .txt files.
objective here is to mask all the .csv or .txt files that are delimited with comma /pipe which has columns like
tax_id and
DOB columns.
It performs for one line of business properly across folders like untaring and generating the masked files with columns masked
however for other line of business it is not masking correctly at the positions
DOB format :
9999-12-12 (All dob columns will have this value)
Tax id :
xxxx-xx-xx (All tax related id columns will have this format value)
Example : 4 and 30 position columns are TAX_ID and DOB then the script must mask these two columns.
There can be more columns to be masked.
say 10th 11th 12 th 40 th 120th positions so all these columns need to be masked
Script has 5 arrays each of which will store columns that are to be masked.
Problem
In the array am declaring all the columns of all the .csv files that are to be masked.
Array 1 contains all Date of Birth related columns
Array 2 contains all Tax id related columns.
Now one of the .csv file has columns like DATE-OF-BIRTH and TAX-ID
How to add the above 2 columun in the array along with other columns
I have tried by adding quotes single and double but did not work.
Finally the script is not behaving the way it is expected.
The objective of the script must be like : whenever it identifies the columns relsted to Dateof Birth or Tax id which will be hard coded then those must be masked.
Attaching the code for reference
Please let me know
Thanks
Mahesh G
Moderator's Comments:
|
|
Please use CODE tags as required by forum rules!
|
|