0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Excelの縦セル郵便番号データをカンマ区切り1行テキストにしてデータベースに登録

Posted at

やりたいこと

こんな感じのExcelデータを、
スクリーンショット 2022-04-19 16.09.49.png
ハイフンを抜いて1行カンマ区切りデータにしたい
スクリーンショット 2022-04-19 16.10.59.png

データをコピペ

Excelデータをコピー

スクリーンショット 2022-04-19 16.12.57.png

VSCodeにペースト

900-0000
900-0001
900-0002
900-0003
900-0004

VSCodeでデータ変換

置換でハイフンを抜く

VSCode>編集>置換
スクリーンショット 2022-04-19 16.18.34.png
検索窓にハイフンをコピペ
「すべて置換」を実行
スクリーンショット 2022-04-19 16.18.34.png

9000000
9000001
9000002
9000003
9000004

1行化とカンマ追加

二行目文末にカーソルを配置

9000000
9000001|
9000002
9000003
9000004

Option + cmnd + ↓
最終行文末までマルチカーソル

9000000
9000001|
9000002|
9000003|
9000004|

←でカーソルを文頭に移動

9000000
|9000001
|9000002
|9000003
|9000004

Deleteすると1行になる

9000000|9000001|9000002|9000003|9000004

カーソルが点滅している間に「,」を1回入力

9000000,9000001,9000002,9000003,9000004

カンマ区切りの1行データが完成


参考記事

https://qiita.com/NT90957869/items/d76329a12d00721c6e85

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?