Property file processing in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Property file processing in unix
# 1  
Old 08-29-2012
Property file processing in unix

Hi genius,
Following is the problem.
We have one templete file(input file) where some variables will be used
Example:
Code:
word1 word2 &{word3}
word4 ${word5} word6

And also we have one property file where we define these variables
Example:
Code:
word3= something
Word5= something

Need to read the property file and read the variables there and generate output file

Example:
Code:
word1 word2 something
word4 something word6

Can you please give me a solutions for this?

Regards
Gjarms


Moderator's Comments:
Mod Comment Please use code tags next time for your code and data.

Last edited by zaxxon; 08-29-2012 at 10:37 AM.. Reason: code tags
# 2  
Old 08-29-2012
We can help you once you start helping yourself.
What have you tried so far?
# 3  
Old 08-29-2012
just source the file before which will be referenced
# 4  
Old 08-29-2012
What is the difference between &{var} and ${var}?

What is the syntax for word3= something? Is something always a single "word"? Is everything after the "=" to the end of the line supposed to be part of the expansion of ${var} or &{var}? Is the space in " something" important? (In your example, it appears that the space should be discarded, but since you didn't put code tags around in your posting, we can't tell if there are supposed to be multiple adjacent spaces in your desired output.)
# 5  
Old 08-29-2012
Hi All,
first of all sorry for missing the code tags.
Answering to the questions, there is no diference between & and $. It was a typo and also there is no space after=. basically I was trying to do this using fmpp ant task, but not able to do it.
# 6  
Old 08-29-2012
Ok, but again: What have you tried so far?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Parse property from json file

Hello All, Greetings.. I have a json file that I need to pase its URLs and other values. The match should start with "notifications" and output URLs and settings values. I tried with python or awk but hardly could get URLs only. Or whole URLs from full json file. Could not match... (2 Replies)
Discussion started by: 7adi
2 Replies

2. Shell Programming and Scripting

How to log file processing details to database table usnig UNIX shell script?

we are getting files on daily basis.we need to process these files. i need a unix shell script where we can count 1-The no of files processed 2-No of data/record processed for each files. The script should log these details into a database table. If there is any error while file... (3 Replies)
Discussion started by: Atul kumar
3 Replies

3. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

4. Shell Programming and Scripting

reading and updating property file

I have to do a read operation for a field in property file, which looks like follows: 123|xyz|datetime|count '|' is delimiter. Finally I managed to read the contents of property file using statement like cut -d"|" -f1 $PROPERTIES_FILE | tr '\n' ' ' <-- Reading first column But now I... (2 Replies)
Discussion started by: rakeshranjanscs
2 Replies

5. Shell Programming and Scripting

Report a missing property and property value mis match script.

Hi All, I have 2 properties files - one is a master templete and other one is a node specific properties file, I need to comapre these 2 properties files and make sure the node Specific properties file contains all the properties in the master temple properties file else report the missing... (5 Replies)
Discussion started by: jayka
5 Replies

6. Shell Programming and Scripting

change word in a property file

Hi, I have a property file called "inspector.properties". In this property file stands the following: inspect=ON Now I want to have a shell script that when you run it, changes the ON in OFF in this property file. Is this possible with sed? Can anybody help me with this? Tnx very much. (5 Replies)
Discussion started by: thebladerunner
5 Replies

7. Shell Programming and Scripting

perl use property file for variables

if I have a file that contains variables. How do I assign them in a script. file p=c e=g Thanks (3 Replies)
Discussion started by: 3junior
3 Replies

8. UNIX for Advanced & Expert Users

Processing extended ascii character file names in UNIX (BASH scipts)

Hi, I have a accentuated letter (ö) in a script for an Installer. It's a file name. This is not working and I'm told to try using the octal value for the extended ascii character. Does anyone no how to do this? If I had the word "filförval", can I just put in the value between the letters, like... (9 Replies)
Discussion started by: peli
9 Replies

9. UNIX for Dummies Questions & Answers

Help with Unix File Processing

Hi, Does anyone know of a Unix command that would give me the most recent file from a list of files with the same names except for the date/time stamp, i.e. kah_en_20070103T2234307Z.zip (with an actual date/time stamp of 1/3/07 4:41 pm), kah_en_20070104T054732Z.zip (with an actual date/time stamp... (6 Replies)
Discussion started by: tls77065
6 Replies
Login or Register to Ask a Question