Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Properties File Variable Concatenation

Tags:

properties

I have a properties file where I'd like to define a file path as a variable and then reference it. This is causing a file not found exception:

test.folder=C:/code/
file={test.folder}File.csv

But this works:

file=C:/code/File.csv

What am I doing wrong?

like image 832
ABC123 Avatar asked Jul 28 '14 20:07

ABC123


People also ask

Can you concatenate variables?

In JavaScript, we can assign strings to a variable and use concatenation to combine the variable to another string. To concatenate a string, you add a plus sign+ between the strings or string variables you want to connect.

What is concatenation in variable?

Concatenation is the process of appending one string to the end of another string. You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs. For string variables, concatenation occurs only at run time.


1 Answers

This should works:

test.folder=C:/code/

file=${test.folder}File.csv
like image 50
user4419622 Avatar answered Oct 19 '22 17:10

user4419622