Merge multiple files found in config file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Merge multiple files found in config file
# 8  
Old 01-27-2012
Edit the jsdir variable, remove the slash at the end...
Code:
jsdir="./js"

--ahamed
This User Gave Thanks to ahamed101 For This Post:
# 9  
Old 01-27-2012
gah, sorry about that. Thanks so much, ahamed!

---------- Post updated at 12:51 AM ---------- Previous update was at 12:18 AM ----------

I'm trying to modify the script for another section (<concat destfile="${standard.css.file}"...) but oddly, even when I change the line on your script from:

Code:
/standard.js.file/

to
Code:
/standard.css.file/

it's still including the JS block. Is there something else in there that I'm missing?
# 10  
Old 01-27-2012
Escape the . (dots)... Try this... /standard\.css\.file/

--ahamed
This User Gave Thanks to ahamed101 For This Post:
# 11  
Old 01-27-2012
Quote:
Originally Posted by ahamed101
Escape the . (dots)... Try this... /standard\.css\.file/

--ahamed
Already tried that -- same result.

---------- Post updated at 01:33 AM ---------- Previous update was at 01:04 AM ----------

Figured it out -- the values for standard.css.file and standard.js.file we being set above, so it was finding those in the awk, then using all of the stuff below that -- the JS is the first set, so it was including that.

I just added more specificity, /\{standard\.css\.file/

Now it works perfectly. Thanks again!
# 12  
Old 02-29-2012
Back again :-/

The build script was changed so that each file is on its own line, like so:


Code:
<concat destfile="${standard.js.file}" append="true">    
    <filelist dir="${js.dir}"
        files="foo.js,
               foo2.js,
               etc.js" />
</concat>

Which this bit does not account for:

Code:
    javascript_files=$(awk -F"[=\"]" '
            /\{standard\.js\.file/,/<\/concat>/{
            if(/filelist/){dir=$3;l=split($6,arr,", ")
            for(i=1;i<=l;i++){val=val" "dir"/"arr[i]}}}
            END{print val}' build.xml )

Any thoughts on how to handle the new format?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Merge Multiple html files into one

Hi all I have written some code to write my output in html. As i have multiple servers, need to generate single html file. but my code is generating html file for each server. I have merged the files using below code. cat /home/*_FinalData.html > /home/MergedFinalData.html But how to... (1 Reply)
Discussion started by: Snehasish
1 Replies

2. Shell Programming and Scripting

How to merge the multiple data files as a single file?

Hi Experts, I have created multiple scripts and send the output to new file, getting this output to my mailbox on daily basis. I would like to send the all outputs to a single file, need to merge all file outputs on a single file. For example, Created script for df -h > df.doc grep... (7 Replies)
Discussion started by: seenuvasan1985
7 Replies

3. Shell Programming and Scripting

Merge columns from multiple files

Hello and Good day I have a lot of files with same number of rows and columns.$2 and $3 are the same in all files . I need to merge $2,$3,$6 from first file and $6 from another files. File1: $1 $2 $3 $4 $5 $6... (8 Replies)
Discussion started by: ali.seifaddini
8 Replies

4. Shell Programming and Scripting

Merge the multiple text files into one file

Hi All, I am trying to merge all the text files into one file using below snippet cat /home/Temp/Test/Log/*.txt >> all.txt But it seems it is not working. I have multiple files like Output_ServerName1.txt, Output_ServreName2.txt I want to merge each file into one single file and... (6 Replies)
Discussion started by: sharsour
6 Replies

5. UNIX for Dummies Questions & Answers

Merge multiple files

Hi All, How can I merge 3rd column of multiple files into 1 file, the column header in the merged file being the name of the file from which the 3rd column was taken. The first 2 columns of all the files are exactly same. Thanks for your help ! (3 Replies)
Discussion started by: newbie83
3 Replies

6. UNIX for Advanced & Expert Users

merge two column multiple files into one

Hi I have multiple files each with two columns and I need to combine all those file into a tab delimited file. (multiple entry with same name separated by a comma) The content of the files are as follows: --- file1.txt: name var1 aaa xx aaa gg bbb yy ddd zz --- file2.txt ... (8 Replies)
Discussion started by: mary271
8 Replies

7. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

8. Shell Programming and Scripting

Merge Multiple Files and Transpose

Looking to join three files and then transpose some columns from multiple rows into a single row. File Info: FIELD TERMINATED BY '^' ENCLOSED BY '~' LINE TERMINATED BY '\r\n' FIRST FILE (FOOD_DES.txt) ~01001~^~0100~^~Butter, salted~^~BUTTER,WITH... (2 Replies)
Discussion started by: mkastin
2 Replies

9. Shell Programming and Scripting

parsing config file to create new config files

Hi, I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below. I will be using the config file as mentioned below: (config.txt) country:a,b city:1,2 type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies

10. UNIX for Advanced & Expert Users

Merge multiple .so files

Hi all, I am developing an application in Tcl, inwhich i have to load many modules written in C. I am converting those C modules into shared object(.so) files, and wrap it with my application using SWIG, for which i had the interface file. Now my question is, i have two different... (2 Replies)
Discussion started by: senthilvnr
2 Replies
Login or Register to Ask a Question

Featured Tech Videos