synthex
10-18-2018, 03:43 AM
There is txt files
here this structure (C:/partdata.txt)
I can't attach txt file on this forum, so here the link
https://dropmefiles.com/vzgGv
there is another file with transliteration
C:/23.txt
it contains
old new
MAKFA МАКФА
makar макароны
макар. макароны
MAKFA МАКФА
Макар макароны
макар. макароны
мак макароны
Мак макароны
макф макфа
маkфа макфа
kрупа крупа
https://dropmefiles.com/O7VWu
old column is word which must be replaced, but new column is on what word from old column must be replased in partdata.txt in GOODS_NAME column.
example of partdata.txt
ID ITEM_SUM BARCODE QUANTITY PRICE NDS10 NDS18 GOODS_NAME ID_C_REGCODES_CASH_VOUCHER DISCOUNTNAME DISCOUNTSUM
3972 43.99 1 43.99 4 0 2049750 MAKFA Макар.УЛИТКИ 450г 3971 0
GOODS_NAME columns
MAKFA Макар.УЛИТКИ
so Макар. there is in old column of 23.txt and it should be replaced on макароны in partdata.txt from new column.
how to create vba script in separate file 1.xlsx(script must be run from xlsx, cause txt can have 10M rows) that could be match the words from the good_names column of partdata.txt file with the words in the translit file 23.txt,
and if it found the word in good_names column of partdata.txt that there is in the old column of translit file 23.txt, then replace it word on new one from the new column of 23 txt in good_names column of partdata.txt like in my example
.
output
ID ITEM_SUM BARCODE QUANTITY PRICE NDS10 NDS18 GOODS_NAME ID_C_REGCODES_CASH_VOUCHER DISCOUNTNAME DISCOUNTSUM
3972 43.99 1 43.99 4 0 2049750 MAKFA макароны УЛИТКИ 450г 3971 0
here this structure (C:/partdata.txt)
I can't attach txt file on this forum, so here the link
https://dropmefiles.com/vzgGv
there is another file with transliteration
C:/23.txt
it contains
old new
MAKFA МАКФА
makar макароны
макар. макароны
MAKFA МАКФА
Макар макароны
макар. макароны
мак макароны
Мак макароны
макф макфа
маkфа макфа
kрупа крупа
https://dropmefiles.com/O7VWu
old column is word which must be replaced, but new column is on what word from old column must be replased in partdata.txt in GOODS_NAME column.
example of partdata.txt
ID ITEM_SUM BARCODE QUANTITY PRICE NDS10 NDS18 GOODS_NAME ID_C_REGCODES_CASH_VOUCHER DISCOUNTNAME DISCOUNTSUM
3972 43.99 1 43.99 4 0 2049750 MAKFA Макар.УЛИТКИ 450г 3971 0
GOODS_NAME columns
MAKFA Макар.УЛИТКИ
so Макар. there is in old column of 23.txt and it should be replaced on макароны in partdata.txt from new column.
how to create vba script in separate file 1.xlsx(script must be run from xlsx, cause txt can have 10M rows) that could be match the words from the good_names column of partdata.txt file with the words in the translit file 23.txt,
and if it found the word in good_names column of partdata.txt that there is in the old column of translit file 23.txt, then replace it word on new one from the new column of 23 txt in good_names column of partdata.txt like in my example
.
output
ID ITEM_SUM BARCODE QUANTITY PRICE NDS10 NDS18 GOODS_NAME ID_C_REGCODES_CASH_VOUCHER DISCOUNTNAME DISCOUNTSUM
3972 43.99 1 43.99 4 0 2049750 MAKFA макароны УЛИТКИ 450г 3971 0