Useful Unix Commands

Remove the content of one file based on another file’s content

Command: grep -vwF -f fields_to_ignore 319333368441911392.txt

fields_to_ignore:
PIN_FLD_ARCHIVE_STATUS
PIN_FLD_BATCH_ID
PIN_FLD_CREATED_T
PIN_FLD_CURRENCY
PIN_FLD_EVENT_NO
PIN_FLD_FLAGS
PIN_FLD_GROUP_OBJ
PIN_FLD_INCR_QUANTITY
PIN_FLD_INCR_UNIT
PIN_FLD_INVOICE_DATA
PIN_FLD_LINK_OBJ
PIN_FLD_LOADER_BATCH_OBJ
PIN_FLD_MIN_QUANTITY
PIN_FLD_MIN_UNIT
PIN_FLD_MOD_T
PIN_FLD_NAP_IP_ADDRESS
PIN_FLD_NET_QUANTITY
PIN_FLD_NETWORK_SESSION_ID
PIN_FLD_ORIGINAL_BATCH_ID
PIN_FLD_PROFILE_LABEL_LIST
PIN_FLD_PROVIDER_DESCR
PIN_FLD_PROVIDER_ID
PIN_FLD_PROVIDER_IPADDR
PIN_FLD_RATED_TIMEZONE_ID
PIN_FLD_READ_ACCESS
PIN_FLD_RERATE_OBJ
PIN_FLD_ROUNDING_MODE
PIN_FLD_RUM_NAME
PIN_FLD_SERVICE_OBJ
PIN_FLD_TAX_LOCALES
PIN_FLD_TAX_SUPPLIER
PIN_FLD_TIMEZONE_ADJ_END_T
PIN_FLD_TIMEZONE_ADJ_START_T
PIN_FLD_TIMEZONE_ID
PIN_FLD_TIMEZONE_MODE
PIN_FLD_TOD_MODE
PIN_FLD_UNIT
PIN_FLD_UNRATED_QUANTITY
PIN_FLD_USAGE_TYPE
PIN_FLD_WRITE_ACCESS
319333368441911392.txt
0 PIN_FLD_POID           POID [0] 0.0.0.1 /event/billing/payment/cc 319333368441911392 0
0 PIN_FLD_CREATED_T    TSTAMP [0] (1568358726) Fri Sep 13 00:12:06 2019
0 PIN_FLD_MOD_T        TSTAMP [0] (1568358726) Fri Sep 13 00:12:06 2019
0 PIN_FLD_READ_ACCESS     STR [0] "L"
0 PIN_FLD_WRITE_ACCESS    STR [0] "L"
0 PIN_FLD_ACCOUNT_OBJ    POID [0] 0.0.0.1 /account 512332467 0
0 PIN_FLD_ARCHIVE_STATUS   ENUM [0] 0
0 PIN_FLD_BATCH_ID        STR [0] ""
0 PIN_FLD_CURRENCY        INT [0] 0
0 PIN_FLD_DESCR           STR [0] ""
0 PIN_FLD_EARNED_END_T TSTAMP [0] (0) <null>
0 PIN_FLD_EARNED_START_T TSTAMP [0] (0) <null>
0 PIN_FLD_EARNED_TYPE     INT [0] 0
0 PIN_FLD_EFFECTIVE_T  TSTAMP [0] (0) <null>
0 PIN_FLD_END_T        TSTAMP [0] (1568358726) Fri Sep 13 00:12:06 2019
0 PIN_FLD_EVENT_NO        STR [0] ""
0 PIN_FLD_FLAGS           INT [0] 0
0 PIN_FLD_GROUP_OBJ      POID [0] 0.0.0.0  0 0
0 PIN_FLD_INCR_QUANTITY DECIMAL [0] 0
0 PIN_FLD_INCR_UNIT      ENUM [0] 0
0 PIN_FLD_INVOICE_DATA    STR [0] ""
0 PIN_FLD_ITEM_OBJ       POID [0] 0.0.0.0  0 0
0 PIN_FLD_LINK_OBJ       POID [0] 0.0.0.0  0 0
0 PIN_FLD_LOADER_BATCH_OBJ   POID [0] 0.0.0.0  0 0
0 PIN_FLD_MIN_QUANTITY DECIMAL [0] 0
0 PIN_FLD_MIN_UNIT       ENUM [0] 0
0 PIN_FLD_NAME            STR [0] "XXXX" 
0 PIN_FLD_NAP_IP_ADDRESS    STR [0] ""
0 PIN_FLD_NETWORK_SESSION_ID    STR [0] ""
0 PIN_FLD_NET_QUANTITY DECIMAL [0] 0
0 PIN_FLD_ORIGINAL_BATCH_ID    STR [0] ""
0 PIN_FLD_PROFILE_LABEL_LIST    STR [0] ""
0 PIN_FLD_PROGRAM_NAME    STR [0] "pin_recover -recover_payment"
0 PIN_FLD_PROVIDER_DESCR    STR [0] ""
0 PIN_FLD_PROVIDER_ID    POID [0] 0.0.0.0  0 0
0 PIN_FLD_PROVIDER_IPADDR BINSTR [0] 1 00
0 PIN_FLD_RATED_TIMEZONE_ID    STR [0] ""
0 PIN_FLD_RERATE_OBJ     POID [0] 0.0.0.0  0 0
0 PIN_FLD_ROUNDING_MODE   ENUM [0] 0
0 PIN_FLD_RUM_NAME        STR [0] ""
0 PIN_FLD_SERVICE_OBJ    POID [0] 0.0.0.0  0 0
0 PIN_FLD_SESSION_OBJ    POID [0] 0.0.0.1 /event/session 319333368441829389 0
0 PIN_FLD_START_T      TSTAMP [0] (1568358726) Fri Sep 13 00:12:06 2019
0 PIN_FLD_SYS_DESCR       STR [0] "Payment - Charge error"
0 PIN_FLD_TAX_LOCALES     STR [0] ""
0 PIN_FLD_TAX_SUPPLIER    INT [0] 0
0 PIN_FLD_TIMEZONE_ADJ_END_T TSTAMP [0] (1568358726) Fri Sep 13 00:12:06 2019
0 PIN_FLD_TIMEZONE_ADJ_START_T TSTAMP [0] (1568358726) Fri Sep 13 00:12:06 2019
0 PIN_FLD_TIMEZONE_ID     STR [0] ""
0 PIN_FLD_TIMEZONE_MODE   ENUM [0] 0
0 PIN_FLD_TOD_MODE       ENUM [0] 0
0 PIN_FLD_UNIT           ENUM [0] 0
0 PIN_FLD_UNRATED_QUANTITY DECIMAL [0] 0
0 PIN_FLD_USAGE_TYPE      STR [0] ""
0 PIN_FLD_USERID         POID [0] 0.0.0.1 /service/pcm_client 1 1038110
0 PIN_FLD_EVENT_MISC_DETAILS  ARRAY [0] allocated 20, used 2
1     PIN_FLD_REASON_DOMAIN_ID    INT [0] 13
1     PIN_FLD_REASON_ID       INT [0] 1023
0 PIN_FLD_PAYMENT      SUBSTRUCT [0] allocated 20, used 13
1     PIN_FLD_ACCOUNT_NO      STR [0] "193514846248574"
1     PIN_FLD_ACH             INT [0] 0
1     PIN_FLD_AMOUNT       DECIMAL [0] 23
1     PIN_FLD_AMOUNT_ORIGINAL_PAYMENT DECIMAL [0] 0
1     PIN_FLD_BILL_NO         STR [0] ""
1     PIN_FLD_CHANNEL_ID      INT [0] 0
1     PIN_FLD_COMMAND        ENUM [0] 4
1     PIN_FLD_CURRENCY        INT [0] 840
1     PIN_FLD_MERCHANT        STR [0] "XXX"
1     PIN_FLD_PAY_TYPE       ENUM [0] 10003
1     PIN_FLD_STATUS         ENUM [0] 30
1     PIN_FLD_SUB_TRANS_ID    STR [0] ""
1     PIN_FLD_TRANS_ID        STR [0] "T1-4c85cb6-0"
0 PIN_FLD_CC_INFO       ARRAY [0] allocated 20, used 4
1     PIN_FLD_AUTH_CODE       STR [0] ""
1     PIN_FLD_AUTH_DATE       STR [0] ""
1     PIN_FLD_RESULT         ENUM [0] 7
1     PIN_FLD_VENDOR_RESULTS    STR [0] ""