Solved

replace or remove weird chars

Posted on 2009-05-11
13
212 Views
Last Modified: 2012-05-06
How can I remove or replace  a pair of weird char (looks like rectangle) in a text file in vb.net?
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 18

Expert Comment

by:carlnorrbom
ID: 24356067
Hi,

You can use String.Replace("weirdcharacter", "")

/Carl.
0
 

Author Comment

by:VBdotnet2005
ID: 24356140
How can I upload a text file for you so you can see it?
0
 

Author Comment

by:VBdotnet2005
ID: 24356149
there it is.
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

Author Comment

by:VBdotnet2005
ID: 24356151
Ok I uploaded a text file called "test". So you can see it.
0
 
LVL 18

Expert Comment

by:carlnorrbom
ID: 24356406
Hi,

I don't see any attachment?

/Carl.
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 24356412
Hi VBdotnet2005;

Where did you upload the file too?

Fernando
0
 

Author Comment

by:VBdotnet2005
ID: 24356472
I checked the box "Attach file"  and "Add file" and submit. Not sure where it upload to....
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 24356722
Can you try again.
0
 
LVL 15

Accepted Solution

by:
JackOfPH earned 500 total points
ID: 24360569
I believe the weird characters is caused by the carriage return in the textfile.
To remove it, try this code:

Textbox1.text = YourStringVariable.Replace(vbcrlf," ")

Open in new window

0
 
LVL 4

Expert Comment

by:barrislb
ID: 24364898
Hi VBdotnet2005,

Those weird rectangle boxes are replacements for the white space " " character. The file probably could not recognize a certain font. Still waiting to see your file.
0
 
LVL 18

Expert Comment

by:carlnorrbom
ID: 24372085
Hi,
In order for us to help you it would be very helpful to actually see the file contents.
/Carl.
0
 

Author Comment

by:VBdotnet2005
ID: 24401252
JackOfPH, I will give it a try.... I uploaded the file a few time alreay...it is a text file
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 24402404
To upload a text file for this question click on the check box near the bottom of this page called "Attach File".  In the new box click on the button called "Add File". This will open a "Choose File To Upload" dialog box, locate the file you wish to upload and then click on the button "Open". Once the file has been successfully selected write a description of the file in the "Description text box. Then click on button "Submit" to send the post.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question