Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Matching query

Status
Not open for further replies.

countyweb

Technical User
Nov 7, 2005
13
GB
Hello everybody,
I need to match a massive text file with another text file on two columns.
I've added a 'matched' column to the massive text file and I want to make it '1' when I have a match.

I need to do a match on the first 5 characters of one column and the whole of another with the spaces trimmed off.

Could anyone help?

I'm new to sql and lost.
thanks
 
Well....what I would do would be to first import the text files to a database to run sql against, and export the results when done. Otherwise, you will need to use an application which can use an ODBC-text driver and send sql statements against the files. All you really need to do is a simple UPDATE MassiveFile SET Matched = 1 WHERE EXISTS (SELECT Something FROM OtherFile WHERE SUBSTRING(MassiveFile.Something, 1,5) = OtherFile.Something etc.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top