-- tabs, records are delimited by either CR or CR/LF,
-- and that the data fields themselves do not contain
-- CR or LF characters.
--
- Created list looks like this:
--
-- ["IN000789":["Vargas","Paul","PART987","Ballpeen hammer","5.00"],
-- "IN000790":["Jones","Marty","PART002","Switchplate","1.97"] ]
--
set f = new(xtra "fileio")
openFile(f,theFilePath,1)
set source = readFile(f)
closeFile(f)
set indexedList = [:]
set lineList = GetListOfLines(source)
if TC_GetLastError() = 0 then
repeat with oneLine in lineList
if oneLine = "" then next repeat
set fieldList = GetListOfItems(oneLine,9)
set key = getAt(fieldList,keyFieldNumber)
if not voidP(getaprop(indexedList,key)) then
alert "Duplicate key: " & key
else
deleteAt fieldList,keyFieldNumber
addProp indexedList,key,duplicate(fieldList)
Online Help
40
Kommentare zu diesen Handbüchern