mIRC Home    About    Download    Register    News    Help

Print Thread
/write text formatting question #117883 20/04/05 07:53 AM
Joined: Feb 2003
Posts: 20
F
fallen248 Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
ok im writing a script to take my old sites.dat file from flashfxp and create a bookmark file for gftp on linux. the problem being the text formatting.

the variable i have all work, the script gets the info, my problem is that i need no spaces and in the first line i need it formatted that exact way.

[%channame/%currenttopic]
hostname=%ip
port=%port
protocol=FTP
remote directory=/
local directory=
%user
%password
account=

i need the file to be named bookmarks, my problem is i have tried many ways of using /write and /writini and i cannot get it to format without spaces and with the brackets.

Any help would be greatly appreciated.

Re: /write text formatting question #117884 20/04/05 09:21 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
//write file.txt $+([,%channame,/,%currenttopic,])
or
//write file.txt [[ $+ %channame $+ / $+ %currenttopic $+ ]]
or
//write file.txt $chr(91) $+ %channame $+ / $+ %currenttopic $+ $chr(93)


$+ removes the space you'd normally get, same for $+()
use [[ or $chr(91) for [ if it's surrounded by spaces, if it's not, then you can use [

to get the correct number for $chr, either use $asc(character) to get it or use this script to list them all (put next lines in a file in remotes), then type /chrt somewhere to get a new window with all characters and their codes)
; make a chart with all ascii codes and their hex, oct and decimal codes
alias chrt {
var %i = 0
window -ln @chrt 0 0 125 500
clear @chrt
while (%i <= 255) {
aline @chrt 14 $+ $right(0 $+ $base(%i,10,16),2) $+ 10 $+ $&
$right(000 $+ $base(%i,10,8),4) $+ 08 $+ $base(%i,10,10,4)  $+ $chr(%i)
inc %i
}
window -r @chrt
}

Re: /write text formatting question #117885 24/04/05 12:22 AM
Joined: Feb 2003
Posts: 20
F
fallen248 Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
Thanks alot, that worked for the first line. But when i tried to copy it for the others it didnt.

What would the other lines look like?

Re: /write text formatting question #117886 24/04/05 01:20 AM
Joined: Feb 2003
Posts: 20
F
fallen248 Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
nevermind, i got it. thank you for the help