Im looking for a way to remove a duplicate # from A text File Line. And am kinda stuck on where to start I thaught /filter but am lost.
here is an example of the file
1:1 1:1 The Command Structure for the .....
1:2 1:2 Issue A clearance for one or more .....
1:3 1:3 .......
2:1 2:1 Next Section
I would like to remove either the 1st or second instance from the complete file Aprox 1000+ lines.
Any help would be welcomed
alias remdup {
var %x = 1
if (!$1) { echo -a 4,1Error! Syntax: /remdup path/filename.txt | return }
else {
while (%x <= $lines($1)) {
write $+(-l,%x) $1 $deltok($read($1,%x),2,32)
inc %x
}
}
}
This code will work as you use it /remdup filename.txt will edit your current file that you call and remove the second instant as long its like that all over the file.
1:1 1:1 The Command Structure for the .....
1:2 1:2 Issue A clearance for one or more .....
1:3 1:3 .......
2:1 2:1 Next Section
will become
1:1 The Command Structure for the .....
1:2 Issue A clearance for one or more .....
1:3 .......
2:1 Next Section
you can also setup another var for sfile and use sfile to have the ability to select a file but this will do for now