Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have some pcl documents with information embeded in the first couple of lines. These need to be removed bfore converting the pcl document to a tiff document to be imaged.

In vb6 I used:

VB
Put #outFile, , Replace(StrConv(InputB(LOF(fileNum), fileNum), vbUnicode), sString, "", 1, 1, vbBinaryCompare)


I am opening the file binary converting to a string and replacing the string, basically deltting the string and saving it to a new file. I have tried to code this in vb.net, but have not been able to make it work.
Posted
Updated 25-May-12 7:36am
v2
Comments
Sergey Alexandrovich Kryukov 25-May-12 14:44pm    
Who do you think MSDN help is written for?
--SA
Maciej Los 29-May-12 13:03pm    
Good question!

1 solution

I found a way to accomplish what I needed.

VB
FileOpen(5, "C:\Temp\TempImg.pcl", OpenMode.Output)
Do Until EOF(fileNum)
    sString1 = LineInput(fileNum)
    position = InStr(sString1, "INDEXX:")
    If position > 0 Then
        sString = sString1
        sString1 = ""
    End If
    Print(5, sString1 & vbCrLf)
Loop
FileClose(5)
FileClose(fileNum)

imageFile = My.Computer.FileSystem.ReadAllBytes"C:\Temp\TempImg.pcl")
My.Computer.FileSystem.WriteAllBytes(TempDir + sFileName, imageFile, False)
 
Share this answer
 
v2
Comments
Kenneth Haugland 16-Jul-12 12:20pm    
This looks a lot like VB6 if im not mistaken?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900