(text)
| 145 | |
| 146 | // CSV解析函数 |
| 147 | function parseCSV(text) { |
| 148 | return text |
| 149 | .replace(/\r\n/g, '\n') // 统一Windows换行 |
| 150 | .replace(/\r/g, '\n') // 处理老Mac换行 |
| 151 | .split('\n') // 按Unix/Linux风格分割 |
| 152 | .filter(line => line.trim() !== '') // 移除空行 |
| 153 | .map(line => line.split(',').map(cell => cell.trim())); |
| 154 | } |
| 155 | |
| 156 | // 并行处理CSV |
| 157 | const csvPromises = addressescsv.map(async (csvUrl) => { |