Sponsored Content
Top Forums Shell Programming and Scripting Combine 3 files based on a pattern Post 302861771 by rparavastu on Wednesday 9th of October 2013 03:32:51 PM
Old 10-09-2013
Oracle Combine 3 files based on a pattern

HI,

I have 3 files that contain the following information (sql output from Oracle database stored in a txt file):

File1.txt :
Code:
alter table "SYS"."INT_COST_PRICE" enable row movement;
alter table "SYS"."INT_SOH" enable row movement;
alter table "SYSMAN"."XX_ACI_SKURTP" enable row movement;

second file contains the following information (source same as above):
File2.txt
Code:
alter table "SYS"."INT_COST_PRICE" shrink space compact;
alter table "SYS"."INT_SOH" shrink space compact;
alter table "SYSMAN"."XX_ACI_SKURTP" shrink space compact;

Third file contains the following information (source same as above):
File3.txt
Code:
alter table "SYS"."INT_COST_PRICE" disable row movement;
alter table "SYS"."INT_SOH" disable row movement;
alter table "SYSMAN"."XX_ACI_SKURTP" disable row movement;

I would like to combine the files together into one single file and having an output as shown below (with blank lines after every 3 lines:

Final_output_file.txt

Code:
alter table "SYS"."INT_COST_PRICE" enable row movement;
alter table "SYS"."INT_COST_PRICE" shrink space compact;
alter table "SYS"."INT_COST_PRICE" disable row movement;

alter table "SYS"."INT_SOH" enable row movement;
alter table "SYS"."INT_SOH" shrink space compact;
alter table "SYS"."INT_SOH" disable row movement;

alter table "SYSMAN"."XX_ACI_SKURTP" enable row movement;
alter table "SYSMAN"."XX_ACI_SKURTP" shrink space compact;
alter table "SYSMAN"."XX_ACI_SKURTP" disable row movement;

Kindly help me out.

Thanks,
Ram.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to combine 2 lines in same files based on any text

hi, I want to combine two lines in same file. If the line ends with '&' it should belongs to previous line only Here i am writing example. Ex1: line 1 : return abcdefgh& line 2 : ijklmnopqr& line 3 : stuvw& line 4 : xyz output should be line 1: return abcdefghijklmnopqrstuvwxyz ... (11 Replies)
Discussion started by: spc432
11 Replies

2. Shell Programming and Scripting

Combine the lines based on particular pattern

Hi, I've a weird problem to be solved. Assume i have a file like this: 1. <timestamp> UID: 12345 <junk> DevID: V123 2. <timestamp>DevID: V123 <junk> DuID: VP 3. ... 4. .... 5. <timestamp> UID: 789 <junk> DevID: S456 6. <timestamp>DevID: S456 <junk> DuID: VP.... 7. ..... Say if i... (3 Replies)
Discussion started by: VenkataPrasad
3 Replies

3. Shell Programming and Scripting

How to combine two files based on fields?

I have two files which are as follows: File 1: 1 abc 250 2 pqr 300 3 xyz 100 File 2: 1 abc 230 2 pqr 700 3 xyz 500 Now I need output File, File 3as: S.No Name Count1 Count2 1 abc 250 230 2 pqr 300 700 3 xyz 100 500 NOTE: (13 Replies)
Discussion started by: karumudi7
13 Replies

4. Shell Programming and Scripting

combine lines from two files based on an if statement

I'm rather new to programming, and am attempting to combine lines from 2 files in a way that is way beyond my expertise - any help would be appreciated! I need to take a file (file1) and add columns to it from another file (file2). However, a line from file2 should only be added to a given line... (3 Replies)
Discussion started by: Cheri
3 Replies

5. UNIX for Advanced & Expert Users

Moving multiple files based on the pattern

I want to search for a particular file name patterns and move them to a specific folder, is it possible to do it with awk or sed? (1 Reply)
Discussion started by: rudoraj
1 Replies

6. Shell Programming and Scripting

Copying files based on a pattern

Hi All, I need to find and list the last 5 days files in that exact name with "MIM" and copy to another directory. please help me in this there is around 30000 files Thanks Murali (7 Replies)
Discussion started by: 969murali@gmail
7 Replies

7. UNIX for Dummies Questions & Answers

List only files based on a pattern

Hi Gurus, I need to list only the files with out certain extension. For eg from the following list of files: I need to only list: Thanks Shash (7 Replies)
Discussion started by: shash
7 Replies

8. Shell Programming and Scripting

Moving old files based on pattern

Hi all I am trying to loop through a directory of files using a given search pattern. some of the files will be duplicated due to the pattern, but of the duplicate files i wanted to move the older files to another location. Is there any straightforward way of doing this ? One of ways I... (1 Reply)
Discussion started by: sthapa
1 Replies

9. Shell Programming and Scripting

Finding all files based on pattern

Hi All, I need to find all files in a directory which are containing specific pattern. Thing is that file name should not consider if pattern is only in commented area. all contents which are under /* */ are commented all lines which are starting with -- or if -- is a part of some sentence... (13 Replies)
Discussion started by: Lakshman_Gupta
13 Replies

10. Shell Programming and Scripting

Combine and complete multiple CSV files based on 1 parameter

I have to create a new CSV file based on the value listed on the 3rd column from different CSV files. This is what I need: 1. I should substitute the first column from each file, excluding the headers, with the file name InputXX. 2. Then, I need to look for rows with 0 on the third column in... (7 Replies)
Discussion started by: Xterra
7 Replies
ptree_create_table(3PICLTREE)				  PICL Plug-In Library Functions			     ptree_create_table(3PICLTREE)

NAME
ptree_create_table, ptree_add_row_to_table - create a table object SYNOPSIS
cc [ flag... ] file... -lpicltree [ library... ] #include <picltree.h> int ptree_create_table(picl_prophdl_t *tbl_hdl); int ptree_add_row_to_table(picl_prophdl_t tbl_hdl, int nprops, picl_prophdl_t *proph); DESCRIPTION
The ptree_create_table() function creates a table object and returns the handle of the table in tbl_hdl. The ptree_add_row_to_table() function adds a row of properties to the table specified by tbl_hdl. The handles of the properties of the row are specified in the proph array and nprops specifies the number of handles in the array. The number of columns in the table is determined from the first row added to the table. If extra column values are specified in subsequent rows, they are ignored. The row is appended to the end of the table. RETURN VALUES
Upon successful completion, 0 is returned. On failure, a non-negative integer is returned to indicate an error. PICL_STALEHANDLE is returned if the handle is no longer valid. This occurs if the PICL tree was refreshed or reinitialized. PICL_INVALIDHANDLE is returned if the specified handle never existed. ERRORS
PICL_INVALIDARG Invalid argument PICL_NOTPROP Not a property PICL_NOTTABLE Not a table PICL_INVALIDHANDLE Invalid handle PICL_STALEHANDLE Stale handle PICL_FAILURE General system failure ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) SunOS 5.11 28 Mar 2000 ptree_create_table(3PICLTREE)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy