Trying to build a replacer to look for "" in files to be replaced with "" or a NULL Char.
So, for example, if there are a series of "", like -
We want the squares removed as well as the @CRLF. In the file there is a HEX 0D0A, so it is a @CRLF.
code:
BREAK ON
?"Checking for loan file"
SLEEP 1
$handler="R:\WHANDLER\DATA\"
$bkloc="R:\WHANDLER\BADLOANS\"
$tspace="R:\WHANDLER\BADLOAN-WK\"
$loan="C:\10133442.1"
$loan=SPLIT($loan,"\")[1]
?$loan
IF 0=EXIST($bkloc+$loan)
?"Copying original file to - "+$bkloc
COPY "C:\"+$loan $bkloc
ENDIF
IF 0=EXIST($tspace+$loan)
?"Copying file into a Temporary Workspace to - "+$tspace
COPY "C:\"+$loan $tspace
ENDIF
SLEEP 2
$wkfil=$tspace+$loan
$wkfil1=$tspace+$loan+"A"
IF 0=EXIST($wkfil1)
COPY $wkfil $wkfil1
ENDIF
GET $
IF Open(1,$wkfil)
ENDIF
IF Open(2,$wkfil1,5)
ENDIF
$line=ReadLine(1)
WHILE (@error = 0)
SELECT
CASE
$line=" "+@crlf
IF (WriteLine(2,"") <> 0)
ENDIF
CASE
$line=INSTR($line,"")
IF (WriteLine(2,"") <> 0)
ENDIF
ENDSELECT
$line=ReadLine(1)
LOOP
close(1)
close(2)
? "complete"
COPY $wkfil1 $wkfil /h
DEL $wkfil1
?"Please check your loan: "+$loan
SLEEP 2
Thanks,
Kent