How to match strings
Hi,
I have three strings: WER4580U, NID8959T, FTK4797K in one column of my microsoft access database and three numbers:IO-23,DD-98,IL-33 in another column respectively.
My program is that if i key in WER4580U in my front panel, it will go and match the strings and give out IO-23.
I can get upto this stage.
What i want to do is that
If the no. of matches of the string is greater than 4, it will match and give out the results.
If the no. of matches of the string is less than 4, it will go to another strings and match again until the no. of matches become less than 4 and give out the results.
for eg. the strings save inside my database is WFR4B8?U, and the one i key in is WER4580U, it will still match and give out the result IO-23.
for eg. the strings save inside my database are WFR4B8?U and NLB895?T and , and the one i key in is NID8959T, it will go and match with WFR4B8?U first and no. of matches is less than 4 so go and match again with NLB895?T and now no. of matches is greater than 4, so give out the result of DD-98.
I am quite new to labview so i don't know how to write such a simple program.
If someone can help that will be great .
Thanks for your help .
But my matching part is something like this.. my program only works when all the characters are the same..
I don't know how to add no. of matches part in it and give out the result if the no. of matches is greater than 4.
Attachments:
matching.vi 14 KB
Similar Messages
-
How to match up similar strings?
Hello all,
I have two tables that have supplier names in them. Some names are similar, but not perfect, so I can't do a name = name command. Here is the code that will help you understand what I'm asking about.
create table abc (supp_cd varchar2(50),
supp_nm varchar2(50));
create table xyz (supp_cd varchar2(50),
supp_nm varchar2(50));
insert into abc values ('12345', 'KROGER');
insert into abc values ('23456', 'WALMART');
insert into abc values ('34567', 'KMART');
insert into abc values ('45678', 'BEST BUY');
insert into xyz values ('12345', 'KROGER INC');
insert into xyz values ('23456', 'THE WALMART CO');
insert into xyz values ('34567', 'KMART');
insert into xyz values ('45678', 'BST BUY');
select abc.supp_cd as abc_supp_cd, abc.supp_nm as abc_supp_nm, xyz.supp_cd as xyz_supp_cd, xyz.supp_nm as xyz_supp_nm
from abc join xyz on abc.supp_cd = xyz.supp_cd
where abc.supp_nm like xyz.supp_nm;Right now, my code is giving me only:
ABC_SUPP_CD |ABC_SUPP_NM |XYZ_SUPP_CD |XYZ_SUPP_NM |
34567 |KMART |34567 |KMART |When I want:
ABC_SUPP_CD |ABC_SUPP_NM |XYZ_SUPP_CD |XYZ_SUPP_NM |
12345 |KROGER |12345 |KROGER INC |
23456 |WALMART |23456 |THE WALMART CO |
34567 |KMART |34567 |KMART |
45678 |BEST BUY |45678 |BST BUY |I'm not even sure if this is possible, but can someone steer me in the right direction to get similar names that match up?
Thanks ahead of time guys.
PS. I'm running Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionHi,
For a similar problem, I wrote once a function that returned a number between 0 and 100, reflecting how much 2 strings had in common (100 meant the strings were identical, 0 meant they didn't seem similar at all). Given such a function, you can match rows where the anmes were similar like this:
FROM abc
JOIN xyz ON abc.supp_cd = xyz.supp_cd
AND nm_similiar (abc.supp_nm, xyz.supp_nm) >= 70The nm_similar function would start by standardizing the 2 given names, e.g. converting to all capital letters, removing punctuation, and removing words such as 'THE' that you want to ignore. You may not want to ignore words like 'CO', but you probably do want to standardize them, so that 'COMP', 'CMPNY', 'CPY' and 'COMPANY' all turn into 'CO'. I made a separate function for standardization. I also corrected some common mispellings in the standardizaion function. For example, one company was actually named 'HUSQVARNA', but, more often than not, people added a 'U' right after the 'Q'.
Once you've got the names standardized, you can use functions from utl_match to see how similr they are. -
How to match a fingerprint template from database ?
i now can save a fingerprint template from database using this code..
Dim fingerprintData As MemoryStream = New MemoryStream
Template.Serialize(fingerprintData)
fingerprintData.Position = 0
Dim br As BinaryReader = New BinaryReader(fingerprintData)
Dim bytes() As Byte = br.ReadBytes(CType(fingerprintData.Length, Int32))
Dim cmd As SqlCommand = New SqlCommand("INSERT INTO fininger_table VALUES(@FIRSTNAME, @LASTNAME, @FINGERPRINT)", conn)
cmd.Parameters.Add("FIRSTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxFname.Text
cmd.Parameters.Add("LASTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxLname.Text
cmd.Parameters.Add("FINGERPRINT", SqlDbType.Image).Value = bytes
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
and i fetch the data when the form is load..
conn.Open()
Dim cmd As New SqlCommand("SELECT * FROM Fininger_table", conn)
Dim rdr As SqlDataReader = cmd.ExecuteReader()
Dim MemStream As IO.MemoryStream
Dim fpBytes As Byte()
While rdr.Read()
fpBytes = rdr("FINGERPRINT")
MemStream = New IO.MemoryStream(fpBytes)
Dim template As New DPFP.Template(MemStream)
OnTemplate(template)
' template.DeSerialize(MemStream)
End While
rdr.Close()
conn.Close()
and now i'm stuck..i dont know how to match the fingerprint from the database to verify the user..
plz help me out..tnx in advance
btw im using a DIGITAL PERSONA FINGERPRINT READER..with the OTW SDKHello My dear Brother
I am zaid Ahmad khan would like to help you and this is the working code please see this and you will have the solution
Imports System.Data.SqlClient
Imports DPFP
Public Class Form1
Private WithEvents verifyControl As DPFP.Gui.Verification.VerificationControl
Private matcher As DPFP.Verification.Verification
Private matchResult As DPFP.Verification.Verification.Result
Private allReaderSerial As String = "00000000-0000-0000-0000-000000000000"
Public template As DPFP.Template
Private userTemplateColumn As String = "Template"
Private userIDColumn As String = "ID"
Dim bytes As Byte()
Private Sub CreateDPControl(ByRef control As DPFP.Gui.Verification.VerificationControl)
Try
control = New DPFP.Gui.Verification.VerificationControl()
control.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
control.Name = "verifyControl"
control.Location = New System.Drawing.Point(0, 0)
control.ReaderSerialNumber = "00000000-0000-0000-0000-000000000000"
control.Visible = True
control.Enabled = True
control.BringToFront()
Me.Controls.Add(control)
Catch ex As Exception
MessageBox.Show("exception")
End Try
End Sub
Private Function ConnectString() As String
Dim connectionString As String
connectionString = "Server=localhost;database=bs;User ID=sa;Password=123"
Return connectionString
End Function
Private Sub VerifyBiometric_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
matcher = New Verification.Verification()
matchResult = New Verification.Verification.Result
CreateDPControl(verifyControl)
End Sub
Private Sub verifyControl_OnComplete(ByVal Control As Object, ByVal FeatureSet As DPFP.FeatureSet, ByRef EventHandlerStatus As DPFP.Gui.EventHandlerStatus) Handles verifyControl.OnComplete
Dim dataSet As DataSet = New DataSet()
Dim adapter As SqlDataAdapter = New SqlDataAdapter()
Dim sqlCommand As SqlCommand = New SqlCommand()
Dim ctr = 0
Try
Dim max As Integer = 0
Dim cn As New SqlConnection(ConnectString())
cn.Open()
sqlCommand.CommandText = "Select templateBytes7 from userthumbs where id='1029'"
sqlCommand.CommandType = CommandType.Text
sqlCommand.Connection = cn
Dim lrd As SqlDataReader = sqlCommand.ExecuteReader()
Dim usr
While lrd.Read()
usr = lrd("templateBytes7")
End While
bytes = Nothing
bytes = usr
template = New DPFP.Template()
template.DeSerialize(usr)
'Perform match
matcher.Verify(FeatureSet, template, matchResult)
If matchResult.Verified Then
EventHandlerStatus = Gui.EventHandlerStatus.Success
MsgBox("Verified!")
Me.Hide()
MessageBox.Show("Done")
Else
EventHandlerStatus = Gui.EventHandlerStatus.Failure
MsgBox("Please Try Again!")
End If
Finally
End Try
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class -
How to match the wildcard *
Here I have four String type contants: "information", "inherit", "in there", "interfere". Now I want to use another String type contant with wildcard in itself "in*re" to find out all the matched string above. How can I program for that purpose? Can anyone please give me some tips to realize it?
Thank you for your advice.
I have looked through the API document and the wildcard * only represents the times of the same character in "regex", like X*: X, zero or more times. In my case, * could denote any number of any characters. Can this case still be solved through the "java.util.regex"?
Any suggestions are welcome.
Adrian -
Add as sibling with matching string
Hi All
I'm trying to build a dim build rule to load members from a reject data load file. I want to use add as sibling with matching string, but dont know what to choose as my field property - Parent\Child possibly? Haven't found it in DBAG yet.
Thanks,
TinaWhat you are asking can be accomplished using regular expressions (regexps). Take a look at the API documentation for "java.util.regex".
http://java.sun.com/j2se/1.4.1/docs/api/java/util/regex/package-summary.html
Also this article includes some nice samples and more details of how to use regexps in Java. It's well worth a read if you are just getting started with Java regexps.
http://developer.java.sun.com/developer/technicalArticles/releases/1.4regex/
Good luck!! -
Match String + Hex-dec converter
Hi, this is my Labview program that I got so far. Basically its a program to take pH level input from a glass probe and i try to make it to display in a nice graphical way. The input that I receive from XCTU is 32 bit hex values.
What I'm missing right now is 2 things:
1st: The data is a stream of repeating hex numbers. I would like to know how to match the pattern to get a sample of it. I tried the match pattern code but it gives an error message say cant match a 1-D array of string from Source to a string type sink.
2nd: I want to convert the hex values into decimal, also tried the converter but I cant display the decimal values on Text rings. Error message says cant take a 1-D array unsigned long from sourse into a 1-D array sink.
Attached is my program.
Attachments:
Serial Communication.vi 11 KBTwo points for you
Concatenate string will convert a 1D array of strings to a single string. Nice time saver.
Once you have an integer you have an integer- the numeric display properties control HOW it is displayed. select the indicator, Right-click Show>Radix and select Decimal or Hex. ALL integers pass BINARY data inside the wire and only objects in the UI thread know anything else about how the programmer views the values
Jeff -
How to get string value from xml in JSF??
In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF
Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization. -
How to delete string or line from unix file(dataset) of application server
Hi All,
After transfer workarea information or all records into dataset(unix file). When I see the file in application server automatically the last line is shown a blank line. I am not passing any blank line.
I have tried for single record than also the file generates the last line(2nd line) also a blank line.
When I m reading the dataset, it is not reading the last blank line but why it is showing the last blank line?
How to delete string or line from unix file(dataset) of application server?
Please give your comments to resolve this.
Thanks
Tirumula Rao ChinniHi Rio,
I faced similar kind of issue working with files on UNIX platform.
The line is a line feed to remove it use
DATA : lv_carr_linefd TYPE abap_cr_lf VALUE cl_abap_char_utilities=>cr_lf.
DATA : lv_carr_return TYPE char1,
lv_line_feed TYPE char1.
lv_line_feed = lv_carr_linefd(1).
lv_carr_return = lv_carr_linefd+1(1).
Note: IMP: The character in ' ' is not space but is a special
character set by pressing ALT and +255 simultaneosly
REPLACE ALL OCCURRENCES OF lv_line_feed IN l_string WITH ' '.
REPLACE ALL OCCURRENCES OF lv_carr_return IN l_string WITH ' '. -
How to match BSIM with MSEG (match FI entries to MM entries)
Hello,
I have to make a custom report calculating opening, closing stock - its value and quantities (with respect to begin and end date) however taking into consideration only certain movement types. I need to neglect those entries from BSIM which have other movement types than the ones specified as a parameter but there is no BWART field in BSIM.
How can I match FI document entries(BSIM / BSEG) to MM document entries(MSEG) ?
Thanks.Assuming its true ( 1MM doc = 1FI doc ), the question is how to match FI document item with MM document item ?
is it a rule that entries in fi docs are in the same order as entries in mm doc?
therefore a formula (MM_entry * 2) = FI_entry would work but I'm kinda sceptical to assume that
Edited by: Bartosz Bijak on Jan 18, 2010 1:31 PM -
How to convert string to an integer in SQL Server 2008
Hi All,
How to convert string to an integer in sql server,
Input : string str="1,2,3,5"
Output would be : 1,2,3,5
Thanks in advance.
Regards,
SunilNo, you cannot convert to INT and get 1,2,3 BUT you can get
1
2
3
Is it ok?
CREATE FUNCTION [dbo].[SplitString]
@str VARCHAR(MAX)
RETURNS @ret TABLE (token VARCHAR(MAX))
AS
BEGIN
DECLARE @x XML
SET @x = '<t>' + REPLACE(@str, ',', '</t><t>') + '</t>'
INSERT INTO @ret
SELECT x.i.value('.', 'VARCHAR(MAX)') AS token
FROM @x.nodes('//t') x(i)
RETURN
END
----Usage
SELECT * FROM SplitString ('1,2,3')
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to display string with XML content in 4.6?
Hi,
I`d like to know how to display string with XML content in it for 4.6.
4.6 has not method parse_string.
And example like this is not helpful:
DATA: lo_mxml TYPE REF TO cl_xml_document.
CREATE OBJECT lo_mxml.
CALL METHOD lo_mxml->parse_string
EXPORTING
stream = gv_xml_string.
CALL METHOD lo_mxml->display.
Thank you.Hi,
May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.
a® -
How to match invoice with credit together
I am new to this forum. In EnterpriseOne Accounts Payable function, is it possible to bring up both invoice and credit memo, to match the net quantity in the receipt?
For example, invoice charges 5 pcs, then credits back -2 pcs, the receipt has the net 3 pcs.
How do I bring up both invoice and credit to show the net charge of 3pcs, to match the receipt of 3?
Thanks!Pls refer note: How Are Match Basis and PO Line Type Related for Invoice Matching? [ID 428303.1]
regards, -
How to get string from jtextpane along with its attributes
sir,
How to get string from jtextpane along with its attributes
i,e font,size,style,color etc.
please help me out.
my mail id is [email protected]JTextPane extends JTextComponent
JTextComponent.getDocument()
a Document is a set of Element, see Document.getRootElements(). Each Element has attributes, stored within an AttributSet object see Element.getAttributes()
a Document can also be rendered as a String, see Document.getText( offest, length ), use it with 0 and Document.getLength() as parameters. -
HI
I have finished goods material, where my mm side stock value say rs 50,000 (in mb5b),
how to compare the FI side values?? in whch tcode?
i couldn't get the exact values in mb5l ... where to check ?? and how to match mm and fi to have similar valueHi,
The variance due to
-You have entered postings to the stock account manually.
-The stock account includes not only stock postings, but also other postings. In this case, you should check the account determination in the Customizing for Valuation and Account Assignment. Make sure that the stock accounts are used solely for the transaction key BSX (stock postings).Check Account Determination
-The account assignment for the stock accounts (transaction key BSX) was changed .
Common selection parameters to execute MB5L transaction are
-Company Code
-Valuation Area( if your company code have different valaution area that depents on the way you want to get the output)
-Period ( 3 options you have current period, previous period and previous year)
-Below that you have different output options to select
Then execute (F8)
The list with overview of stock by account with MM value and FI value. The values of MM and FI must be the same.
For a good practise don not post any adjustment accounts to the stock accounts.
Regards,
Krishna Kishore -
How to search string in BSP Application?
Hi,
Report RS_ABAP_SOURCE_SCAN is to search string in ABAP. How to search string in BSP Application?
In standard BSP Application is calling another BSP application and this hard coded in application.
Regards,
...NaddyHello Naddy,
7 Years later and it seems there is still no possible way to search a string in a BSP application.
Using Report BSP_EXPORT_CLASSES (Uncheck list of packages, provide BSP application name) I was able to download the complete BSP application to my desktop computer; after that I used TotalCommander (free edition) to scan the files for the string. (Mode set to UTF8)
Ugly workaround but it works.
Regards
Maybe you are looking for
-
I can´t install windows 8.1 because boot camp can't partition the disk. I´ve follow many tips but they did´t work (backup, reinstall os, erase space, etc.) Macbook pro retina os x yosemite 10.10.2 Thanks
-
Use of internal table with hearerline in ABAP OO
Hi, I have a very basic question regarding the use of Internal table with headerline in ABAP OO. I consider the concept of Internal table with header as one of the most features of ABAP, which is not there in any of the other porgramming languages. I
-
Adding 1 to a letter/character
Hi everyone, I have a program where I need to find the next available wage type to use per category. Some wage types, however, are alphanumeric (E.G '0SBC') In the above example, the next available to use could be 'OSBD' My question is, how do you ad
-
Error when publishing a catalog
Hello Experts We are on SRM 4.0 EC and using CCM2 When Publishing the catalog we get the following error message Catalog item 4462E4E0CE721B3DE10000000A70D7C7 not found Catalog update was terminated The exception occurred (program: /CCM/CL_PE_R
-
trying copy on envy 120 comes out black print...have ink...preview does not show up on screen..