reposting my question with more details as advised:
i have a real data prod file with 80+ fields. Need to replace say 12 columns out of this(based on field#) which are sensitive fields by mocked data contained in second file say mocked_Store.dat row by row. The mapping of which field number in first file to be replaced by which field no of second file is contained in a third file called mapping.dat. In the end i need, rea file having mocked data on given fields and a lookup file having original fields and corresponding mocked fields value. it also needs to have a primary key from prod file <say SEQ_ID, position given in mapping file>. Please help.TIA. Please see expected input/output through below example with sample data.
Input 1: sample prod file:
Input 2 : mocked_store.dat:(containing mocked data)
Input 3: mapping file:
OUTPUT1: prod file <actual data replaced by mocked data>
OUTPUT 2: lookup file < prod data+ mocked up data ,fields in order of mapping file>
Please NOTE: The real data file does not have field headers. The output lookup file data fields can be in any order. currently i am thinking of having it in same order as mapping file.
---------- Post updated at 03:59 AM ---------- Previous update was at 03:49 AM ----------
Thankyou for suggesting edit in the post. yes this is to mask data such that data remains valid but not the real. so we are provided with mock stores which are created by us and is completely fake data. Please share the relevant awk commands to accomplish this. i have added sample data in my example to make clear expected input output.
Moderator's Comments:
Please use code tags as required by forum rules!
Last edited by rbatte1; 07-29-2016 at 06:23 AM..
Reason: RudiC Added code tags. rbatte1 wrapped NOPARSE tags round Input 2 line to prevent emoticon conversion
Hi, I have input file.
File1:
Seqno Name
121 name1
122 name2
123 name3
124 name4
We will send the file1 to some other team. They will replace name column with place in file1 and send back to us as file2.
file2:
Seqno Place
121 place1
122 place2
124 place3 (2 Replies)
Hi gang.
I'm using a unix/mac system and i'm trying to sort a file (more than 1,000,000 lines).
chr1 100000965 100001001 -
chr1 100002155 100002191 +
chr1 100002165 100002201 +
chr1 100002525 100002561 -
chr1 10000364 ... (2 Replies)
Hi,
I have file like below.
Unix:/pclls/turc>cat tibc.property
executeReceiver=Y
executeSender=Y
I want to replace executeSender=N in the file. My file should be like below.
executeReceiver=Y
executeSender=N
I tried with the below command, its giving error.
cat tibc.property |... (2 Replies)
Hi All,
I am fairly new to the world of Unix, and I am looking for a way to replace a line of text in a file with a delimited array of values.
I have an aliases file that is currently in use on our mail server that we are migrating off of. Until the migration is complete, the server must stay... (8 Replies)
I have a file with thousands of sequences that looks like this:
I need to replace the headers using a second file
Thus, I will end up having the following file:
I am looking for an AWK script that I can easily plug in my current pipeline.
Any help will be greatly appreciated! (6 Replies)
Hi,
We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Hi friends,
I have one file like below. (.csv type)
SNo,data1,data2
1,1,2
2,2,3
3,3,2
and another file like below.
Exclude
data1
where Exclude should be treated as column name in file2.
I want the output shown below.
SNo,data2
1,2
2,3
3,2
Where my data1 column got removed from... (2 Replies)
Hello,
I have a special problem. I have a file in 8 bit and would like to convert the whole database to 16Bit unicode.
The mapping file has the following structure:
The mapper is provided as a zip file
The target file to be converted contains data in English and 8 bit Urdu mapping, a... (4 Replies)
Hello,
I am using Awk in UBUNTU 12.04.
I have a file like following with three fields and 44706 rows.
F1 A A
F2 G G
F3 A T
I have another file like this:
AL_1 F1 A A
AL_2 F1 A T
AL_3 F1 A A
AL_1 F2 G G
AL_2 F2 G A
AL_3 F2 G G
BO_1 F1 A A
BO_2 F1 A T... (6 Replies)
Hello,
I have to fish out some specific columns from a file based on the header value. I have the list of columns I need in a different file. I thought I could read in the list of headers I need,
# file with header names of required columns in required order
headers_file=$2
# read contents... (11 Replies)