Saveas with eof to 0

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Thais
Posts: 39
Joined: Mon Sep 24, 2012 7:33 pm

Saveas with eof to 0

Post by Thais » Mon May 30, 2016 5:30 pm

HI all,

Do you know if it's possible to do a SAVEAS with setting the "eof" to 0
Or if the file still exist, just erase the content

Thanks for your help

Thais
Mac Os : 10.13.3 (17D102)
Firefox : 48.0.2
iMacros for Firefox : 8.9.7
chivracq
Posts: 9291
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Saveas with eof to 0

Post by chivracq » Mon May 30, 2016 6:00 pm

Thais wrote:

Code: Select all

Mac Os : 10.6.8
Firefox : 46.0.1
iMacros for Firefox : 8.9.6
HI all,

Do you know if it's possible to do a SAVEAS with setting the "eof" to 0
Or if the file still exist, just erase the content

Thanks for your help

Thais
"'SAVEAS' with EOF=0" won't be possible because a 'SAVEAS' always appends the "new" Data to the existing Data in the File (or it creates the File if it doesn't exist).

"Or if the file still exist(s...!), just erase the content.", yep, that's possible..., and there are several ways...:
- If you first want to check if the File already/still exists, it is possible to "misuse" '!FOLDER_DATASOURCE' for that Purpose, or you pretend to pull some '{{!COL1}}' Data from it as a DataSource and using 'EVAL()' +'length()' on the String returned by '{{!COL1}}', you can spit out some "YES"/"NO" or "1"/"0" Flag or even a String with the Filename / a fake Filename to reuse in the next Step.
- Then using 'FILEDELETE', you delete the File (using '!ERRORIGNORE' maybe in case the File didn't exist at all), or you can even do a Conditional 'FILEDELETE' if you reuse the String computed as the Filename/fake Filename in the previous Step.
- And you recreate the File with 'SAVEAS' and '!EXTRACT' being 'NULL' or containing an empty String.

And maybe simply just using 'FILEDELETE' will be enough for your Needs...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Thais
Posts: 39
Joined: Mon Sep 24, 2012 7:33 pm

Re: Saveas with eof to 0

Post by Thais » Tue May 31, 2016 4:43 pm

Thanks a lot, it is working fine :D

Thais
Mac Os : 10.13.3 (17D102)
Firefox : 48.0.2
iMacros for Firefox : 8.9.7
chivracq
Posts: 9291
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Saveas with eof to 0

Post by chivracq » Tue May 31, 2016 5:21 pm

Thais wrote:Thanks a lot, it is working fine :D

Thais
Yeah..., good to hear, but you could be a bit more explicit...! :roll:
I gave you several ways, which one did you choose...?, and you could share your Script to make this Thread a bit useful for other Users as well... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply