devxlogo

Avoid Line Input Null Problems

Avoid Line Input Null Problems

Sometimes you have to move information from a flat file (mainframe or ASCII text file) to a database. Usually, this flat file is a set of records, and the delimiter between records is a carriage return/linefeed pair. Records might be different sizes and can contain Null characters. This code is a standard way to read a file line by line, but fails because strBuff loses Null characters, and the structure of the current record is incorrect:

 Do Until EOF(1)	'//-------After the next statement strBuff 	'will be without Null characters	Line Input #1, strBuffLoop

I know at least three ways to fix this problem. Here

devx-admin

Share the Post: