This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Help about scan command

Old posts that have not been replied to for several years.
Locked
c
cerberus_gr
Halfop
Posts: 97
Joined: Fri Feb 07, 2003 8:57 am
Location: 127.0.0.1

Help about scan command

Post by cerberus_gr »

Hello,

I have two sentences like:

Code: Select all

good hello how are you.mp3            ::MORE:: 1.2KB 32/44 Mono [43s]
bad I_am_fine_thank_you.mp3          ::MORE:: 3.4MB 112/44 Stereo [3m32s]
(space between .mp3 and :: is <SPACE><CHAR 160>*<CHAR 160><SPACE>

and that's I want is to set in some variables some values, for the line 2:

Code: Select all

set id "bad"
set file "I_am_fine_thank_you.mp3" (Not the spaces and chars 160)
set size "3.4MB"
set bit "112"
set time 3m32s
I have written this code:

Code: Select all

scan $line %s%\[^[format %c 160]\]::MORE::%s%d%s nick file size quality length
set file [lrange $file 0 end];	# in order to remove the spaces in the front and the back
set bit [string trimleft $bit]

# I can set the length as 3m32s and if I use:
# scan $line %s%\[^[format %c 160]\]::MORE::%s%d%s[b]%s[/b] nick file size quality tmp length
# it doesn't work :(
Please help
Locked