Jump to content

How to remove the "(1)" suffix from the name in downloaded files for recurring imports


This topic is 651 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am trying to set up a recurring import from a file downloaded each day.  Windows adds (1) or (2) etc as a suffix to each file with the same name and therefore, my filename used in the recurring import fails.  I am hoping that the end user does not have to change the way they do things on their computer.  They should just click the daily update on the site they are using download the file.  Then i have filemaker do its magic and import the file.

any suggestions to overcome this.

 

p.s I hope this is not a redo of a previous topic.  I could not figure out a good search term(s) for this.

Dave

Link to comment
Share on other sites

40 minutes ago, David Ford said:

Windows adds (1) or (2) etc as a suffix to each file with the same name

I am not a Windows user. IIUC, the suffix is added because an older file with the same name exists in the same directory. If so, I would presume that you won't be able to remove the suffix from the new file's name unless you delete the older file first. Perhaps you should routinely follow a successful import by deleting the file.

How are users downloading the file? It sounds like they need to do it manually first, before turning to Filemaker to initiate the import. Perhaps you should automate the entire process for them, starting by inserting the file into a container field. Then you will have full control of the process. 

 

Link to comment
Share on other sites

Yes, they can do a snapshot at any time they want.  Ideally first thing in the morning.  As for automating it,  they have an API but it is ridiculously slow and I have to download the entire inventory snapshot all 7900 products.  Then converting the json to a csv is not super quick as there are somewhere in the neighborhood of about 125000 lines of json.  I have requested some parameters be added so i an filter out the products I need...approx 475.  Much faster.  The user can get a snapshot of those 475 products as they are in their on category and the pos software allows the users to do that.  Again that seemed a good idea by setting up a recurring import but, the filename issue has come up.  I do understand why they do it and did beforehand.  I was hoping for some ideas.

 

Thanks

Link to comment
Share on other sites

How exactly do they download the file? Is this something that could be accomplished by using the Insert from URL[] script step?

 

7 hours ago, David Ford said:

I was hoping for some ideas.

Well, what about the idea of deleting the file after import?

 

Link to comment
Share on other sites

The have a web based system that they can goto anytime, i just assumed the morning would be best.  they click a button in the reports section that gives them the current inventory snapshot.  they can choose to download in csv or xlsx format.  As for your question about 'insert from url' , that is what i use for the api method. 

I don't believe the csv or xlsx file is stored on their server.  If so that would solve the problem.  I will have to check.  As it is, the developers emailed and said the parameters needed can be added to the api for me to try.  But that sometimes takes weeks.  They are a fast growing pos system, and are short staffed.  Just like everywhere in the world.

And I never thought about deleting the file after download.  That would work unless they have 50 already in the downloads folder.  Then it would get named filex(51).csv.

Thanks again comment, always wise feedback

Link to comment
Share on other sites

2 hours ago, David Ford said:

they click a button in the reports section that gives them the current inventory snapshot

The question is what exactly happens when they click the button. Some actions can be simulated by submitting an HTTP request through  Insert from URL[] , some can't - it depends on the site.

 

2 hours ago, David Ford said:

I never thought about deleting the file after download.  That would work unless they have 50 already in the downloads folder.  Then it would get named filex(51).csv.

I would think that if you delete filex.csv, then the next time the system tries to add a downloaded file named filex.csv, it will succeed and not force a name change - regardless of all the other files with suffixes. But as I said, I am not a Windows user, so test this for yourself.

 

Link to comment
Share on other sites

Of course...delete the first one. then replace it with the downloaded one.  Sometimes the problem in seeing the most obvious thing is to not being able to see the most obvious thing!  I will try that. 

Again thanks

Link to comment
Share on other sites

This topic is 651 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.