How can I append a constant to a variable in an Install4j text field? - variables

I am using the "Download File" action in Install4j, and I need to use a variable in the text field where you specify the URL from which to download the file. I know that I can use a variable like this: ${installer:codebase}. However, I need to append the file name onto the end of that variable. Does anyone know how to do that?
I have tried ${installer:codebase}filename.jpg and ${installer:codebase}+filename.jpg, but neither seem to be working.

Installer variables are simply replaced in text properties. For example, if you set it to
${installer:codebase}/filename.jpg
and the value of "codebase" is set to "http://mycorp.com", then the text after replacement will be
http://mycorp.com/filename.jpg

Related

Get upercase within String Value

I am currently working on a tool to automatically send out emails.
Within this tool one variable is the pathway in which the attachment is to be found.
The file names are automatically generated within a folder, but sometimes got strange symbols and/or uppercase letters, like this: "Sⁿkwrld.xlsx".
By collecting this value within a string, VBA retrieves: "Snkwrld.xlsx". This results in not being able to find the right file.
Is there a way to fix this problem and let VBA retrieve the correct value with the uppercase "N"?
Thanks in advance!
Best Regards,
Remco Coppens

Variable in Generate Rows step in PDI

I want to use variable in 'Generate rows' step in Pentaho. How can i use it. I want to give a file path in a 'Value' field but that should not be static so that i can pass this value into my csv input.
I am not sure to understand your question (see #mat's comment), but as far as I can understand it, I wonder if you really need a Generate Rows.
The CSV Input File can read the file name from a variable. If you look near this field you'll see a small 'S' in a blue diamond shape. It means that you can put a variable in it, in the format ${var_name}.
This suppose that your variable is indeed a variable, as opposed to a field. You can get the list of variables by pressing on Ctrl+Space on any input box near the 'S' in blue diamond shape. You can add a variable either in defining in a previous job, either in the parameter list [Right-click anywhere and select Parameters], either by editing the kettle.properties [on the top menu Edit], either by specifying the variable value on the small panel that is presented to you each time you want to run a transformation.
With a Generate Rows, you define a field and there is no way to use a field for the filename in a CVS Input file. You can however use a field in a Text file input with the Accept file name from an other step check box, and telling spoon from which step and from which field. If you use this step, specify on the Content tab that the filetype is CSV.
you can use "for" javascript lang step and get variable to generate rows,

How to save RichTextBox text to a text resource file?

I have created a text file named 'Notes' in the resources of my project and want to load/save the text of a RichTextBox to it. I tried using MyProject.My.Resources.Notes in the path. It doesn't show any error in the code window but when I run it, it shows an error.
Here's what I'm using to load the text:
RichTextBox1.Text = System.IO.File.ReadAllText(MyProject.My.Resources.Notes)
Here's what I'm using for saving it:
System.IO.File.WriteAllText(MyProject.My.Resources.Notes, RichTextBox1.Text)
This is not a duplicate. I did not get an answer from the other question
Why don't you use a regular file which always works fine or a database?
Edit: maybe this helps?
www.dondraper.com/2011/01/easily-save-and-retrieve-application-and-user-settings-in-vb-net-or-c-apps/

Creating a file with name given in code in LiveCode

I'm trying to build a program that gets users name at first. This user names are kept in a text file. After user logins, according to the user's name, I want user to be lead his/her specific informations. I figured out that I can only do it with a file that is created when he sign up for an account which I direct him with my sign up button in Livecode. While he/she create his account I want to create a specific file for his/her. Can you help me with it please?
PS: I don't want to do it with a database right now. I just want to learn how to create a file without a specific name like
put specialFolderPath("documents")&"/userLoginCridentials.txt" into tFile put URL("file:"&tFile) into myFile
Instead of this "userCridentials.txt" I want something user can create with his own name :)
Having a little problem to understand your question. Are you targeting mobile or desktop? Are you having problem saving or reading the data?
If saving is you problem
On desktop you can use:
ask file "Save file as:"
then you get the filename back in it so you can use:
if it is not empty then
# We have a complete file path in 'it'
put it into tFile
put tData into url ("file:" & tFile)
end if
If you targeting mobile and would like to save into the specialFolderPath("Documents")you can get the filename from a field and then save to that file. E.g. if you have a field named 'fileName' you can use something like:
put tData into url("file:" & specialFolderPath("Documents") & "/" & field "fileName"
Of course you should do some error checking to ensure that a user don't overwrite existing files without at least asking for permission, etc.
You can of course use a variable instead of a field...
If reading data is your problem
On desktop you can use:
answer file "Open File:"
Same as above but you now read data instead:
if it is not empty then
# We have a complete file path in 'it'
put it into tFile
put url ("file:" & tFile) into tData
end if
on mobile you probably would like to present a list with the user-created files. In LiveCode you can list all files in the defaultFolder with the files. But you must set the defaultFolder to the folder you want to list.
set the defaultFolder to specialFolderPath("Documents")
put the files into tFiles
Now tFiles contains every file in that folder and you can filter it, display it in a list etc. E.g:
filter tFiles with "*.txt"
put tFiles into
If your problem is how to remember the "current" file name
Whenever you restart your app every variable is reset. So everything you want to remember between runs needs to be saved before your app quits. And for that you need a predefined filename. SO then your procedure will be:
Read in the predefined file.
Grab the file name from within that file
Read the file
If your problem is something else
Sorry, then I misunderstood your question...

VB.NET: How to programatically create a text file in SSIS!

I would like to create a text file with some data i am manipulating in a script component and write it to a text file. i know how to write it to an existing text file, but what i would like to do is create the text file programmatically so i can name it textfile(TodaysDate).txt
How can i do this??
You can call File.CreateText(someString).
This method returns a StreamWriter which can be used to write to the file.
Remember to close the StreamWriter usinga using statement.
If you start with a sample of the text file that you want stored somewhere, you can use a file system task to copy the sample file to the correct name (make sure you copy so that it's still there for tomorrow). Then use an expression to set the file location in the file connection manager.