This is a discussion on Help within the Shell scripting forums, part of the Development/Scripting category; Is it possible to find a file I have written in Open office wordprocessor+ I have Mandrake Linux 10.0 The ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
| Sponsored Links | ||
|
|
|
|||
|
i opened my word processor and created a file tt. on saving it by default it came with a .abw extension.
then i used Code:
find / -name tt* -type f -name then i changed the command to Code:
find /home -name tt* -type f -name does this help u? |
|
|||
|
Thanks everybody
It worked fine. I want to use the ' grep ' command to fine a string in one of the files written in Open Office. It worked fine on all the files I wrote using vi editor. Look at the following file. /home/ka/Documents/Cisco questions and answers.sxw I want to use the grep command to find a word like 'for' or ' of ' in the above file. Is it possible? It worked fine for the files written in vi editor. Your help is deeply appreciated. |
|
|||
|
Thanks sweta for the reply.
Even the files which has the 'html' endings could be traced by grep family of commands. Look at the following: [ka@c83-250-89-72 ka]$ fgrep title myfile1.html <title>My homepage</title> [ka@c83-250-89-72 ka]$ [ I looked for the word 'title' in a file called ' myfile.html ' .] I just want to know the problem here. Why can't it penetrate a letter written in the wordprocessor, OpenOffice? |
|
||||
|
Quote:
Long answer ... Okay let us try to understand OpenOffice file format. First it uses XML to store everything and your file divided into different files. But you always see one file called foo.sxw. This file is basically nothing but zip file containing all other .XML files. So just use unzip command to open them, for example if your file is foo.sxw: Code:
mkdir /tmp/test cp foo.sxw /tmp/test cd /tmp/test unzip foo.sxw grep -iE “text-to-search” content.xml In other words you can find what you wanna if you automate this procedure (unzip file and grep it etc) via shell or perl script you can do the job. |
|
|||
|
Quote:
it was just ur inspiration that i learnt a bit of how things happen with shell. thanx man..... |