vip search-replace
Search for a string in a local SQL file and replace it with a new string.
Usage
vip search-replace [options]
Options
Option | Description |
---|---|
-d , --debug |
Generate verbose output during command execution to help identify or fix errors or bugs. |
-h , --help |
Retrieve a description, examples, and available options for a (sub)command. |
-i , --in-place |
Overwrite the local input file with the results of the search and replace operation. |
-o , --output |
The local file path used to save a copy of the results from the search and replace operation. Ignored when used with the –in-place option. |
-s , --search-replace |
A comma-separated pair of strings that specify the values to search for and replace (e.g. –search-replace=”from,to”). |
-v , --version |
Retrieve the version number of VIP-CLI currently installed on the local machine. |
Examples
- Search for every instance of the value "from" in the local input file named "file.sql" and replace it with the value "to". * Results of the operation output to STDOUT by default.
$ vip search-replace file.sql --search-replace="from,to"
- Perform the search and replace operation on the local input file "file.sql" and overwrite the file with the results.
$ vip search-replace file.sql --search-replace="from,to" --in-place
- Perform the search and replace operation and save the results to a local clone of the input file named "output-file.sql".
$ vip search-replace file.sql --search-replace="from,to" --output=output-file.sql
Last updated: February 19, 2025