Can I use Grep on a Wave (as opposed to a file)?

Hi,

I am trying to use the grep function to extract data points with a specific expression. This is my grep line:

Function IndexingCALIc()
Grep/INDX/Q/E="T1" wavename

However, igor is not letting me compile this. I think I need to fix the part where I put wavename but I am unsure of how to do so.
You need to provide the compile error Igor is giving you. If you use a wave as the source for Grep, it must be a text wave. So if your wavename isn't a text wave, that might be the problem. But until you provide more information, we can only guess.
Without seeing all of your code, I'm guessing you have the name of a wave in a string? Or you haven't created a WAVE reference?

Perhaps try this:
Function IndexingCALIc()
WAVE/T tw=$waveNameInString
Grep/INDX/Q/E="T1" tw


--Jim Prouty
Software Engineer, WaveMetrics, Inc.
I can compile the code now (I just changed the grep line to be below the wave reference. Initially it was before the wave reference). However, when I try to execute the code in the command line, I get this error message:

Grep Error:
expected ';' or

Is there a way I can fix this error?
cmm557 wrote:
I can compile the code now (I just changed the grep line to be below the wave reference. Initially it was before the wave reference). However, when I try to execute the code in the command line, I get this error message:

Grep Error:
expected ';' or

Is there a way I can fix this error?


Not unless you show us the entire function and what you're executing on the command line.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.