Re: Searching Text Files

Subject: Re: Searching Text Files
From: "Samuel Wright" <lykoszine -at- gmail -dot- com>
To: "Dossy Shiobara" <dossy -at- panoptic -dot- com>
Date: Tue, 23 Sep 2008 15:50:03 +0100

If you use grep instead of sed, you can use the -o option to print
only the pattern, not the line...

S

On Tue, Sep 23, 2008 at 3:46 PM, Dossy Shiobara <dossy -at- panoptic -dot- com> wrote:
> Ed wrote:
>> The combination of find and grep looks most promising. I started with
>> Dossy's snippet and modified to:
>>
>> find . -name \*.xml -exec grep "<acroterm>"[A-Za-z0-9]*"</acroterm>"
>> "{}" \; > test1.txt
>>
>> That produces a text file with all lines that contain acroterm tags.
>> The next step will require deleting all of the text on each line
>> EXCEPT what is between those two tags.
>
> find . -name \*.xml \
> -exec grep "<acroterm>.*</acroterm>" "{}" \; \
> | sed -e 's#^.*<acroterm>(.*)</acroterm>.*$#\1#' \
> > test1.txt
>
> --
> Dossy Shiobara | dossy -at- panoptic -dot- com | http://dossy.org/
> Panoptic Computer Network | http://panoptic.com/
> "He realized the fastest way to change is to laugh at your own
> folly -- then you can let go and quickly move on." (p. 70)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> ComponentOne Doc-To-Help gives you everything you need to author and
> publish quality Help, Web, and print content. Perfect for technical
> authors, developers, and policy writers. Download a FREE trial.
> http://www.componentone.com/DocToHelp/
>
> True single source, conditional content, PDF export, modular help.
> Help & Manual is the most powerful authoring tool for technical
> documentation. Boost your productivity! http://www.helpandmanual.com
>
> ---
> You are currently subscribed to TECHWR-L as lykoszine -at- gmail -dot- com -dot-
>
> To unsubscribe send a blank email to
> techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
> or visit http://lists.techwr-l.com/mailman/options/techwr-l/lykoszine%40gmail.com
>
>
> To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com
>
> Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
> http://www.techwr-l.com/ for more resources and info.
>
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ComponentOne Doc-To-Help gives you everything you need to author and
publish quality Help, Web, and print content. Perfect for technical
authors, developers, and policy writers. Download a FREE trial.
http://www.componentone.com/DocToHelp/

True single source, conditional content, PDF export, modular help.
Help & Manual is the most powerful authoring tool for technical
documentation. Boost your productivity! http://www.helpandmanual.com

---
You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
or visit http://lists.techwr-l.com/mailman/options/techwr-l/archive%40web.techwr-l.com


To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com

Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
http://www.techwr-l.com/ for more resources and info.


References:
Searching Text Files: From: Ed
Re: Searching Text Files: From: Ed
Re: Searching Text Files: From: Dossy Shiobara

Previous by Author: Re: "usable" screen captures
Next by Author: Re: Website Documentation Procedures - Educating an Employer
Previous by Thread: Re: Searching Text Files
Next by Thread: How do you conduct live software training workshops properly


What this post helpful? Share it with friends and colleagues:


Sponsored Ads