Finding and Sorting Files

Questions about XML that are not covered by the other forums should go here.
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Finding and Sorting Files

Post by EmmaCrabtree »

Hi, I'm very new to Oxygen, so I'll looking for some guidance on a project I'm undertaking. I'm using Author 9.2

I want to search for files that have have a particular reference in them and file them elsewhere after the search. That's fine. I was told to make .bak files to show which files were relevant. Again fine. My problem occurs when I want to search the relevant files, .bak files, which Author can't do.

Is there a way of searching for files, moving them, and then searching in the moved files again which doesn't take a huge amount of time or that can be done by the program rather than me manually moving files?!

Any advice gratefully received.

Thanks,
Emma.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Finding and Sorting Files

Post by sorin_ristache »

Hello,

The Find/Replace in Files dialog can find the files with a particular reference. You open the dialog from the Find/Replace in Files icon Image located on the Search toolbar. You can create a .bak copy of each file containing the reference if you replace the reference with other string. If you want to find the reference without modifying it but you need a .bak copy of the file then you should replace the reference with the reference itself, that is the file will have the same content after the replace operation.

For moving files from the Author editor you have to define an external tool which runs a command line containing a move command.


Regards,
Sorin
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

Thanks!

Can you run a search for code that is missing?

Cheers,
Emma.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Finding and Sorting Files

Post by sorin_ristache »

Do you mean to find all the files that do not contain a search pattern? No, that is not possible with the two find/replace dialogs of Oxygen. Can you give an example just in case I do not understand your request correctly?


Regards,
Sorin
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

Hi Sorin,

I'm looking for files that only contain </filmId> rather than the full string of <filmId></filmId>

Can this be done?

Thanks,
Emma.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Finding and Sorting Files

Post by sorin_ristache »

If you want to find the files that contain the string </filmId> which is not preceded by the string <filmId> you must use the regular expression (?<!(<filmId>))</filmId> in the Text to find field of the dialog.


Regards,
Sorin
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

Thank you Sorin, I will try that.

regards,
Emma.
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

Ok, so that didn't work!!!!

What I have are 2 sets of files; one with <filmId></filmId> and the other with a 6 figure digit followed by </filmId> e.g. 123456</filmId>

The coding is wrong i.e. it ought to be <filmId>123456</filmId> so I am trying to work around this and find the files with the 6 figure digit.

Any ideas?!

Thanks,
Emma.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Finding and Sorting Files

Post by sorin_ristache »

In that case my regexp will find the file with </filmId> preceded by digits (generally preceded by a string that is not <filmId>) and will not find the file with <filmId></filmId>. Did you check the checkbox Regular expression of the Find/Replace dialog?


Regards,
Sorin
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

ah, ha! Checking the Regular Expression box is bringing up data.

Thank you! :D
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

Hi Sorrin,

I've been able to search for most of the files using the tips you gave me, but I think I am missing some (due to a previous search that brought up more files).

Should your string work to find 123456</filmId> only?

Thanks,
Emma.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Finding and Sorting Files

Post by sorin_ristache »

The regular expression (?<!(<filmId>))</filmId> finds any </filmId> that is not preceded by <filmId>.


Regards,
Sorin
EmmaCrabtree
Posts: 8
Joined: Sun Jul 06, 2008 3:24 pm

Re: Finding and Sorting Files

Post by EmmaCrabtree »

Thanks Sorin, I think I've got what I need. Your advice has been priceless.

Cheers,
Emma.
Post Reply