Erase equal lines of a file.. I did not have time to test yet... any problem contact me pls
Sintaxe: /erase file.EXT
alias erase {
var %% = $+(",$shortfn($$1-),"), %' 1, %o 0, %eko .echo -mat $$1-
if (!$exists(%%)) { %eko File not found | return }
%eko Initiating search for repeated lines in the $lines(%%)
while (%' <= $lines(%%)) {
var %^ = $calc(%'+1)
while ($read(%%,w,$+(*,$read(%%,%'),*),%^)) {
write $+(-dl,$readn) %%
%^ = $readn
inc %o
}
inc %'
}
%eko Number of lines repeated in the file $+(%o,$chr(46))
}
typo be polite in your comments
ugh, they come to this website to get and give help in there own good will and time,
they want to assist in ways that will benefit you not debug your scripts, but people are putting no effort in expect everybody else to do the work for them.
I did not have time to test yet... any problem contact me pls
Unfortunately that doesnt matter anymore.
Even when a mod catchs something like this sad excuse for a code and removes it, it usually takes half a day or more so its already damage done.
In my opinion modding is only good when done in a timely manner. You can't catch something 8-10 hours after it happens because hundreds or hopefully even thousands of people will already have been thru the site in that of time.
Maybe the site needs some more mods and if so there are those of us who want this site to succeed and would love to clean up our act a little and take some of our time to help keep this place in good shape.
The sad fact is that recently, exactly this kind of thing is getting posted more and more often and hawkee is already losing users because of it and will probably lose a lot more if something doesn't change.
No it isn't possible to keep people lacking intelligence away or even keep them from posting and commenting but those people are a lot easier to deal with when they're kept in check.
Nobody wants to take a lot of time to make a nice script and take the time to post it just to have a bunch of scripts posted right before and after that are completely useless or dont even work. I know one time that it actually happened to a friend and the script was seriously overlooked due to being lost in the middle of all that crap.
Ok, I think I'm done now.
This is another example of a peice of crap code and I'm getting sick and tired of seeing this garbage on the site.
Why paste a code you haven't even had the time to test?
This is FULL of problems like:
Your second while loop increases %o which is set initially to 0 and never used again.
inc = %o
needs to be
inc %o
and
while ($read(%%,w,$+(*,$read(%%,%'),*),%^)
needs to be
while ($read(%%,w,$+(*,$read(%%,%'),*),%^))
and
($exists(%%))
needs to be
(!$exists(%%))
On top of all that your second while loop does nothing but write one line to the file.
There is not even code to actually look for matching aka identicle lines.
If you fix all the problems i listed that would keep it from even running, the only thing it would do right now is leave you with a file with one line, the last line and would message you saying it found # matchs where # is actually the number of lines in the file minuse one.
Forget the fact that even posting before you test is utterly stupid and even verges on beind rude this script is a joke.
A bad bad joke.
You should be tarred and feathered.