How do I add timestamp to Cognos 11 file written to share folder - cognos-11

I have a file that is written by Cognos 11 to a shared folder. Problem is that each time Cognos writes the file, it uses the exact same file name. Subsequent outputs fail if the file name already exists. So, I need something line a timestamp added to the name to uniquely identify the file.
There are 2 setting2 for email attachments to set up the file name with a timestamp. These are emf.dls.attachment.timestamp.enabled and emf.dls.attachment.timestamp.format. They do not affect a file name that is written to a network folder.
Does anyone know how to do this?

Have you selected "Time stamp" under the delivery options ?

Related

Avoid reading the same file multiple times using Telegraf and file input plugin

I need to read csv files inside a folder. New csv files are generated every time a user submits a form. I'm using the "file" input plugin to read the data and send it to Influxdb. These steps are working fine.
The problem is that the same file is read multiple times every data collection interval. I was thinking of a solution where I could move the file that was read to a different folder, but I couldn't do that with Telegraf's "exec" output plug.
ps: I can't change the way csv files are generated.
Any ideas on how to avoid reading the same csv file multiple times?
As you discovered file input plugin is used to read entire files at each collection interval.
My suggestion is for you to instead use the directory monitor input plugin. This will read files in a directory, monitor the directory for new files, and parse the ones that have not already been picked up yet. There are some configuration settings in that plugin that make it easier to time when new files are read as well.
Another option is to use the tail input plugin which will tail a file and only read new updates to that file as things come. However, I think the directory monitor is more likely something you are after for your scenario.
Thanks!

SPSS indicates that the .sav file is empty. Is there any way to recover the file from the Temp folder?

I was just finishing my work. Had been working on this for 1 month, more than 100 questionnaires' data to enter on the database, there were only 3 left. My computer crashed, I turned it off and after I turned it on again, I opened SPSS and coudln't open the .sav file because of an error saying the file is empty (although its size is 68kb) and to try to open another file. I tried to recover the data through the journal file, through syntaxe, but I can't. Is there any way to recover the file from the Temp folder? I noticed that in the Temp folder there are some folders named like this: "pasw-cfe-1324076806484081348-tmp" which contain executable jar files inside. There are also some LCK files with the same names as those folders. After searching about PASW, I got the idea that it may be related to SPSS. Is there any way to open these folders/files? Also, I can send the file to anyone, in case this is needed.
Any help you can offer me will be truly appreciated. Thanks
Unfortunately, no there is no way to convert those temporary scratch file back into an SPSS Statistics system file (.sav). If you do not have backups of the file, perhaps in another format (.sav, *.xlsx, *.csv, etc.) or stored as a table in a database, your only recourse will be to start over.
I have an idea, you can do "system Restore"

Link 2 different excel files

I got an Excel file name File A with 8 different worksheets. How do I link all data from File A to a brand new File B? Any changes to File A will automatically update File B. Please advise.
This is easy as you are only requiring updates in File B from File A, rather than in both directions. Since a complete clone would probably be easiest with just a Save (of File A as File B) I am assuming you only require this for a limited number of cells. Copy a cell from File A into the desired location in File B and paste the Clipboard content with Paste Special Paste Link.
The values however may be out of synchronisation unless both files are open at the same time in the same Excel instance.

How to prompt user to specify a file location in Vaadin 7

I have feature that exports and generates csv using opencsv in vaadin 7. The problem I have is how to get a file location to save a file on users local machine.
Below is a line that needs a path to where to save a generated file.
CSVWriter writer = new CSVWriter(new FileWriter("H:\\dummy\\export"+timestamp+".csv"));
Instead of having a static file path, I need to prompt the user for where to save a file, as well as how the user wants to name a file.
I appreciate your help.
You have no chance to influence the location of a file that a user downloads.
Here you can find a sample how to create a download with vaadin:
Letting The User Download A File
Note: The Vaadin7 Link broke, this is for Vaadin8 but still helpful.

(rails) how to validate whether an uploaded .txt file is not, say, an image file?

I have a upload text file field, and with it I plan to save the file somewhere and then store the location of the file in a database. However, I want to make sure the file they uploaded is a .txt file, and not, say, an image file. I imagine this happens in the validation step. How does one validate such a thing? Also, how do you get the filename of the uploaded file? I could always just check if it said '.txt' but for future reference knowing how to validate without just the filename would be helpful.
Trying to validate the contents of a file based on the filename extension is opening the door for major hackerdom. It's trivial to change the extension and upload the file.
If you are on a Mac/Linux/Unix-based system the OS "file" command is the standard because it looks inside the file for key bytes that flag file types. http://en.wikipedia.org/wiki/File_(Unix) I'm not sure what's available for Windows, but this might help: Determine file type in Ruby
One way of doing it, the simple way really, would be to pass the file through an image loader, preferably one that handles multiple common formats, and see if it throws an error.
The other way is to manually check the file header for common image format headers. For example, .bmp files start with BM. Other formats have their own specific markings you can use.

Resources