Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting for newbies?

Status
Not open for further replies.

zencalc

IS-IT--Management
Feb 27, 2002
67
US
Does anyone have any tools or resources where I can get some knowledge of writing some very basic scripts? I need to write something to replace a character string, in a csv file, with a [CR], and replace another character string with just a blank space. When I try to use "replace" functions in MSWord or Wordpad, it doesn't save the [CR] and the file gets all smushed together (and thus unreadable) when I reopen it. Any help at all to get me started would be greatly appreciated. Thanks in advance, Brian
 
Suppose you have some text, let's say in a VB text box. You want to replace the character "X" with a CR/LF. here's the code:

txtMyBox.Text = replace(txtMyBox.Text, "X", vbCrLf)

There are ways to set this up as an MS word macro, but you need to know things about the environment. You could set this up as a VB form with a text box, and have a command button with the above code in it. Paste your text into the text box, push the button, and voila! Then you can copy the result from the text box to wherever.

Bob Rodes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top