Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tairasu/replace-from-sheets
A simple Rust tool to replace words in a text file from any Google Spreadsheet
https://github.com/tairasu/replace-from-sheets
google-sheets replace-text rust
Last synced: 4 days ago
JSON representation
A simple Rust tool to replace words in a text file from any Google Spreadsheet
- Host: GitHub
- URL: https://github.com/tairasu/replace-from-sheets
- Owner: tairasu
- Created: 2023-02-24T11:24:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T20:24:43.000Z (over 1 year ago)
- Last Synced: 2024-12-10T06:12:11.394Z (2 months ago)
- Topics: google-sheets, replace-text, rust
- Language: Rust
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# replace-from-sheets
A simple Rust tool to replace words in a text file from any Google Spreadsheet.
It takes two columns in a Google Spreadsheet and uses them to replace words in any text file.First column: check which word should be replaced.
Second column: replacing word
| Column A | Column B |
| ------------- | ------------- |
| Aple | Apple |
| Starwbery | Strawberry |Words on the same line will get replaced.
**Having 2 or more words in a cell works too, but both cells need to have the same amount of words**
## How to use
Inside the src folder there is a init.json file which needs to be edited to your own spreadsheet ID, your desired columns and your own API.
Then navigate to the folder path in your terminal and type ```replace-from-sheets FILENAME.txt```
The text file you want to edit needs to be in the same folder.### Prerequisites
To build yourself you only need Rust. All Cargo dependencies will be downloaded on building.
Get your own Google Spreadsheet API or any other Google API from any account. It doesn't matter which account you use. The API is only used to read the columns.
**Example init.json**
```
{
"spreadsheet_id": "1234567",
"column1": "Sheet1!A1:A",
"column2": "Sheet1!B1:B",
"api_key": "123abc123abc"
}
```### Building
Navigate to the root folder and enter
```
cargo build --release
```