https://github.com/wasabina67/sort-csv-file-example
Sort CSV file example
https://github.com/wasabina67/sort-csv-file-example
csv sort
Last synced: 27 days ago
JSON representation
Sort CSV file example
- Host: GitHub
- URL: https://github.com/wasabina67/sort-csv-file-example
- Owner: wasabina67
- License: mit
- Created: 2024-12-10T03:34:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-10T03:49:42.000Z (over 1 year ago)
- Last Synced: 2025-01-12T04:48:53.025Z (about 1 year ago)
- Topics: csv, sort
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sort-csv-file-example
Sort CSV file example
## Run
```bash
cat sample1.csv | sort -t ',' -k1,1
```
```bash
$ cat sample1.csv | sort -t ',' -k1,1
apple,110
banana,90
cherry,100
kiwi,60
lemon,50
orange,120
```
```bash
cat sample2.csv | sort -t ',' -k1,2
```
```bash
$ cat sample2.csv | sort -t ',' -k1,2
apple,110,Shiga
apple,120,Tokyo
banana,100,Nagoya
banana,900,Hokkaido
cherry,100,Kobe
cherry,110,Fukuoka
kiwi,60,Saitama
kiwi,70,Chiba
lemon,50,Sendai
lemon,60,Yokohama
orange,120,Kyoto
orange,130,Osaka
```