Files
ListToMAP/Code/docs/README.md
2026-04-23 19:59:44 +08:00

51 lines
955 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ListToMAP
将 CSV 中的点数据转换为二维网格分布的 CSV 表格。
## 功能说明
1. **输入格式**CSV 文件,包含 6 列
- A 列:序号
- B 列:名称
- C 列X 位置
- D 列Y 位置
- E 列X 大小
- F 列Y 大小
2. **处理逻辑**
- 以最小的 X 大小/Y 大小 为刻度单位
- 根据 X/Y 位置除以刻度后四舍五入,确定网格坐标
- 左下角为坐标原点
3. **输出格式**
- 每个单元格内容:`序号 + 换行 + 名称`
- 输出为新的 CSV 文件
## 使用方法
```bash
cd ListToMAP
python3 main.py
```
## 示例
输入 `input.csv`
```
1,点 A,0,0,10,10
2,点 B,10,0,10,10
3,点 C,20,0,10,10
4,点 D,0,10,10,10
5,点 E,10,10,10,10
```
输出 `output.csv`(用 Excel 打开可见换行效果):
```
4,点 D,5,点 E
1,点 A,2,点 B
```
## 依赖
仅使用 Python 标准库csv 模块),无需安装任何第三方库。