 |

03-31-2016, 01:13 PM
|
Junior Contributor
|
|
Join Date: Mar 2004
Posts: 261
|
|
remove special Host character
I nee to read "line by line" a txt created from a Cics(Extra Attachmate) procedure, but have diffcult because inthe internal of txt hare present many Ho9st specila character... s.a.:
Chr(12), CHr(10), Chr(26) how to skip this chr, or aexists a good method to read all line line by ...
Tks
|
|

04-01-2016, 12:09 AM
|
 |
Underclocked lifestyle
Forum Leader * Guru *
|
|
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,533
|
|
Maybe this will help.
In this case the input text is read from a disk file. Instead of having control characters it has $, <, and > characters... just for demonstration.
|
|

02-26-2017, 09:44 PM
|
Junior Contributor
|
|
Join Date: Mar 2004
Posts: 261
|
|
Quote:
Originally Posted by dilettante
Maybe this will help.
In this case the input text is read from a disk file. Instead of having control characters it has $, <, and > characters... just for demonstration.
|
I bro... sory for delay, but busy in a big project.
is this correct to find and remove chr$(12) and Chr$(26)...
Const TO_BE_FILTERED As String = "Chr$(12)Chr$(26)"
tks.
|
|

03-07-2017, 07:25 AM
|
 |
Junior Contributor
|
|
Join Date: Nov 2008
Location: Glasgow, UK
Posts: 383
|
|
It should read:
Code:
Const TO_BE_FILTERED As String = Chr$(12) & Chr$(26)
|
__________________
Artificial Intelligence is no match for natural stupidity
|

03-19-2017, 12:35 PM
|
Junior Contributor
|
|
Join Date: Mar 2004
Posts: 261
|
|
Quote:
Originally Posted by TheRealTinTin
It should read:
Code:
Const TO_BE_FILTERED As String = Chr$(12) & Chr$(26)
|
... Not sure your suggestion work.
Tksin other case for code.
|
|

03-19-2017, 10:16 PM
|
 |
Polymath (in disciplina)
Super Moderator * Expert *
|
|
Join Date: May 2004
Location: Michigan
Posts: 4,206
|
|
Chr() does not work for Const in VB6 (but fine in VB.Net). Here is a discussion:
[RESOLVED] Constants for ASCII Control characters?-VBForums
Another option might be to just load the values into a Dim string variable when Sub Main is loaded:
Code:
Dim TO_BE_FILTERED As String
TO_BE_FILTERED = Chr$(12) & Chr$(26)
|
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
|

03-22-2017, 06:55 AM
|
Junior Contributor
|
|
Join Date: Mar 2004
Posts: 261
|
|
Quote:
Originally Posted by Cerian Knight
Chr() does not work for Const in VB6 (but fine in VB.Net). Here is a discussion:
[RESOLVED] Constants for ASCII Control characters?-VBForums
Another option might be to just load the values into a Dim string variable when Sub Main is loaded:
Code:
Dim TO_BE_FILTERED As String
TO_BE_FILTERED = Chr$(12) & Chr$(26)
|
OK I use
Dim TO_BE_FILTERED As String
TO_BE_FILTERED = Chr$(12) & Chr$(26)
and the code wotk fine untill
DataIn = Input$(LOF(F), #F)
have error: out of string space error 14
my file is approx 140 mb, with fixed lenght of each line 132 byte
solution?
|
|

03-22-2017, 07:50 AM
|
 |
Lost Soul
Retired Moderator * Guru *
|
|
Join Date: May 2001
Location: Vorlon
Posts: 19,174
|
|
This error has nothing to do with the filter string.
You should not read such a big file in a single string.
Can you explain again what kind of data the file has.
Is it a text file, from which you want to strip certain characters?
Or is it a binary file with special line separators?
|
|

03-22-2017, 11:52 PM
|
 |
Underclocked lifestyle
Forum Leader * Guru *
|
|
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,533
|
|
Well he said he has fixed 132 character lines. However so much else is left unsaid it is hard to know where to begin.
Are there record delimiters or not? If not and this is truly fixed records are they padded with spaces on the right? NULs?
Character encoding? ANSI, ASCII, UTF-16LE, UTF-8, etc? If ANSI do you need to deal with LCID/CharSet or are the characters encoded for your locale?
What does "read line by line" mean? Read each line as a String for the program to do something with? Do you really want to read all of this bulky file, or are you trying to reformat it as a new file for some other application to accept?
What about those control characters? Strip them, replace then by spaces, or...?
It sounds like a printer file produced by a terminal emulator, but that doesn't tell us much without specific details.
|
|
Tags
|
line, txt, read, character, chr10, chr26, chr12, ho9st, skip, specila, s.a, aexists, method, tks, chr, inthe, created, cicsextra, nee, special, host, attachmate, procedure, remove, internal  |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|