Here's a small routine to simulate the issue and to show a solution.
You don't have to parse the input data -necessarily. If you have a table with all the languages you
expect to work with (ISO-639), you just have to see if the incoming record has that language.
Code:
'---------------------------------------------------------------------------------------
' Procedure : Lang
' Author : Jack
' Date : 13/04/2014
' Purpose : Procedure to simulate an incoming file with a string of langauge names
' with inconsistent formatting. Compare each incoming string to see if it contains one
' or more standard language names. If so report a standard language(s) in a standard format
'
'---------------------------------------------------------------------------------------
'
Sub Lang()
Dim has As String 'holding languages for this record
10 On Error GoTo Lang_Error
20 has = ""
Dim i As Integer 'counter
Dim j As Integer 'counter
'lng is a list of all languages involved
'
Dim lng(10) As String
30 lng(0) = "English"
40 lng(1) = "French"
50 lng(2) = "German"
60 lng(3) = "Italian"
70 lng(4) = "Dutch"
80 lng(5) = "Japanese"
90 lng(6) = "Chinese"
100 lng(7) = "Swedish"
110 lng(8) = "Spanish"
120 lng(9) = "Portugese"
130 lng(10) = "Russian"
'incoming simulates the records from the csv file
'
'You could read the csv file into a table and process it
'
Dim incoming(5) As String
140 incoming(0) = "EnglishFrench German"
150 incoming(1) = "GermanFrenchEnglish"
160 incoming(2) = "German, French, English"
170 incoming(3) = "Basic English, Spanish Dutch"
180 incoming(4) = " Italian English"
190 incoming(5) = " Italian Basic English"
'Loop through the csv data to see which languages this record uses/has
200 For j = 0 To UBound(incoming)
210 For i = 0 To UBound(lng)
220 If InStr(incoming(j), lng(i)) > 0 Then
230 has = has & lng(i) & ", "
240 End If
250 Next i
260 Debug.Print "incoming(" & j & ")" & incoming(j) & " contains ( " & Mid(has, 1, Len(has) - 2) & ") "
'
' Modify the debug.print to output to the appropriate table/record as needed
'
270 has = "" 'reset the this record has languages variable
280 Next j
290 On Error GoTo 0
300 Exit Sub
Lang_Error:
310 MsgBox "Error " & Err.number & " on line " & Erl & " (" & Err.Description & ") in procedure Lang of Module UtterAccessRelated"
End Sub
Sample output:
Code:
incoming(0)EnglishFrench German contains ( English, French, German)
incoming(1)GermanFrenchEnglish contains ( English, French, German)
incoming(2)German, French, English contains ( English, French, German)
incoming(3)Basic English, Spanish Dutch contains ( English, Dutch, Spanish)
incoming(4) Italian English contains ( English, Italian)
incoming(5) Italian Basic English contains ( English, Italian)
Hope it's helpful