Inconsistent results in simple script
johnpatten at me.com
Wed Nov 16 15:13:05 EST 2016
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?
I’m sure there are more elegant ways to do this, but here is my script:
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
--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
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
put tUploadFile into cd fld "Upload File"
Any suggestions would be helpful.
More information about the Use-livecode