Hi;
I would need some help in writing a task with the following purpose:
1) monitor recursively a folder;
2) in case of new files, for each file, remove the following text from the header (the first 45 chars of the file):
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
3) save edited files in a new folder;
4) delete original files;
5) send new files by mail.
Any help will be really appreciated !
Edit a text file
Edit a text file
Can you send me an example of such file (oleg (at) robotask.com)?
I think that this job can be solved by using BASIC script (removing of 45 chars from header).
In order to implement the rest steps look at the following actions:
File loop
Text loop
Delete file
Send email
and
File monitor triggering event
I think that this job can be solved by using BASIC script (removing of 45 chars from header).
In order to implement the rest steps look at the following actions:
File loop
Text loop
Delete file
Send email
and
File monitor triggering event
Edit a text file
You got it: thanks !
Edit a text file
My example of Basic script is below.
This script copies the original file and cuts 45 chars from header.
I've sent the example via email.
Of course this task requires BASIC plugin for RoboTask.
Download it here
Code: Select all
Sub Main
Dim in_file As String
Dim out_file As String
Dim buf As Byte
Dim i As Long
in_file = RoboTaskApp.ExpandText("{in_file}")
out_file = RoboTaskApp.ExpandText("{out_file}")
'in_file = "C:\incoming\SALE-NO-NA100249-5958.edi.sign"
'out_file = "C:\incoming\SALE-NO-NA100249-5958_1.edi.sign"
Open in_file For Binary Access Read As #1
Open out_file For Binary Access Write As #2
For i =1 To 45 'skip 45 chars
Get #1, ,buf
Next
While True 'skip all CR & LF after 45 chars
Get #1, ,buf
If buf >= 20 Then
Put #2, ,buf
Exit While
End If
Wend
While Not EOF(1)
Get #1, ,buf
Put #2, ,buf
Wend
Close #1
Close #2
End Sub
I've sent the example via email.
Of course this task requires BASIC plugin for RoboTask.
Download it here
Edit a text file
Ouch !!! I'm currently using version 3.1 of Robo Task and Basic Plugin seems to work with version >= 4.1
Do you think there's a way to overcome this ?
Many thanks
Do you think there's a way to overcome this ?
Many thanks
Edit a text file
Try this, please: http://www.robotask.com/downloads/oldve ... 2.1/BasicF orRoboTask.exe
Edit a text file
As usual great support !
Many thanks for your appreciated help: now I just get what I needed !
Many thanks for your appreciated help: now I just get what I needed !