search and replace text strings in docx, pptx, xlsx files.
Functionality same as aspose app
- Efficient search and replace operations within DOCX files.
- Support for searching and replacing text in PPTX and XLSX files.
- Advanced search options (e.g., regular expressions, case-sensitive search).
step1:
npm i edit-office-files
step2:
import {SearchAndReplace} from 'edit-office-files';
async function main() {
const searchTexts = ['Hello World', 'are You', 'coloured'];
const replacementTexts = ['REPLACEMENT1', 'REPLACEMENT2', 'REPLACEMENT3'];
const reader = new SearchAndReplace('assets/document.docx', searchTexts, replacementTexts, 'updated.docx');
await reader.process();
}
main();