Skip to main content
deleted 28 characters in body; edited tags
Source Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

I have a file having the following records (pipe delimited):

SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD   P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD   P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB   2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD 

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPROD and QADDB database. If a duplicate is found: Change the value of the status flag (13th value) to 'X' from the QADDB database.

For example, in the above 4 records:

The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPROD and the QADDB databases. If yes, the I mark the status flag as 'X' for the record from QADDB database.

Please help.

I have a file having the following records (pipe delimited):

SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD   P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD   P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB   2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD 

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPROD and QADDB database. If a duplicate is found: Change the value of the status flag (13th value) to 'X' from the QADDB database.

For example, in the above 4 records:

The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPROD and the QADDB databases. If yes, the I mark the status flag as 'X' for the record from QADDB database.

Please help.

I have a file having the following records (pipe delimited):

SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB 2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD 

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPROD and QADDB database. If a duplicate is found: Change the value of the status flag (13th value) to 'X' from the QADDB database.

For example, in the above 4 records:

The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPROD and the QADDB databases. If yes, the I mark the status flag as 'X' for the record from QADDB database.

Added some highlighting and indentation.
Source Link

I have a file having the following records (pipe delimited): SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD

P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD

P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB

2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD

SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB 2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD 

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPRODUKPROD and QADDBQADDB database. If a duplicate is found; changefound: Change the value of the status flag (13th value) to 'X' from the QADDBQADDB database.

For example, in the above 4 records: The

The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPRODUKPROD and teh QADDBthe QADDB databases. If yes, the I mark the status flag as X'X' for the record from QADDBQADDB database.

Please help.

I have a file having the following records (pipe delimited): SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD

P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD

P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB

2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPROD and QADDB database. If a duplicate is found; change the value of the status flag (13th value) to 'X' from the QADDB database.

For example, in the above 4 records: The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPROD and teh QADDB databases. If yes, the I mark the status flag as X for the record from QADDB database.

Please help.

I have a file having the following records (pipe delimited):

SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB 2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD 

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPROD and QADDB database. If a duplicate is found: Change the value of the status flag (13th value) to 'X' from the QADDB database.

For example, in the above 4 records:

The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPROD and the QADDB databases. If yes, the I mark the status flag as 'X' for the record from QADDB database.

Please help.

Source Link

set flag to remove duplicate records from a file based on some values of the record

I have a file having the following records (pipe delimited): SK200-10|ALBUMIN-SK|INS|SEKURE ALBUMIN 2 X 65ML|REAG-IVD|SEKI-PEI|90|14IAG|KIDNEY/LIVER|MD|NA|0|U|MFGPRO|15-May-2014|15-May-2014|MFGPRO|CAPPROD

P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|MFGPRO|UKPROD

P/G-PPR|NA-INS|INS|GEWINDEFLASCHE +DECKEL ROT|NON-REAG|ZINSSER|0|NA|NA|NA|NON-REAG|0|U|DM|3-Jun-2014|3-Jun-2014|DM|QADDB

2898|OTHER-RT|RT|PRINTED MEMBRANE, ADENOVIRUS|NON-REAG|SEKI-SD|60|NA|NA|NA|NA|0|U|MFGPRO|24-Apr-2013|24-Apr-2013|MFGPRO|PACEPROD

In these pipe delimited records: The first value is the item number. The 13th value is the status flag. The last value is the database name.

Check for duplicate records based on the Item number from the UKPROD and QADDB database. If a duplicate is found; change the value of the status flag (13th value) to 'X' from the QADDB database.

For example, in the above 4 records: The item number is same for the 2nd and the 3rd record. I then check if they exist between the UKPROD and teh QADDB databases. If yes, the I mark the status flag as X for the record from QADDB database.

Please help.