Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Shell Script to Read the given file contents into a merged one file Post 303034821 by Siva SQL on Tuesday 7th of May 2019 12:29:22 PM
Old 05-07-2019
Shell Script to Read the given file contents into a merged one file

Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.

While reading and merging the file contents into a single file, Like to keep the format of the source file.

Code:
/app/oracle/build_lib/wrkfldr952.0_20150614/ddl/alter_modify_keg.sql 
/app/oracle/build_lib/wrkfldr952.0_20150614/ddl/alter_modify_kim.sql
/app/oracle/build_lib/wrkfldr952.0_20150614/ddl/client_cmpmadr1.sql 
/app/oracle/build_lib/wrkfldr952.0_20150614/ddl/client_cmpmaur1.sql 
/app/oracle/build_lib/wrkfldr952.0_20150628/ddl/alter_modify_keg.sql
 /app/oracle/build_lib/wrkfldr952.0_20150628/ddl/alter_modify_kim.sql

------ Sample Output ----
1. Reading the file# /app/oracle/build_lib/wrkfldr952.0_20150614/ddl/alter_modify_keg.sql
Code:
aaa
  aaa
aa

2. Reading the file# /app/oracle/build_lib/wrkfldr952.0_20150614/ddl/alter_modify_kim.sql
Code:
bbbbbbbbb
#sssss   tttt 523


Thanks, Siva SQL


Moderator's Comments:
Mod Comment
Please wrap all code, data/files, input & output/errors in CODE tags.
It makes it far easier to read an preserves spacing for indenting or fixed-width data.

Last edited by rbatte1; 05-08-2019 at 08:37 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search for the contents in many file and print that file using shell script

hello have a file1 H87I Y788O T347U J23U and file2 J23U U887Y I99U T556U file3 I99O J99T F557J file4 N99I T666U R55Y file5 H87I T347U file6 H77U R556Y E44T file7 Y788O K98U H8I May be using script we can use file1 to search for all the files and have the output H87I file5... (3 Replies)
Discussion started by: cdfd123
3 Replies

2. Shell Programming and Scripting

update file contents using shell script

Hi, I am having a file which contains as below Names(aaaa ,bbbb ,cccc ,dddd) now i want the file to be updated with new value 'eeee' as below Names(aaaa ,bbbb ,cccc ,dddd ,eeee) Is there a way to script this ? Thanks, (5 Replies)
Discussion started by: drams
5 Replies

3. Shell Programming and Scripting

Shell script for converting file contents into CSV

Hi, I am new in unix, I just want to replace some values from text file according to column numbers. Like, I am having a table as given below: val1 val2 val3 val4 val5 val6 val7 val8 val9 val10 val11 val12 val13 Now i want... (5 Replies)
Discussion started by: rish_max
5 Replies

4. Shell Programming and Scripting

Need shell script to read two file at same time and print out in single file

Need shell script to read two file at same time and print output in single file Example I have two files 1) file1.txt 2) file2.txt File1.txt contains Aaa Bbb Ccc Ddd Eee Fff File2.txt contains Zzz Yyy Xxx (10 Replies)
Discussion started by: sreedhargouda
10 Replies

5. Shell Programming and Scripting

shell script to compare file contents

Hello Has anyone got an example shell script that I can use to compare the contents of two files. The files should contain the same contents, eg. file1.txt apple pear grape file2.txt apple pear grape (2 Replies)
Discussion started by: deedaz
2 Replies

6. Shell Programming and Scripting

script to read the contents of a file and print

Hi, Need help in writing a script to read the contents of this file test Test 00a 00b 00c 00d 00e 00f where it need to read each line to give a display such as form meta from dev 00a , config=Striped; add dev 00b:00f to meta 00a Can any one help me in writing this script (2 Replies)
Discussion started by: praveen1516
2 Replies

7. Shell Programming and Scripting

Replace partial contents of file with contents read from other file

Hi, I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file. i am able to... (2 Replies)
Discussion started by: seeki
2 Replies

8. Shell Programming and Scripting

Modifying contents of the file in shell script

Hello all, I have a Kconfig file that looks like something below ... ================================ menu "Application type" config GUI_TYPE_STANDARD bool "Standard Application" source "cfg/config/std.in" source... (12 Replies)
Discussion started by: anand.shah
12 Replies

9. Shell Programming and Scripting

Script for getting the file merged

Hi, I have two files separated by bars at each line File 1 : A|4356|13456|23456 A|4356|2986|98732 A|8765|218|1432567 File 2: B|12|13456|1234567 B|11|13456|123456789 B|33|2986|98732 B|11|2986|14578965 B|8765|218|147584 Common field is third field like 13456, 2986 and 218 in both... (5 Replies)
Discussion started by: Mannu2525
5 Replies

10. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
XGFMERGE(1)						      General Commands Manual						       XGFMERGE(1)

NAME
xgfmerge - merges two Xgridfit program files SYNOPSIS
xgfmerge [options] file-a file-b [...] DESCRIPTION
Xgfmerge merges two or more Xgridfit program files, where file-a is a program generated automatically from an existing font using TTX and ttx2xgf, and file-b and any other files in the list contain other programming for the font. Xgfmerge outputs the merged programming to stdout. To capture the output in a file, use this syntax: $xgfmerge -o merged-file.xgf file-a.xgf file-b.xgf Note: To merge Xgridfit instructions with those already in a font, the best method is now to run Xgridfit in merge-mode (option -m). OPTIONS
-c Look for a <default type="compile-globals"/> element in each file after the first in the list. If value="no" then ignore all <default>, <control-value>, <function>, <macro> and <pre-program> elements in the file. -h Display a help message. -n Merge <no-compile> elements from all files. <glyph> elements with duplicate "ps-name" attributes are ignored. -o file The file to write the output to. If this option is not used, output is written to stdout. -p When a <pre-program> element in a file other than file-a is available, use it instead of the one from file-a. If this option is not present, xgfmerge merges the programming in the <pre-program> of file-a with that in the <pre-program> of whichever file is being merged at the moment. The result is unlikely to be good if a single run of xgfmerge merges the contents of more than two <pre- program> elements. -s Sort <glyph> elements in the output file into alphabetical order. -v Verbose output: xgfmerge tells you what it is doing at each step. -x Resolve XIncludes before merging all files in the list except for file-a. Any XIncludes from file-a.xgf are stripped out of the files before this operation is performed. If XInclude is used to bring global elements (<control-value>, <function>, etc.) into these files, it is probably a good idea to use the -c option as well. FILES
/usr/share/xml/xgridfit/util/merge.xsl An XSLT script that performs the merge. /usr/share/xml/xgridfit/util/xinclude.xsl An XSLT script that strips out unwanted XIncludes. /usr/share/xml/xgridfit/util/sort-glyphs.xsl An XSLT script that sorts glyph elements in a file. /usr/share/xml/xgridfit/utils/add-blanks.sed Does some formatting of the output. SEE ALSO
xgridfit(1), ttx(1), ttx2xgf(1). AUTHOR
Xgfmerge was written by Peter Baker <psb6m@virginia.edu>. This manual page was written by Peter Baker 2009-12-18 XGFMERGE(1)
All times are GMT -4. The time now is 05:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy