Sponsored Content
Top Forums Shell Programming and Scripting Appending error messages from log file next to the corresponding error record Post 302444077 by guruprasadpr on Tuesday 10th of August 2010 11:51:46 PM
Old 08-11-2010
Hi
Not exactly as you wanted, you can modify it a bit to satisfy your exact requirement:

Assuming your bad and log files are a.bad and a.log:

Code:
# cat a.bad
333abc22ef
444efg22ef
# cat a.log
SQL*Loader: Release 10.2.0.1.0 - Production on Thu Aug 5 18:04:41 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
-------------------------------------
----------- some info here----------
-------------------------------------
Record 2: Rejected - Error on table EMP, column EMP_ID.
ORA-01861: literal does not match format string

Record 3: Rejected - Error on table EMP, column EMP_NAME.
ORA-01861: literal does not match format string
---------------------------------------
--------some info here----------------
---------------------------------------
# awk 'NR==FNR{a[i++]=$0;next;}/Error on/{getline x;print a[j++],$0,x;}' a.bad a.log
333abc22ef Record 2: Rejected - Error on table EMP, column EMP_ID. ORA-01861: literal does not match format string
444efg22ef Record 3: Rejected - Error on table EMP, column EMP_NAME. ORA-01861: literal does not match format string
#

Guru.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

appending spaces to first line based on second record.

Hi, I have a situation to append spaces to end of first record (header)and last record (footer) based on second record length. The first record length is always 20.The second record will be different for different files.I have to append spaces for the first line based on second record... (2 Replies)
Discussion started by: ammu
2 Replies

2. HP-UX

How to Redirect the error messages from Syslog file to our own Application Log File

Hello, I am New to Unix. I am Using HP-UX 9000 Series for my Application. I am Currently Facing an Issue that the error messages are being written in the syslog file instead of the Application Log File. The Codes for that Syslog.h is written in Pro*C. I want to know how to Redirect these... (3 Replies)
Discussion started by: balasubramaniam
3 Replies

3. Shell Programming and Scripting

sqlplus error output to different error log file

HELLO, I am using such a command to write oracle sqlplus query result to text file: sqlplus -S xxx/xxx@xxxxxxx @\tmp\2.sql>\tmp\123.txt Is it possible to script that: If command succesfull write in \tmp\log.txt: timestamp and "succeded" and create 123.txt with results else If error... (2 Replies)
Discussion started by: tomasba
2 Replies

4. Shell Programming and Scripting

Error while appending records to a file

Hi, I have a sample file which contains records. Input File : 1 user1 username1\password@database-name 2 user2 username2\password@database-name 3 user3 username1\password@database-name I should search for a 'username1\' in those records. If 'username1\' is found in those records, that record... (7 Replies)
Discussion started by: siri_886
7 Replies

5. UNIX for Dummies Questions & Answers

Appending error

Hi All, I just want to append the value in variable at the end of the file. var=1234 sed -e "$a $var" file1 > file 2. But I get this error sed: -e expression #1, char 4: unknown command: `1' Kindly let m know how can I do that... (5 Replies)
Discussion started by: waqar1
5 Replies

6. Shell Programming and Scripting

need help in search the error messages from log file

Hi, My log file has error messages, universal no and universal ID. The problem is i have to search Universal ID from the error messages. But the log file write error messages with universal no and error messages in one line. and universal no with universal ID in other line. So i write two loops... (5 Replies)
Discussion started by: pjlotiya
5 Replies

7. Shell Programming and Scripting

Appending ErrorCodes to the corresponding error record

Hi, Here i'm using a awk inside bash script to validate the datafile by referring to the configuration file(schema file). Here the validation check is done for datatype, field length and null values. Once the validation is done on data file the error records are moved to the bad file. So... (22 Replies)
Discussion started by: shree11
22 Replies

8. Shell Programming and Scripting

Appending CRLF to end of record

I need to append |\r\n (a pipe character and CRLF) at end of each record in Unix to all records where they are not already present. So first check for the presence of |\r\n and if absent append it else do nothing (3 Replies)
Discussion started by: abhilashnair
3 Replies

9. SuSE

Some error messages in var/log/messages

How are you? SUSE V10 and 11. In /var/log/messages I see these lines in some servers. I'd like to know what causes these errors and how to fix them. Thank you, error: PAM: Authentication failure for root from XXXXXXXX Did not receive identification string from XXXXXXX Invalid user suse-gm... (2 Replies)
Discussion started by: JDBA
2 Replies

10. UNIX for Beginners Questions & Answers

Print Error in Console and both Error & Output in Log file - UNIX

I am writing a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file. But i am facing the below error. #! /bin/sh errExit () { errMsg=`cat... (1 Reply)
Discussion started by: sarathy_a35
1 Replies
Jifty::Action::Record::Create(3pm)			User Contributed Perl Documentation			Jifty::Action::Record::Create(3pm)

NAME
Jifty::Action::Record::Create - Automagic creation action DESCRIPTION
This class is used as the base class for Jifty::Actions that are merely creating Jifty::Record objects. To use it, subclass it and override the "record_class" method to return the name of the Jifty::Record subclass that this action creates. METHODS
arguments Set the default value in each of the fields to whatever the default of the column is in the model take_action Overrides the virtual "take_action" method on Jifty::Action to call the appropriate "Jifty::Record"'s "create" method when the action is run, thus creating a new object in the database. The "id" of the new row is returned in the "id" content of the Jifty::Result for the action. You can use this in conjunction with request mapping in order to give later parts of the request access to the "id". create_record This method actually performs the call to "record->create". It receives as arguments the parameter hash and should return the message for the user, indicating success or failure. report_success Sets the "message" in Jifty::Result to default success message, "Created". Override this if you want to report some other more user- friendly result. possible_columns Create actions do not provide fields for columns marked as "private" or "protected". _extra_validator_args Passes "for => 'create'" to validators. _extra_canonicalizer_args Passes "for => 'create'" to canonicalizers. _extra_autocompleter_args Passes "for => 'create'" to autocompleters. SEE ALSO
Jifty::Action::Record, Jifty::Record LICENSE
Jifty is Copyright 2005-2010 Best Practical Solutions, LLC. Jifty is distributed under the same terms as Perl itself. perl v5.14.2 2010-12-10 Jifty::Action::Record::Create(3pm)
All times are GMT -4. The time now is 02:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy