Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: parse fileread
Debug(@on) ; start off in debug mode for testing fn="c:\data\mydatafile.txt" fh=FileOpen(fn,"READ") while 1 ; loop for ever line=FileRead(fh) if line="*EOF*" then break ; End of file found ; now is a tricky part, parsing the line ; Good Luck. ; For tab and *maybe* csv files use the ItemExtract Function ; For fixed size records use the strsub function ; Tab delimited example name=ItemExtract(1,line,@tab) addr1=ItemExtract(2,line,@tab) ; Fixed record size example name=strsub(line,1,30) addr1=strsub(line,31,60) ; Now to send your data to the application. I suggest ; passing the data thru the clipboard so you don't have ; to worry about weird characters in the input data ; confusing the SendKey statement Clipput(name) SendKeysTo("YourApp","!fo{TAB}{TAB}^v") ;I dunno what you need to do, but the above will send ; Alt-FO TAB TAB and then a Ctrl-v to paste the clipboard in there Clipput(addr1) SendKeysTo("{TAB}^v") ; and this does TAB to move to the next field and then pastes there SendKeysTo("Yourapp","~") ; The Tilde is shorthand for ENTER ; and loop to do it again. endwhile FileClose(fh)Good Luck. Drink LOTS of coffee.
Article ID: W13241
Filename: Parse Data from ASCII file using FileRead.txt
File Created: 1999:04:15:16:52:42
Last Updated: 1999:04:15:16:52:42