You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求Mac端Notepad++替代工具:处理Excel转UTF-8 CSV及字符校验

Hey there! I’ve been right where you are—fumbling with Magento CSV imports on a Mac after being used to Notepad++ on Windows. No worries, there are solid native and free tools that get the job done, including handling UTF-8 encoding and those pesky special characters that break imports. Let’s dive in:

Mac Tools to Replace Notepad++ for Magento CSV Prep (UTF-8 + Special Character Cleanup)

1. Mac Built-in: TextEdit (No Extra Downloads Needed)

Perfect if you want to avoid installing third-party apps:

  • First, export your Excel file to CSV directly from Excel: Go to File > Save As and choose CSV format.
  • Open the CSV in TextEdit, then switch to plain text mode: Format > Make Plain Text (critical—rich text will mess up your CSV structure).
  • Save as UTF-8: Go to File > Save, click the Advanced Options dropdown at the bottom left. Select Unicode (UTF-8) as the encoding, check "Ignore rich text commands", then save.
  • Clean special characters:
    • Use Cmd + F to open Find & Replace, click "Show Replace".
    • For curly quotes (“”‘’), replace them with straight quotes ("" ''). Enable regex mode (click the dropdown next to the search box > Use Regular Expression) and search for [\u201C\u201D] to replace with ", and [\u2018\u2019] to replace with '.
    • For non-standard hyphens (like en-dashes, em-dashes), search for [\u2010-\u2015] and replace with -.
    • For accented characters, if Magento doesn’t handle them well, replace individual ones (e.g., é → e) or use the Character Viewer (Edit > Emoji & Symbols) to find and replace.

This is my go-to for CSV prep on Mac—it’s way more flexible than TextEdit for regex and batch edits:

  • Export your Excel file to CSV first.
  • Open the CSV in VS Code. Check the bottom-right corner for the current encoding (e.g., GB2312 or ISO-8859-1). Click that encoding label, select Reopen with Encoding > UTF-8, then click again and select Save with Encoding > UTF-8.
  • Clean special characters:
    • Open Find & Replace with Cmd + F, click the .* button to enable regex mode.
    • Curly quotes: Search [\u201C\u201D] → replace with "; search [\u2018\u2019] → replace with '.
    • Hyphens/dashes: Search [\u2010-\u2015] → replace with -.
    • For accented characters, install the free extension Replace Special Characters from the VS Code marketplace to bulk replace accented letters with their plain counterparts.

3. Command Line (Great for Bulk Processing)

If you have multiple CSV files to handle, the terminal is your friend:

  1. Export your Excel files to CSV and put them in a single folder.
  2. Open Terminal and navigate to that folder: cd /path/to/your/csv/folder
  3. Convert to UTF-8 (replace GB2312 with your CSV’s current encoding if needed):
    iconv -f GB2312 -t UTF-8 input.csv > output_utf8.csv
    
  4. Clean special characters with sed (this handles Windows curly quotes; adjust the hex codes if your characters are different):
    sed -e 's/[\x93\x94]/"/g' -e 's/[\x91\x92]/'\''/g' output_utf8.csv > cleaned_final.csv
    

Quick Magento Import Tips

  • After cleaning, always preview your CSV in Magento’s Import tool first—this will catch any remaining issues before you run the full import.
  • Make sure there are no extra blank rows at the end of the CSV; these often cause import failures.
  • Double-check that your column headers match Magento’s attribute names exactly (case-sensitive in some versions).

内容的提问来源于stack exchange,提问作者Promo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:09:38