|
Joined: Feb 2004
Posts: 119
Vogon poet
|
OP
Vogon poet
Joined: Feb 2004
Posts: 119 |
they ascii for a space is $chr(32) right? anyone know what the $chr is for a double space?
|
|
|
|
Joined: Feb 2004
Posts: 119
Vogon poet
|
OP
Vogon poet
Joined: Feb 2004
Posts: 119 |
this is an example of what i'm trying to do. i want to remove double spaces from file names.. and rename them.
if ($+($chr(32),$chr(32)) isin $nopath($1-)) && (!$isfile($+($nofile($1-),$replace($nopath($1-),$chr(95),$chr(32))))) {
.rename $1- $+(",$nofile($1-),$replace($nopath($1-),$+($chr(32),$chr(32)),$chr(32)),")
echo -a 4:: Removed Double Spaces In 4:: $1-
}
|
|
|
|
Joined: Feb 2004
Posts: 206
Fjord artisan
|
Fjord artisan
Joined: Feb 2004
Posts: 206 |
$chr(32) $+ $chr(32)
Cheers
DK
Darwin_Koala
Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
alias noSpaces { var %result !.echo -q $regsub(doubleSpaces, $1-, /(\s+)/, $chr(32), %result) return %result }
I don't see how it's possible considering mIRC ignores double spaces anyways, but that's a little more simplistic.
[EDIT] Actually, just to be clear, that will remove 2+ spaces in a row. Just thought I'd throw that in there incase you didn't want that. [/EDIT]
Last edited by KingTomato; 29/06/04 06:40 AM.
-KingTomato
|
|
|
|
Joined: Feb 2004
Posts: 119
Vogon poet
|
OP
Vogon poet
Joined: Feb 2004
Posts: 119 |
sorry i'm not good with regex.. so what do i change?
alias _test {
set %dir.ruang $sdir="Choose Folder That Has The Files You Want To Remove Spaces ( _ )? "
Carik.Ruang %dir.ruang
}
alias Carik.Ruang { var %ruang = $findfile($1-,*.*,0,Isi.Ruang $+(",$1-,")) }
alias Isi.Ruang {
if ($chr(95) isin $nopath($1-)) && (!$isfile($+($nofile($1-),$replace($nopath($1-),$chr(95),$chr(32))))) {
.rename $1- $+(",$nofile($1-),$replace($nopath($1-),$chr(95),$chr(32)),")
echo -a 4:: Removed Spaces In 4:: $1-
}
if ($+($chr(32),$chr(32)) isin $nopath($1-)) && (!$isfile($+($nofile($1-),$replace($nopath($1-),$chr(95),$chr(32))))) {
.rename $1- $+(",$nofile($1-),$replace($nopath($1-),$+($chr(32),$chr(32)),$chr(32)),")
echo -a 4:: Removed Double Spaces In 4:: $1-
}
}
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
alias nodblsp return $findfile($$1-,$+(*,$chr(32),$chr(32),*),0,1,.rename $1 $+(",$longfn($1),")).shortfn
Use it as a command...
//nodblsp c:\folder\ | echo Fixed $result files.
...or as an identifier:
//echo Fixed $nodblsp(c:\folder\) files.
|
|
|
|
|