无标题

复制
ingredient_all.csv:
 sed -i 's/Warm/温/g' chinese_properity_821.txt
sed -i 's/Cold/寒/g' chinese_properity_821.txt
 sed -i 's/Mild/平/g' chinese_properity_821.txt
 sed -i 's/Minor Warm/微温/g' chinese_properity_821.txt
 sed -i 's/Hot/热/g' chinese_properity_821.txt
 sed -i 's/Cool/凉/g' chinese_properity_821.txt
 sed -i 's/Minor cold/微寒/g' chinese_properity_821.txt
成分表,中文乱码以及最后有M,
(base) [dddc@localhost test]$ file -i 61966_ingredient.csv
61966_ingredient.csv: text/plain; charset=unknown-8bit
(base) [dddc@localhost test]$ file 61966_ingredient.csv
61966_ingredient.csv: Non-ISO extended-ASCII text, with very long lines, with CRLF, LF line terminators
(base) [dddc@localhost test]$ enca 61966_ingredient.csv
bash: enca: command not found...
(base) [dddc@localhost test]$ iconv -f GBK -t UTF-8 61966_ingredient.csv -o 61966_ingredient_utf8.csv
(base) [dddc@localhost test]$ sed -i 's/\r$//' 61966_ingredient_utf8.csv
(base) [dddc@localhost test]$ file -i 61966_ingredient_utf8.csv
61966_ingredient_utf8.csv: text/plain; charset=utf-8
(base) [dddc@localhost test]$ awk '{if ($1 !~ /^TCMBANKIN/) {printf "%s", $0; next} else {printf "\n%s", $0}} END {printf "\n"}' 61966_ingredient_utf8.csv > fixed_61966_ingredient.csv
(base) [dddc@localhost test]$ sed 's/"//g' fixed_61966_ingredient.csv > 61966_ingredient.csv
 cut -d',' -f2 61966_ingredient.csv | sort | uniq -c | sort -nr >test.txt
 
  •  cut -d',' -f3 159_output_summary.csv | cut -d';' -f1 | sort | uniq -c | sort -nr
  •  awk '/温|热|微温/' 159_output_summary.csv > wr.txt