remove special Host character
remove special Host character
remove special Host character
remove special Host character
remove special Host character
remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character
remove special Host character remove special Host character
remove special Host character
Go Back  Xtreme Visual Basic Talk > > > remove special Host character


Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2016, 01:13 PM
sal21 sal21 is offline
Junior Contributor
 
Join Date: Mar 2004
Posts: 259
Default 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
Reply With Quote
  #2  
Old 04-01-2016, 12:09 AM
dilettante's Avatar
dilettanteremove special Host character dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,518
Default

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.
Attached Files
File Type: zip StringScans Demo.zip (2.4 KB, 10 views)
Reply With Quote
  #3  
Old 02-26-2017, 09:44 PM
sal21 sal21 is offline
Junior Contributor
 
Join Date: Mar 2004
Posts: 259
Default

Quote:
Originally Posted by dilettante View Post
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.
Reply With Quote
  #4  
Old 03-07-2017, 07:25 AM
TheRealTinTin's Avatar
TheRealTinTin TheRealTinTin is offline
Junior Contributor
 
Join Date: Nov 2008
Location: Glasgow, UK
Posts: 379
Default

It should read:
Code:
Const TO_BE_FILTERED As String = Chr$(12) & Chr$(26)
__________________
Artificial Intelligence is no match for natural stupidity
Reply With Quote
  #5  
Old 03-19-2017, 12:35 PM
sal21 sal21 is offline
Junior Contributor
 
Join Date: Mar 2004
Posts: 259
Default

Quote:
Originally Posted by TheRealTinTin View Post
It should read:
Code:
Const TO_BE_FILTERED As String = Chr$(12) & Chr$(26)
... Not sure your suggestion work.
Tksin other case for code.
Attached Images
File Type: jpg Immagine.JPG (67.2 KB, 4 views)
Reply With Quote
  #6  
Old 03-19-2017, 10:16 PM
Cerian Knight's Avatar
Cerian Knightremove special Host character Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,183
Default

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').
Reply With Quote
  #7  
Old 03-22-2017, 06:55 AM
sal21 sal21 is offline
Junior Contributor
 
Join Date: Mar 2004
Posts: 259
Default

Quote:
Originally Posted by Cerian Knight View Post
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?
Reply With Quote
  #8  
Old 03-22-2017, 07:50 AM
Flyguy's Avatar
Flyguyremove special Host character Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,151
Default

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?
Reply With Quote
  #9  
Old 03-22-2017, 11:52 PM
dilettante's Avatar
dilettanteremove special Host character dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,518
Default

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.
Reply With Quote
Reply

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
remove special Host character
remove special Host character
remove special Host character remove special Host character
remove special Host character
remove special Host character
remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character remove special Host character
remove special Host character
remove special Host character
 
remove special Host character
remove special Host character
 
-->