The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 okutil_find_strings

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ZRA Posted - 06/08/2011 : 07:11:57 AM
Origin Ver. and Service Release: 8.1 SR3
Operating System: WinXP Pro SR3

Hi,

I have a problem using "okutil_find_strings()":
I try to use this command to filter a category of imported files (briefly the filename as shown in the project explorer is generated by date_QSet_otherInformations, eg. 20110607_QSet_Repeat1ZRA). When I try to use *QSet* as search string I don't get any hits.


I also tried to copy the example from the help which returned:

#29> okutil_find_strings_Ex1
#A; match(s) to abc found:(OFS_MATCH_WHOLE_STRING)
#abc
#abc123
#D: match(s) to b* found:(* is wild)
#C: match(s) to *b* found:(* is wild)
#D: match(s) to *b* found: (OFS_WILDCHARS_OFF so * is literal)
#E: match(s) to 123 found: (no condition...match anything)
#123abc
#F: match(s) to 123 found: (OFS_MATCH_START_STRING)
#123abc

I think the function ignores any wild characters or interprets them as them-self, independent of the option used.
Could anybody help me please?

Many thanks in advance,
Juergen
4   L A T E S T    R E P L I E S    (Newest First)
ZRA Posted - 06/10/2011 : 01:48:06 AM
Thank you for your help. The function works fine for me.
eparent Posted - 06/09/2011 : 09:02:55 AM
The following function will work for you even though it does not have all the options as okutil_find_strings.


int find_strings(StringArray& saFound, StringArray& saSearch, LPCSTR lpszFindThis, bool bCaseSensitive)
{
	saFound.SetSize(0);
	for (int i = 0; i < saSearch.GetSize(); ++i)
	{
		if (saSearch[i].Match(lpszFindThis, bCaseSensitive))
			saFound.Add(saSearch[i]);
	}
	return saFound.GetSize();
}

void test_find_strings()
{
	StringArray saSearch;
	saSearch.Add("20110605_QSet_Repeat1ZRA");
	saSearch.Add("20110716_QSet_Blue1YRB");
	saSearch.Add("20110716_RSet_Blue1YRB");        
	saSearch.Add("20110830_QSet_Green2XRC");
	saSearch.Add("20110716_TSet_Blue1YRB");
	saSearch.Add("20110917_QSet_Red3XRD");
	
	StringArray saFound;
	int nFound = find_strings(saFound, saSearch, "*QSet*", false);
	printf("Found %d matches:\n", nFound);
	for (int i = 0; i < saFound.GetSize(); ++i)
		printf("%d  %s\n", i, saFound[i]);
}
ZRA Posted - 06/09/2011 : 02:29:15 AM
Thank you for your reply,

Do you have any idea, how I could avoid using this broken function for the filtering? The problem is that it should be possible to import different files with a similar name scheme (each sample type with an own key-word, such as QSet) and to import a adjustable number of files which will be processed afterwards according to the naming.

Kind regards,
Juergen
eparent Posted - 06/08/2011 : 5:11:33 PM
Hello,

The okutil_find_strings function is broken. It appears none of the options are implemented. All comparisons seem to be case insensitive and forced to match the beginning of the strings. I have submitted a bug report for this.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000