Sign in to follow this  
Followers 0
wipped

text deleting, HELP needed

6 posts in this topic

Hi

i need to delete a little part of a text help me

example:

the text is:

text1-

text2-

text3-

i want to delete:

text2-

how can i do that pls help

P.S. the text is in a .txt document

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You don't properly explain. If you want to delete a specific string use StringReplace and replace it with an empty string ""

Edited by Inverted

Share this post


Link to post
Share on other sites

You don't properly explain. If you want to delete a specific string use StringReplace and replace it with an empty string ""

Hi,

have a look at _ReplaceStringInFile

;-))

Stefan

Share this post


Link to post
Share on other sites

Hi,

have a look at _ReplaceStringInFile

;-))

Stefan

Thanks, i dont't understand stringreplace but _ReplaceStringInFile is understandable

Share this post


Link to post
Share on other sites

Look at the example given in the helpfile:

$text = StringReplace("this is a line of text", " ", "-")
$numreplacements = @extended
MsgBox(0, "New string is", $text)
MsgBox(0, "The number of replacements done was", $numreplacements)

Line 1 is using the command. It replaces " " (any spaces between words) with "-" (a hyphen)

$numreplacements = @extended - The command returns the new string, and the number of replacements performed is stored in @extended.

By running the command, the variable $text will be changed from "this is a line of text" to "this-is-a-line-of-text". You see this in the first message box.

The second message box you see is the extended information. In this case the number "5" is returned for this is the number of times the " " was found and replaced.

Share this post


Link to post
Share on other sites

Look at the example given in the helpfile:

$text = StringReplace("this is a line of text", " ", "-")
$numreplacements = @extended
MsgBox(0, "New string is", $text)
MsgBox(0, "The number of replacements done was", $numreplacements)

Line 1 is using the command. It replaces " " (any spaces between words) with "-" (a hyphen)

$numreplacements = @extended - The command returns the new string, and the number of replacements performed is stored in @extended.

By running the command, the variable $text will be changed from "this is a line of text" to "this-is-a-line-of-text". You see this in the first message box.

The second message box you see is the extended information. In this case the number "5" is returned for this is the number of times the " " was found and replaced.

Yes okey

But i want to replace text in a file

so i think i better use _ReplaceStringInFile

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0