From 27a4eb5c8b60d955bb50ed25f345c1f9f2218224 Mon Sep 17 00:00:00 2001 From: shouchih_chen Date: Sun, 20 Feb 2022 07:53:55 +0800 Subject: [PATCH] marco mac/windows handle /r/n string --- NameCreater/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NameCreater/main.cpp b/NameCreater/main.cpp index 98b2c93..46a89a8 100644 --- a/NameCreater/main.cpp +++ b/NameCreater/main.cpp @@ -122,7 +122,11 @@ QList getNameByFile(const QString& filename) { QString name1 = csvList.at(0); QString type_str = csvList.last();//QString::fromLocal8Bit(csvList.last()); qDebug() << "row :" << row << " " << name1; +#ifdef Q_OS_MAC + type_str = type_str.remove(QRegExp("\n")); +#else type_str = type_str.remove(QRegExp("\r\n")); +#endif if (name1.compare("name_1") == 0) { continue;