program String_Matrix_CSV_File; // This is a script that illustrates how to use the String Matrix // functions. You can easily read data from a comma separated value // file and assign it to a 2 dimensional array. From there you can // populate web forms using the array. // String Matrix functions are available in Newbie version 2.6.1 and higher Const ExcelFile = 'C:\DataFile.csv'; EndLineMarker = 'ENDOFLINE'; cFieldTitle = 1; cFieldDesc = 2; cFieldCity = 3; var nIndex : integer; { Process events here } procedure OnDocumentComplete(URL : string); begin if IsPartOf('SubmitAd.html', URL) then begin nIndex := nIndex + 1; ClickButton('Post Ad'); end else if IsPartOf('/classifieds/PostAd', URL) then begin Fill('title', MatrixGetVal(nIndex, cFieldTitle)); FillTextArea('ad', MatrixGetVal(nIndex, cFieldDesc)); Fill('regionOther', MatrixGetVal(nIndex, cFieldCity)); Fill('email', 'adrs@email.com'); ClickButtonValue('Continue'); end end; { This is the main program body. } begin nIndex := 0; // initialize matrix MatrixReset; // set line delimiter MatrixLineDelimiter(EndLineMarker); // read csv file if (MatrixReadFile(ExcelFile)) then Navigate('http://www.SomeSampleAdWebsite.com'); end.