convert map flag to be at the regex item level
This commit is contained in:
parent
417bdca27d
commit
f88584f835
@ -10,25 +10,25 @@ SELECT
|
|||||||
t.rec,
|
t.rec,
|
||||||
m.target,
|
m.target,
|
||||||
m.seq,
|
m.seq,
|
||||||
regex->>'map' map_intention,
|
|
||||||
regex->>'function' regex_function,
|
regex->>'function' regex_function,
|
||||||
e.v ->> 'field' result_key_name,
|
e.v ->> 'field' result_key_name,
|
||||||
e.v ->> 'key' target_json_path,
|
e.v ->> 'key' target_json_path,
|
||||||
e.v ->> 'flag' regex_options_flag,
|
e.v ->> 'flag' regex_options_flag,
|
||||||
|
e.v->>'map' map_intention,
|
||||||
e.v->>'retain' retain_result,
|
e.v->>'retain' retain_result,
|
||||||
e.v->>'regex' regex_expression,
|
e.v->>'regex' regex_expression,
|
||||||
e.rn target_item_number,
|
e.rn target_item_number,
|
||||||
COALESCE(mt.rn,rp.rn,1) result_number,
|
COALESCE(mt.rn,rp.rn,1) result_number,
|
||||||
mt.mt rx_match,
|
mt.mt rx_match,
|
||||||
rp.rp rx_replace,
|
rp.rp rx_replace,
|
||||||
CASE regex->>'map'
|
CASE e.v->>'map'
|
||||||
WHEN 'yes' THEN
|
WHEN 'y' THEN
|
||||||
e.v->>'field'
|
e.v->>'field'
|
||||||
ELSE
|
ELSE
|
||||||
null
|
null
|
||||||
END map_key,
|
END map_key,
|
||||||
CASE regex->>'map'
|
CASE e.v->>'map'
|
||||||
WHEN 'yes' THEN
|
WHEN 'y' THEN
|
||||||
CASE regex->>'function'
|
CASE regex->>'function'
|
||||||
WHEN 'extract' THEN
|
WHEN 'extract' THEN
|
||||||
CASE WHEN array_upper(mt.mt,1)=1
|
CASE WHEN array_upper(mt.mt,1)=1
|
||||||
@ -87,7 +87,8 @@ ORDER BY
|
|||||||
COALESCE(mt.rn,rp.rn,1)
|
COALESCE(mt.rn,rp.rn,1)
|
||||||
)
|
)
|
||||||
|
|
||||||
--SELECT * FROM rx
|
--SELECT count(*) FROM rx LIMIT 100
|
||||||
|
|
||||||
|
|
||||||
, agg_to_target_items AS (
|
, agg_to_target_items AS (
|
||||||
SELECT
|
SELECT
|
||||||
@ -144,7 +145,8 @@ GROUP BY
|
|||||||
,retain_key
|
,retain_key
|
||||||
)
|
)
|
||||||
|
|
||||||
--SELECT * FROM agg_to_target_items
|
--SELECT * FROM agg_to_target_items LIMIT 100
|
||||||
|
|
||||||
|
|
||||||
, agg_to_target AS (
|
, agg_to_target AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
SELECT
|
SELECT
|
||||||
m.srce,
|
m.srce,
|
||||||
m.target,
|
m.target,
|
||||||
regex->>'map' map_intention,
|
|
||||||
regex->>'function' regex_function,
|
regex->>'function' regex_function,
|
||||||
regex->>'where' where_clause,
|
regex->>'where' where_clause,
|
||||||
e.v ->> 'field' result_key_name,
|
e.v ->> 'field' result_key_name,
|
||||||
e.v ->> 'key' target_json_path,
|
e.v ->> 'key' target_json_path,
|
||||||
e.v ->> 'flag' regex_options_flag,
|
e.v ->> 'flag' regex_options_flag,
|
||||||
|
e.v->>'map' map_intention,
|
||||||
e.v->>'retain' retain_result,
|
e.v->>'retain' retain_result,
|
||||||
e.v->>'regex' regex_expression,
|
e.v->>'regex' regex_expression,
|
||||||
e.rn target_item_number
|
e.rn target_item_number
|
||||||
|
@ -12,11 +12,11 @@ SET regex =
|
|||||||
"regex": ",",
|
"regex": ",",
|
||||||
"replace":"",
|
"replace":"",
|
||||||
"flag":"g",
|
"flag":"g",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"function":"replace",
|
"function":"replace",
|
||||||
"map":"no",
|
|
||||||
"where": [
|
"where": [
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -38,74 +38,83 @@ SET regex =
|
|||||||
"field":"Comp Name",
|
"field":"Comp Name",
|
||||||
"regex": "Comp Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Comp Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Cust ID",
|
"field":"Cust ID",
|
||||||
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Desc",
|
"field":"Desc",
|
||||||
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Cust Name",
|
"field":"Cust Name",
|
||||||
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Batch Discr",
|
"field":"Batch Discr",
|
||||||
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Comp ID",
|
"field":"Comp ID",
|
||||||
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Addenda",
|
"field":"Addenda",
|
||||||
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"SETT",
|
"field":"SETT",
|
||||||
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Date",
|
"field":"Date",
|
||||||
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Time",
|
"field":"Time",
|
||||||
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"function":"extract",
|
"function":"extract",
|
||||||
"map":"no",
|
|
||||||
"where": [
|
"where": [
|
||||||
{
|
{
|
||||||
"Transaction":"ACH Credits"
|
"Transaction":"ACH Credits"
|
||||||
@ -130,81 +139,91 @@ SET regex =
|
|||||||
"field": "dparse",
|
"field": "dparse",
|
||||||
"regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)",
|
"regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"g",
|
"flag":"g",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "beneficiary_components",
|
"field": "beneficiary_components",
|
||||||
"regex": "BENEFICIARY:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
|
"regex": "BENEFICIARY:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "originator_components",
|
"field": "originator_components",
|
||||||
"regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
|
"regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "OBI",
|
"field": "OBI",
|
||||||
"regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "RFB",
|
"field": "RFB",
|
||||||
"regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "ABA",
|
"field": "ABA",
|
||||||
"regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "BBI",
|
"field": "BBI",
|
||||||
"regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "BENEBNK",
|
"field": "BENEBNK",
|
||||||
"regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "IBK",
|
"field": "IBK",
|
||||||
"regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "RATE",
|
"field": "RATE",
|
||||||
"regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "RECVBNK",
|
"field": "RECVBNK",
|
||||||
"regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)",
|
"regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"function":"extract",
|
"function":"extract",
|
||||||
"map":"no",
|
|
||||||
"where": [
|
"where": [
|
||||||
{
|
{
|
||||||
"Transaction":"Money Transfer DB - Wire"
|
"Transaction":"Money Transfer DB - Wire"
|
||||||
@ -236,25 +255,27 @@ SET regex =
|
|||||||
{
|
{
|
||||||
"name":"Trans Type",
|
"name":"Trans Type",
|
||||||
"description":"extract intial description in conjunction with account name and transaction type for mapping",
|
"description":"extract intial description in conjunction with account name and transaction type for mapping",
|
||||||
"map": "yes",
|
|
||||||
"defn": [
|
"defn": [
|
||||||
{
|
{
|
||||||
"key": "{AccountName}",
|
"key": "{AccountName}",
|
||||||
"field": "acctn",
|
"field": "acctn",
|
||||||
"regex": "(.*)",
|
"regex": "(.*)",
|
||||||
"retain": "n"
|
"retain": "n",
|
||||||
|
"map":"y"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Transaction}",
|
"key": "{Transaction}",
|
||||||
"field": "trans",
|
"field": "trans",
|
||||||
"regex": "(.*)",
|
"regex": "(.*)",
|
||||||
"retain": "n"
|
"retain": "n",
|
||||||
|
"map":"y"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "ini",
|
"field": "ini",
|
||||||
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
|
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
|
||||||
"retain": "y"
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"where": [
|
"where": [
|
||||||
@ -273,25 +294,27 @@ SET regex =
|
|||||||
{
|
{
|
||||||
"name":"Currency",
|
"name":"Currency",
|
||||||
"description":"pull out currency indicators from description of misc items and map",
|
"description":"pull out currency indicators from description of misc items and map",
|
||||||
"map": "yes",
|
|
||||||
"defn": [
|
"defn": [
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "ini",
|
"field": "ini",
|
||||||
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
|
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
|
||||||
"retain": "y"
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "curr1",
|
"field": "curr1",
|
||||||
"regex": ".*(DEBIT|CREDIT).*(USD|CAD).*(?=DEBIT|CREDIT).*(?=USD|CAD).*",
|
"regex": ".*(DEBIT|CREDIT).*(USD|CAD).*(?=DEBIT|CREDIT).*(?=USD|CAD).*",
|
||||||
"retain": "y"
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "curr2",
|
"field": "curr2",
|
||||||
"regex": ".*(?=DEBIT|CREDIT).*(?=USD|CAD).*(DEBIT|CREDIT).*(USD|CAD).*",
|
"regex": ".*(?=DEBIT|CREDIT).*(?=USD|CAD).*(DEBIT|CREDIT).*(USD|CAD).*",
|
||||||
"retain": "y"
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"where": [
|
"where": [
|
||||||
@ -311,13 +334,13 @@ UPDATE tps.map_rm
|
|||||||
SET regex =
|
SET regex =
|
||||||
$j$
|
$j$
|
||||||
{
|
{
|
||||||
"map": "yes",
|
|
||||||
"defn": [
|
"defn": [
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field": "checkn",
|
"field": "checkn",
|
||||||
"regex": "[^0-9]*([0-9]*)\\s|$",
|
"regex": "[^0-9]*([0-9]*)\\s|$",
|
||||||
"retain": "y"
|
"retain": "y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"where": [
|
"where": [
|
||||||
|
12
ubm_data.sql
12
ubm_data.sql
@ -38,12 +38,12 @@ INSERT INTO srce (srce, defn) VALUES ('ADPRP', '{"name": "ADPRP", "type": "csv",
|
|||||||
-- Data for Name: map_rm; Type: TABLE DATA; Schema: tps; Owner: -
|
-- Data for Name: map_rm; Type: TABLE DATA; Schema: tps; Owner: -
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Trans Type', '{"map": "yes", "defn": [{"key": "{AccountName}", "field": "acctn", "regex": "(.*)", "retain": "n"}, {"key": "{Transaction}", "field": "trans", "regex": "(.*)", "retain": "n"}, {"key": "{Description}", "field": "ini", "regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)", "retain": "y"}], "where": [{}], "function": "extract"}', 1);
|
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Strip Amount Commas', '{"defn": [{"key": "{Amount}", "map": "n", "flag": "g", "field": "amount", "regex": ",", "retain": "y", "replace": ""}], "name": "Strip Amount Commas", "where": [{}], "function": "replace", "description": "the Amount field come from PNC with commas embeded so it cannot be cast to numeric"}', 1);
|
||||||
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Currency', '{"map": "yes", "defn": [{"key": "{Description}", "field": "ini", "regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)", "retain": "y"}, {"key": "{Description}", "field": "curr1", "regex": ".*(DEBIT|CREDIT).*(USD|CAD).*(?=DEBIT|CREDIT).*(?=USD|CAD).*", "retain": "y"}, {"key": "{Description}", "field": "curr2", "regex": ".*(?=DEBIT|CREDIT).*(?=USD|CAD).*(DEBIT|CREDIT).*(USD|CAD).*", "retain": "y"}], "where": [{"Transaction": "Miscellaneous Credits"}, {"Transaction": "Miscellaneous Debits"}], "function": "extract"}', 2);
|
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Trans Type', '{"defn": [{"key": "{AccountName}", "map": "y", "field": "acctn", "regex": "(.*)", "retain": "n"}, {"key": "{Transaction}", "map": "y", "field": "trans", "regex": "(.*)", "retain": "n"}, {"key": "{Description}", "map": "y", "field": "ini", "regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)", "retain": "y"}], "name": "Trans Type", "where": [{}], "function": "extract", "description": "extract intial description in conjunction with account name and transaction type for mapping"}', 1);
|
||||||
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Check Number', '{"map": "yes", "defn": [{"key": "{Description}", "field": "checkn", "regex": "[^0-9]*([0-9]*)\\s|$", "retain": "y"}], "where": [{"Transaction": "Checks Paid"}], "function": "extract"}', 2);
|
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Currency', '{"defn": [{"key": "{Description}", "map": "y", "field": "ini", "regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)", "retain": "y"}, {"key": "{Description}", "map": "y", "field": "curr1", "regex": ".*(DEBIT|CREDIT).*(USD|CAD).*(?=DEBIT|CREDIT).*(?=USD|CAD).*", "retain": "y"}, {"key": "{Description}", "map": "y", "field": "curr2", "regex": ".*(?=DEBIT|CREDIT).*(?=USD|CAD).*(DEBIT|CREDIT).*(USD|CAD).*", "retain": "y"}], "name": "Currency", "where": [{"Transaction": "Miscellaneous Credits"}, {"Transaction": "Miscellaneous Debits"}], "function": "extract", "description": "pull out currency indicators from description of misc items and map"}', 2);
|
||||||
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Strip Amount Commas', '{"map": "no", "defn": [{"key": "{Amount}", "flag": "g", "field": "amount", "regex": ",", "retain": "y", "replace": ""}], "name": "Strip Amount Commas", "where": [{}], "function": "replace", "description": "the Amount field come from PNC with commas embeded so it cannot be cast to numeric"}', 1);
|
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Check Number', '{"defn": [{"key": "{Description}", "map": "n", "field": "checkn", "regex": "[^0-9]*([0-9]*)\\s|$", "retain": "y"}], "where": [{"Transaction": "Checks Paid"}], "function": "extract"}', 2);
|
||||||
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Parse ACH', '{"map": "no", "defn": [{"key": "{Description}", "flag": "", "field": "Comp Name", "regex": "Comp Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Cust ID", "regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Desc", "regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Cust Name", "regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Batch Discr", "regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Comp ID", "regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Addenda", "regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "SETT", "regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Date", "regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "Time", "regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}], "name": "Parse ACH", "where": [{"Transaction": "ACH Credits"}, {"Transaction": "ACH Debits"}], "function": "extract", "description": "parse select components of the description for ACH Credits Receieved"}', 2);
|
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Parse ACH', '{"defn": [{"key": "{Description}", "map": "n", "flag": "", "field": "Comp Name", "regex": "Comp Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Cust ID", "regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Desc", "regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Cust Name", "regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Batch Discr", "regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Comp ID", "regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Addenda", "regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "SETT", "regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Date", "regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "Time", "regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)", "retain": "y"}], "name": "Parse ACH", "where": [{"Transaction": "ACH Credits"}, {"Transaction": "ACH Debits"}], "function": "extract", "description": "parse select components of the description for ACH Credits Receieved"}', 2);
|
||||||
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Parse Wires', '{"map": "no", "defn": [{"key": "{Description}", "flag": "g", "field": "dparse", "regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "beneficiary_components", "regex": "BENEFICIARY:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "originator_components", "regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "OBI", "regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "RFB", "regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "ABA", "regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "BBI", "regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "BENEBNK", "regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "IBK", "regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "RATE", "regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "flag": "", "field": "RECVBNK", "regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}], "name": "Parse Wires", "where": [{"Transaction": "Money Transfer DB - Wire"}, {"Transaction": "Money Transfer DB - Other"}, {"Transaction": "Money Transfer CR-Wire"}, {"Transaction": "Money Transfer CR-Other"}, {"Transaction": "Intl Money Transfer Debits"}, {"Transaction": "Intl Money Transfer Credits"}], "function": "extract", "description": "pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered"}', 2);
|
INSERT INTO map_rm (srce, target, regex, seq) VALUES ('PNCC', 'Parse Wires', '{"defn": [{"key": "{Description}", "map": "n", "flag": "g", "field": "dparse", "regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "beneficiary_components", "regex": "BENEFICIARY:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "originator_components", "regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "OBI", "regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "RFB", "regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "ABA", "regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "BBI", "regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "BENEBNK", "regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "IBK", "regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "RATE", "regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}, {"key": "{Description}", "map": "n", "flag": "", "field": "RECVBNK", "regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)", "retain": "y"}], "name": "Parse Wires", "where": [{"Transaction": "Money Transfer DB - Wire"}, {"Transaction": "Money Transfer DB - Other"}, {"Transaction": "Money Transfer CR-Wire"}, {"Transaction": "Money Transfer CR-Other"}, {"Transaction": "Intl Money Transfer Debits"}, {"Transaction": "Intl Money Transfer Credits"}], "function": "extract", "description": "pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered"}', 2);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user