Page 1 of 1 1
Topic Options
#118201 - 2004-04-19 09:09 AM @DATE remove / ?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
How can i remove this from the @DATE string?
Because i would like to create a zip with date but when i use @DATE i recieve an error that says / are not allowed in filesnames.

Top
#118202 - 2004-04-19 09:15 AM Re: @DATE remove / ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
$filefriendlydate = join(split(@date,'/'))
_________________________



Top
#118203 - 2004-04-19 09:16 AM Re: @DATE remove / ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
or better :

$FileFriendlyDate = join(split(@date,'/'),'_')
_________________________



Top
#118204 - 2004-04-19 09:38 AM Re: @DATE remove / ?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Thank you for your quick answer. It works.. but he creats a 2004_04_.zip and in the logfile he writes 2004_04_19..

I've already another problem..

$FileNameXLS = Dir("$ipath\*.xls")
While $FileNameXLS <> "" AND @ERROR = 0
At ( $Count,7) "In Bearbeitung: " + $FileNameXLS
Shell '"$ppath\BatchPDF.exe" "$ipath\$FileNameXLS" "$opath\$FileNameXLS.pdf"'
IF exist('$opath\'' + split($FileNameXLS,'.')[0] + '.pdf')
DEL "'+ split($FileNameXLS,'.')[0] + '.pdf'"
ENDIF
shell '%ComSpec% /c rename "$opath\$FileNameXLS.pdf" ' + split($FileNameXLS,'.')[0] + '.pdf'
Shell '%ComSpec% /c echo Folgende Datei wurde konvertiert: $FileNameXLS >> "$logfile"'
Sleep 0.001
MOVE "$ipath\$FileNameXLS" "$apath\$FileNameXLS"
$FileNameXLS = Dir()
$Count = $Count + 1
IF $Count = 19
$Count = 6
GOTO "new"
ENDIF

Loop

The Error Note is that in this line
IF exist('$opath\'' + split($FileNameXLS,'.')[0] + '.pdf')
is missing an )... but where?


Edited by kixnewbie (2004-04-19 12:18 PM)

Top
#118205 - 2004-04-19 12:52 PM Re: @DATE remove / ?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Problem resolved. But... again to the Date.. the script only creats a 2004_04_.ZIP instead of 2004_04_19.ZIP.. In the logfile the Date is right.
Top
#118206 - 2004-04-19 02:47 PM Re: @DATE remove / ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
there is no ) missing, the problem is a quotation puzzle :

IF exist('$opath\'' + split($FileNameXLS,'.')[0] + '.pdf')

should be :

IF exist('$opath\' + split($FileNameXLS,".")[0] + '.pdf')

Show me the line where you create the filename
_________________________



Top
#118207 - 2004-04-20 10:49 AM Re: @DATE remove / ?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
This problem is resolved now I've played a bit with the script it was a quote problem
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org