I created an impex similitar to this:
INSERT_UPDATE Unit;code[unique=true];type(code)[default='TEST', unique=true] ;conversion;
; a ;; 0,001
; b ;; 0,001
; c ;; 1
; d ;; 1
; e ;; 1000
It works just fine on my local. But in another test enviroment the comma is not working as a digit separator. What should I do to indicate in this impex that it should use comma as a digit separator?
It worked after I added to the impex header:
#% impex.setLocale(Locale.ENGLISH);
Like this:
#% impex.setLocale(Locale.ENGLISH);
INSERT_UPDATE Unit;code[unique=true];type(code)[default='TEST', unique=true] ;conversion;
; a ;; 0,001
; b ;; 0,001
; c ;; 1
; d ;; 1
; e ;; 1000
Related
I'm scripting a small program for my company and I'm using PS3 and select to display the menu, the problem is that instead of printing a menu like this one:
1. SharePoint
2. AWS
3. Connect Direct
4. Proofpoint
5. DELL
6. Sair
The program prints it like this:
1. SharePoint 3. Connect Direct 5. DELL
2. AWS 4. Proofpoint 6. Sair
Here's the code:
function postagem(){
clear
quodZip
PS3="Plataforma que deseja enviar o arquivo [1-5]: "
select i in 'SharePoint' 'AWS' 'Connect Direct' 'Proofpoint' 'DELL' 'Sair'
do
case "$i" in
"SharePoint")
plataforma="Share Point";
break
;;
"AWS")
plataforma="AWS";
break
;;
"Connect Direct")
plataforma="Connect Direct";
break
;;
"Proofpoint")
plataforma="Proofpoint";
break
;;
"DELL")
plataforma="DELL";
break
;;
"Sair")
exit;
;;
*)
echo ''
echo "Opcao invalida, escolha novamente"
;;
esac
done
}
Use the COLUMNS variable before select.
function postagem(){
COLUMNS=0
clear
quodZip
PS3="Plataforma que deseja enviar o arquivo [1-5]: "
select i in 'SharePoint' 'AWS' 'Connect Direct' 'Proofpoint' 'DELL' 'Sair'
do
case "$i" in
"SharePoint")
plataforma="Share Point";
break
;;
"AWS")
plataforma="AWS";
break
;;
"Connect Direct")
plataforma="Connect Direct";
break
;;
"Proofpoint")
plataforma="Proofpoint";
break
;;
"DELL")
plataforma="DELL";
break
;;
"Sair")
exit;
;;
*)
echo ''
echo "Opcao invalida, escolha novamente"
;;
esac
done
}
I want to show the different price for a product to different customer groups in the Hybris.
How to achieve this through Impex?
You can create UserPriceGroup and assign it to the price rows and customer/b2bunit
INSERT_UPDATE UserPriceGroup ; code[unique=true] ; name[lang=en]
; group1 ; "Group 1"
; group2 ; "Group 2"
INSERT_UPDATE PriceRow ; product(code, $catalogVersionStaged)[unique=true] ; currency(isocode)[unique=true] ; price ; net[unique=true,default=false] ; ug(code)[allownull=true] ; unit(code)[default=pieces]
; PRODUCT-1 ; CAD ; 90.00 ; false ; group1 ;
; PRODUCT-1 ; CAD ; 100.00 ; false ; group2 ;
UPDATE Customer ; uid[unique=true] ; Europe1PriceFactory_UPG(code)
; cus1 ; group1
; cus2 ; group2
find the detailed answer here
Please help to achieve this. I added these two properties from non facets index property to facet index property in solr.implex file. Run the full indexer ,
added customer review for some of the products and approved the status as well in spite of that these two properties are not showing as facets in storefront.
Please guide me step by step how can I achieve this. I have already wasted 2.5 days to achieve the same.
I am using hybris 6.4
First, run the below Impex form the HAC. Don't forget to change apparel-ukProductType with your Indexed type.
$solrIndexedType=apparel-ukProductType
# Facet properties
INSERT_UPDATE SolrIndexedProperty ; solrIndexedType(identifier)[unique=true] ; name[unique=true] ; type(code) ; sortableType(code) ; currency[default=false] ; localized[default=false] ; multiValue[default=false] ; useForSpellchecking[default=false] ; useForAutocomplete[default=false] ; fieldValueProvider ; valueProviderParameters[map-delimiter=|] ; ftsPhraseQuery[default=false] ; ftsPhraseQueryBoost ; ftsQuery[default=false] ; ftsQueryBoost ; ftsFuzzyQuery[default=false] ; ftsFuzzyQueryBoost ; ftsWildcardQuery[default=false] ; ftsWildcardQueryType(code)[default=POSTFIX] ; ftsWildcardQueryBoost ; ftsWildcardQueryMinTermLength ; facetType(code) ; facetSort(code) ; priority ; visible ; facet[default=true]
; $solrIndexedType ; reviewAvgRating ; double ; ; ; TRUE ; ; ; ; productReviewAverageRatingValueProvider ; ; ; ; ; ; ; ; ; ; ; ; MultiSelectOr ; Custom ; 10000 ; true ;
; $solrIndexedType ; inStockFlag ; boolean ; ; ; ; ; ; ; productInStockFlagValueProvider ; ; ; ; ; ; ; ; ; ; ; ; MultiSelectOr ; Custom ; 10000 ; true ;
You can do the same changes from backoffice/hmc.
Go to System > Facet Search > Indexed Type > select your type from list > Find the inStockFlag under Properties filed > scroll to end (right) to edit inStockFlag properties > In popup go to facet setting tab > Mark Facet to true and edit other fields.
Lastly, run the full indexer.
How can I remove ALL whitescape in a file, using Notepad++?
Example data:
;; ;;;2017-03-02;8.026944444;16.88583333;8.858888889
;; ; ; ; 2017-03-03 ; 7.912777778 ; 16.88583333 ; 8.973055556
;; ; ; ; 2017-03-06 ; 7.954444444 ; 16.88583333 ; 8.931388889
; ; ; ; ; 2017-03-07 ; 7.926388889 ; 16.88583333 ; 8.959444444
;;;;;2017-03-05;8.984722222;16.98472222 ;8
To delete all spaces in the file, replace ' +' with '' (quotes only for demonstration, please remove them). You need to have the checkbox "Regular expression" checked.
To remove all spaces and tabs, replace '[ \t]+' with '' (remove quotes).
This works for big files, too, where the solution of #Learner will be tiresome.
No need for regular expressions. In Find what add a whitespace character and then replace with nothing.
Press Shift+Alt then press the down button before "56". Then backspace. You will see the cursor becomes big and then you can remove the spaces all at once.
I want my calendar to correctly handle months with leading zeros
for example: "cal 01" or "cal 01 2012"
How do I write the code to make my calendar to correctly handle months with leading zeros?
This is my code so far:
$ cat cal
#cal: nicer interface to /usr/bin/cal
case $# in
0) set 'data';m=$2; y=$6 ;; # no argu: use today
1) m=$1; set 'data'; y=$6 ;; # 1 rg: use this year
*) m=$1; y=$2 ;; # 2 ags: month and year
esac
case $m in
jan*|Jan*) m=1 ;;
feb*|Feb*) m=2 ;;
mar*|Mar*) m=3 ;;
apr*|Apr*) m=4 ;;
may*|May*) m=5 ;;
jun*|Jun*) m=6 ;;
jul*|Jul*) m=7 ;;
aug*|Aug*) m=8 ;;
sep*|Sep*) m=9 ;;
oct*|Oct*) m=10 ;;
nov*|Nov*) m=11 ;;
dec*|Dec*) m=12 ;;
[1-9]|10|11|12) ;; # numeric month
*) y=$m; m="" ;; # plain year
esac
/usr/bin/cal $m $y # run the real one
$
You can do multiple regex matching in your case statement, i.e.
case $m in
01|1|jan*|Jan*) m=1 ;;
02|2|feb*|Feb*) m=2 ;;
....
Else, you could use shell parameter substitution to remove any leading 0's, i.e.
# as a way to demonstrate param sub on $1 etc, load values to $1 and $2
set -- 01 02
echo ${1#0}
echo ${2#0}
# output
1
2
Edit
For your follow-up question
Example, the current month is November, 2005, if you run "cal 01", you should print out the calendar of Jan. 2006
Try this:
# if the month input is less than the current month, assume the next year
if (( ${y:-0} == 0 && m < $(/bin/date +%m) )) ; then
y=$(/bin/date +%Y)
((y++))
fi
${y:-0} is one of several parameter checking syntaxs provided by most shells that allows a default value to be substituted if the var value is completely unset (not set at all) or = "". So in this case, if y wasn't set by the command line, it will appear as 0 in this evaluation, allowing the && section to be be executed to test the month, etc.
You'll need to extend your case $# processing to allow for 1 argument, that is assumed to be a month value.
I hope this helps.