Inconsistent results in simple script
JOHN PATTEN
johnpatten at me.com
Wed Nov 16 15:13:05 EST 2016
Hi All,
I have two, two column lists. Each list has the same barcode item (item 1). The second item in the first list is a username, and the second item in the second list is a serial number. I am trying to combine the username and serial number into one list. I have about 1000 lines in each list. However, I have cut my username list down to about 30. My script is leaving out username/serial number combinations that are common in each list. I am not sure why?
For example:
List 1
12345,johndoe
11234,maryjane
12234,stevesmith
List 2
12345,SDTKNY12345
12234,SDTKLL54RR2
11234,SDKTHYUPTO9
I’m sure there are more elegant ways to do this, but here is my script:
on mouseUp
lock screen
put cd fld "csv1" into tcsv1
repeat for number of lines in tcsv1
put line 1 of tcsv1 into tStudentInfo
put item 1 of tStudentInfo into tbarcode
put the number of chars of tBarcode into tCharCount
-- if tCharCount > 5 then
-- delete char 1 of tbarcode
-- end if
put cd fld "csv2" into tcsv2
find tBarcode in cd fld "csv2"
if the result is empty then
put the foundLine into tLine
select tLine
--put the selectedText of tcsv2 into tdeviceInfo
put the selectedText of cd fld "csv2" into tDeviceInfo
delete char 1 of item 2 of tDeviceInfo
put item 2 of tStudentInfo & "," & item 2 of tDeviceInfo & return after tUploadFile
else
end if
put empty into tStudentInfo
put empty into tbarcode
put empty into tCharCount
put empty into tLine
put empty into tDeviceInfo
delete line 1 of tcsv1
end repeat
put tUploadFile into cd fld "Upload File"
unlock screen
end mouseUp
Any suggestions would be helpful.
Thank you!
John Patten
SUSD
More information about the use-livecode
mailing list