Copy just the values from Find All operation

Are you missing a feature? Request its implementation here.
eeverman
Posts: 10
Joined: Fri Feb 22, 2008 10:07 pm

Copy just the values from Find All operation

Post by eeverman »

It would be very handy to be able to copy just the values found when using the Find All tool.

Currently, copying the results of Find All from the results display tab copies all the meta data along with the results, making it impossible to get just the results.

Why would you do this? Say you have a text document with a bunch of product IDs and names in it. You want to get a list of just the names and IDs, so you do a Find All using a Regular Expressions like this:

Code: Select all

id: \d* name: .*$
I would hope get a list like this that I could copy for use somewhere:
id: 87234 widget_1
id: 78273 widget_2

Instead, if you copy and paste the results, you get something like the example below, which is pretty useless for any purpose that I can think of:
System ID: /datausgs/project_hosts/gcmrc/conf/Untitled4.sql
Description: 42 group_id,
Match: 42 group_id
Start location: 320:5
Offset: 11094
Length: 11

System ID: /datausgs/project_hosts/gcmrc/conf/Untitled4.sql
Description: 43 group_id,
Match: 43 group_id
Start location: 331:5
Offset: 11483
Length: 11
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Copy just the values from Find All operation

Post by adrian »

Hi,

The purpose of those lines of information is to pinpoint the location of the search results in the files.

We already have a feature request logged on our issue tracking tool for an action that copies the results as plain text. I've added your vote and comments.

BTW, isn't the value of "Match:" what you're looking for?
There is a workaround of sorts for copying a column from the results (via the Grid mode) here:
Copy column data from XPath results viewer?
In your case you just need the 'Match' column.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
jo3_11_5
Posts: 6
Joined: Tue Sep 11, 2012 1:39 pm

Re: Copy just the values from Find All operation

Post by jo3_11_5 »

I vote this feature request up.

What I normally do is :
  1. In Oxygen XML, select all search results.
  2. Copy.
  3. Paste into Notepad++.
  4. Open to Search > Mark dialog.
  5. Type in the search string, check Bookmark lines option and click Mark all.
  6. Go to Search > Remove Unmarked Lines.
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Copy just the values from Find All operation

Post by adrian »

I've added another vote.
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
eeverman
Posts: 10
Joined: Fri Feb 22, 2008 10:07 pm

Re: Copy just the values from Find All operation

Post by eeverman »

It *is* possible to work with the resulting xml document to find what you need, as is the suggestion above. Its quite a kludge: Basically do your search, get the results as XML, then search/process the XML to get your actual results.

As a related issue: Regex searching lets you specify groups, ie:
<h4>(.*?)</h4>

Where the text you are looking for is actually what matches in the grouping expression: (.*?)
the <h4> is just literal text that delimits the text you are looking for.

It would be nice in the display and use of the results to include just the groups (the portion in parens) or the complete match.
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Copy just the values from Find All operation

Post by adrian »

Hi,
eeverman wrote:It would be nice in the display and use of the results to include just the groups (the portion in parens) or the complete match.
I'm afraid the results simply cannot hold the regexp groups information, besides you can already use a regexp to match the text without the delimiters:

Code: Select all

(?<=<h4>)(.*?)(?=</h4>)
zero width positive lookbehind (?<=...), searched text, zero width positive lookahead (?=...)

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sorin_carbunaru
Posts: 397
Joined: Mon May 09, 2016 9:37 am

Re: Copy just the values from Find All operation

Post by sorin_carbunaru »

Hello everyone,

I just wanted to let you know that in the recently released oXygen 20, in the contextual menu of the "Results" panel, there is now an action that copies the description text of the selected items (Copy description).

Best wishes,
Sorin Carbunaru
oXygen XML
Post Reply