I have some cobol files that i need to read. They are 1170 bytes long. I need to read the files a record at a time and then select certain ones. The problem i am having is...
I want to look at certain data in the record to determine what to do. I used substring to look at the data...but it seems to be ignoring blanks and null values that make up parts of the record. Am i doing something wrong?
PHP:--------------------------------------------------------------------------------
while (!feof($fp)){
$line=@fgets($fp,1170);
$piece1 = substr($line,7,17);
echo $piece1;
}
if positions 1-6 contain nulls, then it offsets and does not give me what i want... example
'"""""frogisadog results in piece1 being "adog" instead of "forgisadog"
I am new to php... but I need to read "postionally" on records. If i cannot use substr on null values and such....what do i use to get to certain places in the record? Nulls are valid values to me.