Compare and search array
Hallo
I have to compare a input data and the ideal data. so far i have understood how to do comparision but the problem create when ideal array have same element with different respective value , similarly input dat are appears to be also same but while doing search in final output array in 3 column looks different than as it should be.
hope you understand my problem
thanking you
BR
kalu
Solved!
Go to Solution.
Attachments:
array%20(modified)[1].vi 17 KB
Hi Kalu,
Check the attached VI. Let me know if it helps.
Regards,
Nitz
(Give Kudos to Good Answers, Mark it as a Solution if your Problem is Solved)
Attachments:
array (modified)[1].vi 17 KB
Similar Messages
-
How to read ,compare and search unicode in we8mswin1252 ?
HI,
I having face a trouble while reading and search Unicode for my project module and its totally dependent on Unicode data for displaying and retrieve operation in oracle 11g sql develop.
code is as following in ORACLE 11G SQL DEVELOPER
FLOW IS ....
1. Procedure
create or replace PROCEDURE VR_CRONICA_CHECKDUPLICATE
iv_UFirstName in nvarchar2 DEFAULT NULL, --Added for Unicode 31-DEc-2014 Jimmy
iv_UMiddleName in nvarchar2 DEFAULT NULL, --Added for Unicode 31-DEc-2014 Jimmy
iv_ULastName in nvarchar2 DEFAULT NULL, --Added for Unicode 31-DEc-2014 Jimmy
v_StatusID OUT NUMBER,
v_Per_ID OUT NUMBER,
v_Version OUT NUMBER,
pResult out TYPES.cursortype
AS
cur_hdl int;
--cur_hdl_TotalRecs int;
strSQL VARCHAR2(32767);
strSQLWhere VARCHAR2(4000);
v_UFirstName nvarchar2(50) := iv_UFirstName;
p_UMiddleName nvarchar2(50) := iv_UMiddleName;
p_ULastName nvarchar2(50) := iv_ULastName;
p_UFirstName nvarchar2(255) :=v_UFirstName;
iv_Per_ID NUMBER(10,0);
iv_Version NUMBER(10,0);
BEGIN
DBMS_OUTPUT.PUT('VR_PersonRecord_CheckDuplicate' );
begin
cur_hdl := dbms_sql.open_cursor;
--cur_hdl_TotalRecs:=dbms_sql.open_cursor;
strSQL := ' ';
strSQL := strSQL || '
SELECT
CAST(PER_ID AS number(8,0)) AS PER_ID,
CAST(Version AS number(8,0)) AS Version,
INTO
iv_Per_ID,
iv_Version
FROM
VitalRecords_Search_CurrentDoc WHERE' ;
IF p_ULastName is not null THEN
BEGIN
strSQLWhere := ' trim(UPPER (U_LASTNAME)) = TRIM(UPPER(:p_ULastName ))';
END;
END IF;
IF p_UFirstName is not null THEN
strSQLWhere := strSQLWhere || '
AND TRIM(UPPER (U_FIRSTNAME)) = TRIM(UPPER(:p_UFirstName|))';
END if;
IF p_UMiddleName IS NOT NULL THEN
BEGIN
strSQLWhere := strSQLWhere || '
AND TRIM(UPPER (U_MIDDLENAME)) = TRIM(UPPER(:p_UMiddleName))';
end ;
end if ;
v_Per_ID := iv_Per_ID;
exception
when no_data_found then
begin
v_Per_ID:=0;
v_Version:=0;
v_StatusID := 0 ;
end;
end;
--IF pResult%ISOPEN THEN
--CLOSE pResult;
--END IF ;
open pResult for
select PER_ID ,
Version ,
U_FIRSTNAME ,
U_MIDDLENAME ,
U_LASTNAME
from table(readDWSeachPersons1(cur_hdl));
END;
.Function
create or replace FUNCTION READDWSEACHPERSONS1
(cur_hdl int)
RETURN
DWSeachPersonsTypeTableType1
PIPELINED IS
PER_ID NUMBER(10);
Version NUMBER(10);
U_FIRSTNAME NVARCHAR2(500) ;
U_MIDDLENAME NVARCHAR2(500) ;
U_LASTNAME NVARCHAR2(500) ;
BEGIN
dbms_sql.define_column(cur_hdl, 1, PER_ID);
dbms_sql.define_column(cur_hdl, 2, Version);
dbms_sql.define_column(cur_hdl, 3, U_FIRSTNAME ,500);
dbms_sql.define_column(cur_hdl, 4, U_MIDDLENAME ,500);
dbms_sql.define_column(cur_hdl, 5, U_LASTNAME ,500);
LOOP
-- fetch a row
IF dbms_sql.fetch_rows(cur_hdl) > 0 then
-- fetch columns from the row
dbms_sql.column_value(cur_hdl, 1, PER_ID);
dbms_sql.column_value(cur_hdl, 2, Version);
dbms_sql.column_value(cur_hdl, 3, U_FIRSTNAME );
dbms_sql.column_value(cur_hdl, 4, U_MIDDLENAME );
dbms_sql.column_value(cur_hdl, 5, U_LASTNAME );
PIPE ROW (DWSeachPersonsType1(PER_ID,Version,U_FIRSTNAME,U_MIDDLENAME,U_LASTNAME));
ELSE
EXIT;
END IF;
END LOOP;
RETURN;
END;
3. Type
create or replace TYPE DWSeachPersonsType1 AS OBJECT
PER_ID NUMBER(10),
Version NUMBER(10),
U_FIRSTNAME NVARCHAR2(500) ,
U_MIDDLENAME NVARCHAR2(500) ,
U_LASTNAME NVARCHAR2(500)
4. TYPE
create or replace TYPE DWSeachPersonsTypeTableType1 AS TABLE OF DWSeachPersonsType1;
error is coming like :
ORA-01003: no statement parsed ORA-06512: at "SYS.DBMS_SQL", line 1450 ORA-06512: at "A0_SJFRM_9AUG_JAYESHB.READDWSEACHPERSONS1", line 16
so,friends let me sugges solution regarding asap..its very urgent ..Hi
because you have such a hurry, you have done bad design i think Why separating responsibilities of executing SQL in table function that way?
You cannot have any advantage from separation because it is not general code. SQL is created here and there is function that defines columns to that SQL.
Developer has no clue what it is executing until searching code for that cursor parameter. That SQL concatenation sucks also.
That code is not easy to maintain or test or comprehend quickly or at all
At least to me that is a big mess.
Suggest that you do that simplest logic as possible and add that missing parse there. -
Comparing and grouping Array Values
Hello, I am relatively new to LabVIEW. I am currently analysing areas of individual particles using particle analyses. I am then outputting the results into a 1D array and sorting the array in ascending order. The size of the array changes depending on the image being analysed. What I want to do is search the array and group values which are similar and within a tolerance of say +/- 0.2. The number of groups need to be able to change automatically depending on the image being analysed. Is there an easy way of doing this task? Help would be greatly appreciated.
RobHi Mike,
Thank you for your reply.
How can I sort the values into the correct group? I have attached my code.
Many Thanks
Rob
Attachments:
labVIEW Pic.doc 84 KB -
XML data repository and Search
I am looking for a tool/technology to stored huge number of XML documents probably as BLOBS and search on them using XPath/XQL
Is Oracle right technology for it? I heard about Intermedia. Is it a product from Oracle suite which does that.
Could you please point me to right direction where I can get some more information and some sample code.
Thanks<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
Vitthal,
Oracle8i Release 2 and beyond support Intermedia Text searching with automatic support for XML document searching using hierarchical searches.
The syntax to phrase the queries is presently
designed after the SQL99 Multimedia facilities and uses a CONTAINS() predicate with a query syntax that is not syntactically XPath, but which can accomplish many of the most useful kinds
of path queries that XPath lets you do over
large numbers of documents very fast.
For example, an XPath query like:
contains(/Resume/JobSkill,'Java')
would be:
CONTAINS( clob_col_with_xml_doc,
'Java WITHIN JobSkill WITHIN Resume')
Chapter 13 of "Building Oracle XML Applications" covers searching XML documentst with Intermedia Text, its query syntax, its index setup, and compares and contrasts its functionality with equivalent XPath syntax to achieve the most common types of queries you'll want to do.
We also have online documentation on Intermedia hosted here on the OTN site, but the documentation is more general and focuses on all of the intermedia text facilities.
Hope this helps.<HR></BLOCKQUOTE>
null -
NEED HELP about file handling and searching
Hi guys !!!!!!!!!!!!!!
A) I need a help from u i wrote this programme to read from the file and assign the lines for the string array.
import java.io.*;
public class ReadFile{
public static void main(String[] args){
int i;
BufferedReader file;
String line() = null;
String fileName = "xx.txt";
try {
file = new BufferedReader(new FileReader(fileName));
for(i=1;i<=10;i++){
line(i)= file.readLine();
System.out.println(line(i));
file.close();
} catch (FileNotFoundException e) {
System.out.println("File: " + fileName + " not found.");
} catch(IOException e) {
System.out.println("Error reading data from file: " + fileName);
the thing is it is compiling but when interpritting it gives the error
Exception in thread "main" java.lang.NullPointerException in line(i)= file.readLine();
plese help me on this and
B) i want to know how to search the string array to find 4 letter words.
i'm taking the each element which is line(i) one at a time and search it.
Plese help me on these issues !!!!!!!!!!!!!!!!!!!!!You try to create an array with line(i) (as far as i see) but you dont need to keep each line in memory. As far as i understand you just need to process lines sequentially.. (Null pointer exception is thrown because you did not create your array properly!)
Look at this code:
http://www.java-tips.org/java-se-tips/java.io/reading-text-from-a-file.html
You just need to define process method in that code. (and of course try to understand). So as far as i see, you will check for 4-letter words inside process method!
For detecting 4-character word, you need to extract the words in the line using StringTokenizer:
http://www.java-tips.org/java-se-tips/java.util/how-to-use-stringtokenizer.html
Then you can just just use length() method of String class:
http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html
And if you need more advanced logic for processing the lines(currently seems to be the length of strings), you may try regular expressions:
http://java.sun.com/docs/books/tutorial/essential/regex/index.html
http://www.java-tips.org/java-se-tips/java.util.regex/ -
How to compare the same array?
Hello,
The question not how to compare arrays.
I have a method that gives results of an array type int.
for(......){
int [] arrayFunc(int [] input)
return arrayOut;
}I want to compare those arrayOut arrays. I need to find a way to save the first output and then compare it with the newest output. Where do I have to put the temp array to temporary save the array? What should happen if I want to keep track of the results and get comparisons of first, second, third output?
ThanksStill not 100% sure but I try and help. What you need to do is have two references. After you have generated a result compare it to the last result. After the comparison you need to assign the current result to the last result and then go around the loop again to generate a new current result. Below is some code that uses plain ints but I hope it illustrates what I am trying to explain.
import java.util.Scanner;
class ComparingNumbers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int current;
System.out.print("Number: ");
int last = scanner.nextInt();
scanner.nextLine();
for(int index = 0; index < 10; index++) {
System.out.print("Number: ");
current = scanner.nextInt();
scanner.nextLine();
System.out.println("Difference is " + Math.abs(current - last));
last = current;
} -
Need to put a logic in FDM where by accounts and ICP is compared and accord
Hello ,
Need to put a logic in FDM where by accounts and ICP is compared and accordingly ICP field is modified. Need to create an array of accounts
Scenario:
ICP needs to be derived based on account code. If account code is part of a predetermined list then further logic needs to be executed.
For ex. If Acc is part of the account list ("7880","7881","7882","7883","7340","7341",
"7342","7343","7345","7347","7346","8460","8603","8484","8610","8611","8612","8614")
then if ICP <> 00000 then ICP = strfield
else if Acc not part of list then ICP = "00000".
We are facing issues in defining and referencing an array in FDM which would store the list of accounts code which can then be compared along with ICP. The other logic is as follows
If strField <> "00000" And Val = Acc_Arr(i) Then
T3 = strfield
End If
If strField = "00000" And Val = Acc_Arr(i) Then
T3 = "ICPENT"
End If
If strField <> "00000" And Val <> Acc_Arr(i) Then
T3 = "00000"
End If
If strField = "00000" And Val <> Acc_Arr(i) Then
T3 = "00000"
End If
Regards,Hi,
Two options:
1. You can evaluate ICP based on either source account or target account. Use varValues(13) for source account and varValues(14) for target account in the conditional mapping statement for ICP.
2. A faster performing option is to concatenate the Account and ICP into a single code, which you then import in the ICP dimentsion. You can then use simple mapping rules to do your ICP mappings and avoid conditional statements altogether.
Regards,
Vlado -
Search Array with multiple values
Hello,
I've been helped with the prototype below by blemmo (thanks).
It allows me to search my array using one property == a
value.
Now, I'd like to use it to:
if ((prop1 == val1) &&(prop2 == val2) &&
(prop3 == val3) {
// search array for all values in array with the values of
val1, val2 and val3
Also, a way to search if one of the prop and val's are blank,
ie...
((prop1 == val1) &&(prop2 == val2) && (prop3
== val3)
where prop2 and val2 are "undefined"
so the search will only search for the prop and val that are
not "undefined"
make since? Don't know where to start.
help and thanks in advance.it is an array like this.. but with more properties... also,
is it better to use XML to load large arrays or is it ok to use
actionscript in the file.
which is faster to load? say if I had an array of 150
elements?
myArray = [{myname:"bob", county:"skagit", city:"Sedro
Woolley", id:1,
pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"},
{myname:"bob", county:"skagit", city:"Sedro Woolley", id:1,
pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg" -
I have an array in a column that I extracted from a data file. I want
to search the array for particular values and return the index which
is easily implemented by the search 1d array subvi. However, when I
input the values to search, it returns a -1 for some values and others
it finds fine where I know all the values exist. To be more precise,
my array is about 80 values between -2 and 2 in steps of 0.05. When I
search for -2, -1.5, -1, etc., I get the correct index. When I search
for other numbers like -1.8, -1.7, -1.85, etc., I get a return value
of -1. It is really strange and I am not sure of the problem. Anyone
have any ideas? Does it have anything to do with the precision or how
I read the spreadsheet file to extract the column?
T
hanks
HeatherThanks for all your help. I ended up converting both the search array
and the search element to strings with 2 decimal point precision and
it works fine.
You guys are the best.
Heather
[email protected] (H) wrote in message news:<[email protected]>...
> I have an array in a column that I extracted from a data file. I want
> to search the array for particular values and return the index which
> is easily implemented by the search 1d array subvi. However, when I
> input the values to search, it returns a -1 for some values and others
> it finds fine where I know all the values exist. To be more precise,
> my array is about 80 values between -2 and 2 in steps of 0.05. When I
> search for -2, -1.5, -1, etc., I get the correct index. When I
search
> for other numbers like -1.8, -1.7, -1.85, etc., I get a return value
> of -1. It is really strange and I am not sure of the problem. Anyone
> have any ideas? Does it have anything to do with the precision or how
> I read the spreadsheet file to extract the column?
>
> Thanks
> Heather -
Recieve a value and search for a value greater than item
is this code correct if i wanted to recieve a single argument item and search the list for a value greater than item
public boolean greaterFound(Comparable item)
int index = 0;
while (index < numItems && listItems[index].compareTo(item) != 0)
index++;
return ((index-1) < (index));
}Okay here are all the errors piece by piece.
public boolean greaterFound(Comparable item)
int index = 0;Well to start with this is not an error per se. But I would just return true if I found a match and false otherwise. There may be some who think that is terrible... I disagree.
while (index < numItems && listItems[index].compareTo(item) != 0)What is numItems?
That if is shady.
What you are checking for is flat out wrong.
index++;I'd be returning true here
return ((index-1) < (index));This is just nonsense. As it stands will always return true and invalidates the rest of your code. -
Hello all,
I have a problem regarding to search array.
It seems like he is unable to find certain elements in the 1D array I deliver.
Because it outputs -1.
I attached my vi + the file
Koen
UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
Solved!
Go to Solution.
Attachments:
Problem.vi 17 KB
test2.txt 135 KBYou can't accurately do an equals comparison with floating point numbers. It is just a limitation of floating points in gereral (all computer languages have this issue). What you should do instead is check to see if a value is in a certain range to account for this limitation.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
What is the best way to store and search 2D data
Hi,
There is a set of data (~10k records ) in 2D dimension.
like this :
Col 1, Col 2, Col3....
What is the best way to store and search those records ?
Thanks in advance
WilsonHi,
Either userObjet[][] if you know how much data you have, and the data size is fixed, or use a list of lists. E.g. A Vector of Vectors (some will probably say that you should use an ArrayList instead, and that could be the case, but it sounds like you would want to display the data later on, and a DefaultTableModel (for JTables) uses a Vector as data holder).
Kaj -
How to Print a interactive report without action button and search bar
Hello every one....
I am working on printing an interactive report. If there are 20 columns in that report i need to select some columns for printing. For this purpose i used actions button which is in the search bar of the interactive report. But i do not want to get that Actions button and search bar to get printed in the printing page. Can any one give a solution to sort out my problem
Thanks
Manoj.>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and ensure you have updated with your profile with a real handle instead of "886412".
You'll get a faster, more effective response to your questions by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB version and edition
<li>Web server architecture (EPG, OHS or APEX listener)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s)
I am working on printing an interactive report. If there are 20 columns in that report i need to select some columns for printing. For this purpose i used actions button which is in the search bar of the interactive report. But i do not want to get that Actions button and search bar to get printed in the printing page. Can any one give a solution to sort out my problemSee +{message:id=2475831}+
Always search the forum thoroughly before posting a question: 98% of questions (like this one) have been answered before. -
Question
When I am NOT private browsing Firefox will not allow me to delete or change the website address in the location bar. My only remedy is to open a new window and search in google then click the link to that site through google. When I swap to private browsing firefox allows me to anter the website address directly into the location bar - but this is a slow [prcess to swap back and forth - also by dint of using private browsing I loose my website information.Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.com/kb/Safe+Mode
*https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes -
Spotlight searching no longer working - indexing and search disabled.
I've been searching the web and tried everything:
Server 10.5.8
In Server Admin - the attached drive is a SharePoint with Spotlight search on.
I've used mdutil to enable Spotlight.
I've checked permissions.
I can search the Boot Drive. I can't search the attached drive.
mdutil returns indexing and search disabled when used to turn it on.
very frustrating.
Anyone out there have a clue?
Thanks,
MarkHI James,
Open System Preferences/Spotlight and click the Privacy tab. Where you see; Delete any locations listed, Quit System Preferences and restart your Mac and see if you can use Spotlight.
Spotlight Tips
Spotlight: How to re-index folders or volumes
Carolyn
Maybe you are looking for
-
Blue Screen on Domain controllers after Updates
After patching our Domain controllers (virtual on ESXi 5.5 U2) recently we started getting Blue screens and reboots. Other changes in our environment around this time include enabling vshield drivers and scanning with Trend Micro. I have removed patc
-
Converting problems with QT file!
I have a few Quicktime MOV files that I want to send a friend who owns a PC. The problem is - he gets audio but NO video (black screen) when he tries to play or convert these files with any of his software. I tried to convert the file on my Mac using
-
Documentation of XSLT Transformation
Hi all, Is there any documentation for the XSLT Transformation? Please. Thanks.
-
Thread cannot access the class variables.
Hi I have below code snippet : (Only section of which I have copied below) public class ProcessAppendAction extends HttpServlet implements Runnable{ public ProcessAppendAction () MI_OS_APPEND port ; protected void doGet( HttpServletReq
-
Can't install CC desktop error Analytics.dll
Hello can't install de Creative Cloud Desktop! Application Name Error : Creative Cloud.exe Version : 2.8.1.451 , time stamp : 0x543e8b4e Name of module error: Analytics.dll , Version : 2.8.0.449 , time stamp : 0x543c7dc6 Exception code: 0xc0000005 Er