Find and replace a word in docx fle by linux command

Hello All,

I need to find and replace a word in .docx file by linux command , I have searched a lot over google but did not get the solution as awk ,sed and grep utility does not work with .docx file extension .

Please help if anyone knows how to do this

Thanks in Advance

docx is compressed file, if you have doc file, then you can use catdoc command.

You can use below mentioned commands to search “abc” and replace it with “xyz” using catdoc, but o/p will be a text file.

catdoc file.doc | sed s/abc/xyz/g > file_new.txt

1 Like

Thanks for reply , but I need to find and replace with docx file and output file should be with same extension with docx .