https://github.com/cwchentw/inplace
A lightweight command-line tool to edit your text data efficiently in-place!
https://github.com/cwchentw/inplace
automation cli command-line-tool data-cleaning data-preprocessing devops lightweight posix-sh text-editing text-processing workflow
Last synced: 8 days ago
JSON representation
A lightweight command-line tool to edit your text data efficiently in-place!
- Host: GitHub
- URL: https://github.com/cwchentw/inplace
- Owner: cwchentw
- License: mit
- Created: 2026-05-28T21:50:40.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-05-28T22:06:25.000Z (about 2 months ago)
- Last Synced: 2026-05-29T00:09:00.304Z (about 2 months ago)
- Topics: automation, cli, command-line-tool, data-cleaning, data-preprocessing, devops, lightweight, posix-sh, text-editing, text-processing, workflow
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inplace 🚀
A lightweight command-line tool to edit your text data efficiently in-place! Ideal for streamlined data cleaning and pre-processing pipelines.
## ⚠️ Warning
`inplace` permanently modifies your files **IN-PLACE**. Always back up your critical data before running execution commands.
## Installation
Make the script executable and copy it to your local environment path:
```shell
chmod +x inplace
cp -p inplace ~/bin/
```
## Usage & Data Cleaning Workflow
When dealing with complex CSV files, embedded commas within quotes (like dates or currency) often break standard column splitting. Here is how `inplace` helps you clean and extract data step-by-step.
### 1. Back up your original dataset
```shell
cp VT.csv VT_orig.csv
```
### 2. Clean up embedded commas
Use `inplace` alongside `perl` to pre-process messy columns before splitting:
```shell
# Convert date format inside quotes: "May 28, 2026" -> May-28-2026
inplace perl -pe 's/"([A-Za-z]+) ([0-9]+), ([0-9]+)"/$1-$2-$3/g' VT.csv
# Remove thousands separators inside quotes: "1,234,567" -> 1234567
inplace perl -pe 's/"([0-9]+),([0-9]+),([0-9]+)"/$1$2$3/g' VT.csv
```
### 3. Extract final columns safely
Once the conflicting commas are removed, extract your target columns into a new clean dataset:
```shell
awk 'BEGIN { FS=","; OFS="," } { print $1, $5, $6 }' VT.csv > VT_extracted.csv
```
## License
Copyright (c) 2026 ByteBard. Licensed under the [MIT License](LICENSE).