Yes, you are right, with the "w" you can write the output to a file.
but the syntax should be as follows:
Where "TEMPLATE" will be the outputfile.
Did yo realize that you have used the FILENAME variable at both, the "read" as well as the input file name?
Well... guess I'll try "w" next time now I know how it works ... does it have any difference to > after all?
As for the FILENAME var... I actually read it from the CSV archive (it is one of the columns) and then I apply it as the name of the output file (that's what I did on my finished script... but right, at my first example it was (wrongly) on the input file). That "while read" now reads:
Again, this is just an example on who it looks now... I'll post the actual script later
---------- Post updated 07-27-09 at 01:10 PM ---------- Previous update was 07-26-09 at 02:08 PM ----------
One last thing...
one of the columns on the csv file has values with spaces on it (i.e: interface name) but sed brings that around quotes (i.e: "interface name") and in some cases, it brings in quotes and adds a string to the end (i.e: "interface name"ESS).
What gives? Is there a way to tell sed not to do that?
By the way.... as promissed, here is the script that is working now:
Hi,
I have a configuration file(which has values) and a template file(where the values are dummied)
Configuration file (a.txt)
--------------------
var1=1521
var2=172.10.10.10
var3=emp
.
.
.
var15=hhhhhhh
Template file (b.txt)
--------------------
The host name is $var2.
The... (5 Replies)
Hi All,
I'm new to the forum and not a programmer, but I'm writing a bash script to preprocess definitions of technical terms by inserting hyperlinks pointing to other pages in the glossary before the pages are posted to our server, using a standard naming convention for the pages. The... (3 Replies)
Hi fellas,
I have two files such as:
File 1
interacao,AspAsp,AspCys,CysAsp,CysCys,classe
File 2
interacao,AspAsp,CysAsp,AspCys,CysCys,classe
beta_alfa, DA, CA, DD, CD,ppi
Thus, I want to make a File 3 using the File 1 as model:
e.g.
File 3... (2 Replies)
Hi all,
I have a template form to fill in for quite a number of files and I want to automate the filling-in process. the concept seemed to be simple but i cant get it work. the template form is a text file containing the information below:
File Name:
Date Created:
Contents:
I need to... (4 Replies)
Dear All,
I have a template xml file like below.
....Some---Header.......
<SignalPreference>
...
<SignalName>STRING</SignalName>
...
</SignalPreference>
......Some formatting text.......
<SignalPreference>
.........
... (3 Replies)
Hi,
I have hit a bit of a brick wall.:confused:
need the following code edited:
echo "<?xml version=\"1.0\"?><dailyBalance_ROWSET>" > ${DataDir}/${extract_script}${ApplicationDate}.${Suffix}
RunSQL ${extract_script} ${ActionFlag}
echo "</dailyBalance_ROWSET>" >>... (2 Replies)
Hi I have a CommonTemplateStop.template file . Inside the file i need to replace the variables DepName and CompInsName with the values(Trade and TradeIns) specified in the script. I have written the below .sh script in linux server which will read the .template file and has to replace the 2... (8 Replies)
Hi,
I have a .csv file that contains a variety of fields for 60 clients: USERNAME, PASSWORD, and COMMENTS. I have a template file which contains a great deal of data for each client and has the fields USERNAME, PASSWORD, and COMMENTS that has to be filled with the values of USERNAME,... (1 Reply)
I am preparing a morphological grammar of Marathi to be placed in open-source.
I have two files.
The first file called Adverbs contains a whole list of words, one word per line
A sample is given below:
आधी
इतक
इतपत
उलट
एवढ
ऐवजी
कड
कडनं
कडल
कडील
कडून
कडे
करता
करिता
खाल (2 Replies)
I have a source csv file consists of first field as variable name, and the rest are site-specific information (converted from excel file, where site -specific values in columns). I am trying to create a file for every site using a template and replace the multiple variables with values from the... (3 Replies)