Sponsored Content
Top Forums Shell Programming and Scripting How to concatenate the files based upon the file name? Post 302839255 by sharsour on Thursday 1st of August 2013 02:20:03 AM
Old 08-01-2013
How to concatenate the files based upon the file name?

Hi Experts,

I am trying to merge multiple files into one file based upon the file name.

Code:
 
Testreport_Server1.txt         ============
MonitoringReport_Server1.txt============  CentralReport_Server1

Here two files containing server1 should be merged into one file?

How can i do this using shell. I was thinking something like below but not working

Code:
 
cat $DR_HOME/OS/Server1*.txt >> Central_Report_Server1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert file names when concatenate files into a file

Hi I found the following line would concatenate all test_01 test_02 test_03 files into "bigfile". cat test_* >> bigfile But, what I'm looking for a way to insert each file names in order when concatenated in "bigfile". Thank you samky2005 (2 Replies)
Discussion started by: samky2005
2 Replies

2. Shell Programming and Scripting

Concatenate multiple lines based.

Hello, I have been searching the forum for concatenation based on condition. I have been close enough but not got th exact one. infile: -----DB_Name ABC (X, Y,Z). DB_Name DEF (T). DB_Name GHI (U ,V,W). Desired Output file should be: ---------------------------DB_Name ABC... (8 Replies)
Discussion started by: indrajit_u
8 Replies

3. Shell Programming and Scripting

want to concatenate multiple files based on the rest of ls -lrt

uadm@4132> ls -lrt -rw------- 1 uadm uadm 3811819 Jun 6 04:08 data_log-2010.05.30-10:04:08.txt -rw------- 1 uadm uadm 716246 Jun 13 01:38 data_log-2010.06.06-10:04:08.txt -rw------- 1 uadm uadm 996 Jun 13 04:00 data_log-2010.06.06-10:04:22.txt -rw------- 1 uadm uadm 7471 Jun 20 02:03... (5 Replies)
Discussion started by: mail2sant
5 Replies

4. Shell Programming and Scripting

Concatenate files

I have directory structure sales_only under which i have multiple directories for each dealer example: ../../../Sales_Only/xxx_Dealer ../../../Sales_Only/yyy_Dealer ../../../Sales_Only/zzz_Dealer Every day i have one file produce under each directory when the process runs. The requirement... (3 Replies)
Discussion started by: mohanmuthu
3 Replies

5. Shell Programming and Scripting

Concatenate files to one file with naming convention

Hi , i have below files in wrk folder. file names are 1102090001.CLT 1102090003.CLT 1102100019.CLT 1102100020.CLT the above files are concatenate to one file but that concatenate file name must be same naming convention. (date +%y%m%d)and 0001 count. example : concatenate file... (9 Replies)
Discussion started by: krbala1985
9 Replies

6. Shell Programming and Scripting

Concatenate files

Hi, I want to create a batch(bash) file to combine 23 files together. These files have the same extension. I want the final file is save to a given folder. Once it is done it will delete the 23 files. Thanks for help. Need script. (6 Replies)
Discussion started by: zhshqzyc
6 Replies

7. Shell Programming and Scripting

Concatenate many files which contents the same date as part of name file

Gents, I have lot of files in a folder where each file name includes the date of generation, then I would like to merge all the files for each date in a complete file. list of files in forder. dsd01_121104.txt dsd01_121105.txt dsd01_121106.txt dsd03_121104.txt dsd03_121105.txt... (7 Replies)
Discussion started by: jiam912
7 Replies

8. UNIX for Dummies Questions & Answers

Concatenate Several Files to One

Hi All, Need your help. I will need to concatenate around 100 files but each end of the file I will need to insert my name DIRT1228 on each of the file and before the next file is added and arrived with just one file for all the 100files. Appreciate your time. Dirt (6 Replies)
Discussion started by: dirt1228
6 Replies

9. UNIX for Dummies Questions & Answers

Concatenate files and delete source files. Also have to add a comment.

- Concatenate files and delete source files. Also have to add a comment. - I need to concatenate 3 files which have the same characters in the beginning and have to remove those files and add a comment and the end. Example: cat REJ_FILE_ABC.txt REJ_FILE_XYZ.txt REJ_FILE_PQR.txt >... (0 Replies)
Discussion started by: eskay
0 Replies

10. Shell Programming and Scripting

Concatenate files based on names

Dear all, I have a list of files and I woulk like to concatenate some of them based on their name. Basically my files are names like that: file1_abcd_other_useless_letters_1_C1.txt file1_abcd_other_useless_letters_1_C2.txt file1_xywz_other_useless_letters_1_C1.txt... (4 Replies)
Discussion started by: giuliangiuseppe
4 Replies
GRI_MERGE(1)						      General Commands Manual						      GRI_MERGE(1)

NAME
gri_merge - merge multiple Gri output files into a single PostScript file. USAGE (style 1): gri_merge [OPTIONS] CxR a.ps b.ps ... > merged_file.ps Merges the files onto one page, in 'C' columns and 'R' rows. The CxR files are given in the order of words on a page. The page is pre- sumed to be 8.5x11in in size, as are all the input files, and the input files are sized to fit, and kept in natural scale. USAGE (style 2): gri_merge [OPTIONS] xcm ycm enlarge a.ps [b.ps ...] > merged_file.ps Where `enlarge' is a scale factor applied after offsetting `xcm' to the right and `ycm' upward. EXAMPLE (style 2): The following gri_merge 2 12 .5 a.ps 12 12 .5 b.ps 2 2 .5 c.ps 12 2 .5 d.ps > all.ps produces 4 panels from gri plots done using margins and sizes as specified in the following lines in a gri commandfile set x margin 2 set x size 15 set y margin 2 set y size 15 The OPTIONS, available if your 'perl' has 'getopts' library, are: -u graylevel -- set graylevel for underlay beneath panels, by default 0.75. Values range from 0 (black) to 1 (white), although a value of precisely 1 means do NOT draw underlay. -b graylevel -- Set value for background under individual panels, again 0 for black to 1 for white, with 1 meaning no drawing. -h -- Print this help message and quit. SEE ALSO
gri(1), gri_unpage(1) gri_merge 2009 GRI_MERGE(1)
All times are GMT -4. The time now is 12:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy