Sponsored Content
Top Forums Shell Programming and Scripting In PErl script: need to read the data one file and generate multiple files based on the data Post 303014313 by Sanjeev G on Friday 9th of March 2018 06:48:44 AM
Old 03-09-2018
Thanks Aia, It working fine for below condition.
If we want to add/append few lines in all the the file which was generated,Could you please help with the logic.

want to add below data in all the output file

Example :


Code:
EXTRACT e1_bill1
SETENV (ORACLE_SID = "TV19DBM")
SETENV (ORACLE_HOME = /opt/oracle/product/11.2.0.4/db_1)
SETENV (NLS_LANG = "AMERICAN_AMERICA.US7ASCII")
 
--USERID GGSCHEMA, PASSWORD , &
USERID 4444444A@xxxxxx, PASSWORD "xxxxxx"
 
TRANLOGOPTIONS DBLOGREADER
TRANLOGOPTIONS excludeuser GGSCHEMA
TRANLOGOPTIONS excludeuser esg_dba
nocompressupdates -- Include the full record
nocompressdeletes -- Include the full record
-- To avoid need to delete log manually[but may need to enable it in Dataguard Environemnt]
--TRANLOGOPTIONS LOGRETENTION DISABLED
-- Cache Manger parameter to limit memory utilization by extract
CACHEMGR CACHESIZE 1GB
-- Must be used together and directs Extract to fetch data from the source table if it cannot fetch
FETCHOPTIONS USELATESTVERSION, NOUSESNAPSHOT
--Warns for a long running transaction
WARNLONGTRANS 1h, CHECKINTERVAL 10m


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-09-2018 at 09:01 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read the data from multiple files and sum the value

Hi all, I have a requirement where i have to read multiple files using Shell Script in Korn Shell. each file will have the 3rd line as the amount field, i have to read this amount field and sum it for all the files. any idea on how to achieve this?? (i think i can achieve it using a loop,... (9 Replies)
Discussion started by: nvuradi
9 Replies

2. Shell Programming and Scripting

generate report based on data in files.

Hi All, I need to develop a shell script which does sanity check of a data file, as below. 1. For DATE columns, it should check if date is given in proper format or not? For example, if format of date is expected as DD-MON-YYYY HH24:MI:SS and we received the date in formation like DDMMYYYY HH24,... (1 Reply)
Discussion started by: ace_friends22
1 Replies

3. Shell Programming and Scripting

Read Data from Config file using Perl

Hi All, Can anyone please explain me how to read data from config file in Perl. Suppose i have a config file named cfile. The data in config file is name=parth lname=mittal user=2007 hostname=fluoride username=parthmittal password=XXXXXX account=unix url=www.unix.com ... (2 Replies)
Discussion started by: parthmittal2007
2 Replies

4. Shell Programming and Scripting

Read multiple files, parse data and append to a file

Hi..Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files In the below files, we are interested in File 1: 38 107 C 3 T 6 C/T 38 241 C 4 T 5 C/T 38 247 T 4 C 5 T/C 38 259 T 3 C 6 T/C... (8 Replies)
Discussion started by: empyrean
8 Replies

5. Shell Programming and Scripting

Generate tabular data based on a column value from an existing data file

Hi, I have a data file with : 01/28/2012,1,1,98995 01/28/2012,1,2,7195 01/29/2012,1,1,98995 01/29/2012,1,2,7195 01/30/2012,1,1,98896 01/30/2012,1,2,7083 01/31/2012,1,1,98896 01/31/2012,1,2,7083 02/01/2012,1,1,98896 02/01/2012,1,2,7083 02/02/2012,1,1,98899 02/02/2012,1,2,7083 I... (1 Reply)
Discussion started by: himanish
1 Replies

6. Shell Programming and Scripting

Need a perl script to read and write the data

Hi, I have on Designdocument in that information is stored with in tabular format.I need Perlscript to read and write the datausing perl script? Regards, Ravi (0 Replies)
Discussion started by: toravi.pentaho
0 Replies

7. Shell Programming and Scripting

Need a UNIX/perl script to read and write the data

Hi, I have on Designdocument in that information is stored with in tabular format.I need Perl/unix script to read and write the data using perl script? Regards, Ravi (4 Replies)
Discussion started by: toravi.pentaho
4 Replies

8. Shell Programming and Scripting

Generate Join clause based on key data

Hi, I have a file pk.txt which has pk data in following format TableName | PK Employee | id Contact|name,country My Output should be Employee | t1.id=s.id Contact| t1.name=s.name AND t1.country=s.country I started of like this: for LIST in `cat pk.txt` do... (5 Replies)
Discussion started by: wahi80
5 Replies

9. Shell Programming and Scripting

Read multiple text files and copy data to csv

hi i need to extract lines from multiple files to a csv file. for example, i have these 3 files file1.txt date:29dec1980 caller:91245824255 called:8127766 file2.txt date:11apr2014 caller:9155584558 called:8115478 file3.txt date:25jun2015 caller:445225552 called:8117485 (30 Replies)
Discussion started by: lp.descamps
30 Replies

10. UNIX for Beginners Questions & Answers

Generate files and use csv data to replace multiple variables in a template

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)
Discussion started by: apalex
3 Replies
SETENV(3)						     Linux Programmer's Manual							 SETENV(3)

NAME
setenv - change or add an environment variable SYNOPSIS
#include <stdlib.h> int setenv(const char *name, const char *value, int overwrite); int unsetenv(const char *name); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): setenv(), unsetenv(): _BSD_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 DESCRIPTION
The setenv() function adds the variable name to the environment with the value value, if name does not already exist. If name does exist in the environment, then its value is changed to value if overwrite is nonzero; if overwrite is zero, then the value of name is not changed. This function makes copies of the strings pointed to by name and value (by contrast with putenv(3)). The unsetenv() function deletes the variable name from the environment. If name does not exist in the environment, then the function suc- ceeds, and the environment is unchanged. RETURN VALUE
The setenv() function returns zero on success, or -1 on error, with errno set to indicate the cause of the error. The unsetenv() function returns zero on success, or -1 on error, with errno set to indicate the cause of the error. ERRORS
EINVAL name is NULL, points to a string of length 0, or contains an '=' character. ENOMEM Insufficient memory to add a new variable to the environment. CONFORMING TO
4.3BSD, POSIX.1-2001. NOTES
POSIX.1-2001 does not require setenv() or unsetenv() to be reentrant. Prior to glibc 2.2.2, unsetenv() was prototyped as returning void; more recent glibc versions follow the POSIX.1-2001-compliant prototype shown in the SYNOPSIS. BUGS
POSIX.1-2001 specifies that if name contains an '=' character, then setenv() should fail with the error EINVAL; however, versions of glibc before 2.3.4 allowed an '=' sign in name. SEE ALSO
clearenv(3), getenv(3), putenv(3), environ(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2009-09-20 SETENV(3)
All times are GMT -4. The time now is 12:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy