Angelia Posted May 18, 2006 Report Share Posted May 18, 2006 can anyone make me a snippet that removes every second character from a text document starting from the first character? -h-e-l-l-o- -t-h-e-r-e i got a corrupted file that has added an extra character every second character. i'd use $remove but it's a space so that doesnt really help Link to comment Share on other sites More sharing options...
TG007 Posted May 18, 2006 Report Share Posted May 18, 2006 when you say it has a space do you mean that it's a space where the -'s are like h e l l o t h e r e and is there a double space between words or just a single space. Link to comment Share on other sites More sharing options...
Angelia Posted May 18, 2006 Author Report Share Posted May 18, 2006 (edited) yeah, there's a space between each chatacter, as well as around each space, so it's quite literally where i've put the dashes (there's a space between each character and the original spaces have become 3 spaces) Edited May 18, 2006 by Angelia Link to comment Share on other sites More sharing options...
TG007 Posted May 18, 2006 Report Share Posted May 18, 2006 you could try something like $remove($replace($replace(%text,$chr(32),-),--,$chr(32)),-) Link to comment Share on other sites More sharing options...
Angelia Posted May 18, 2006 Author Report Share Posted May 18, 2006 (edited) close but it removes all spaces because it would be three dashes in a row, not two. i tried 3 too but that didnt work either - mirc takes the 3 spaces as 1 space then processes the result Edited May 18, 2006 by Angelia Link to comment Share on other sites More sharing options...
TG007 Posted May 18, 2006 Report Share Posted May 18, 2006 not if you put the text in a var here is what i used.. same as code i put up ( changed it to --- ) used %test instead of %text Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now