Sponsored Content
Full Discussion: Extract Content from a file
Top Forums Shell Programming and Scripting Extract Content from a file Post 302610129 by rkrish on Wednesday 21st of March 2012 01:33:41 AM
Old 03-21-2012
Extract Content from a file

I have an input file with contents like:

Code:
./prbru6/12030613.LOG:24514|APPL|prbru6.8269.RTUDaemon.1|?|13:49:56|12/03/06|GMT+3|?|RTUServer Error:Count of Internal    Error Qty (-1) < 0, for Audit group id - 1L5XVJ6DQE36AXL, after record number,1, File: EventAuditor.cc, Line: 394|?    ./prbru6/12030613.LOG:3031|APPL|prbru6.8269.RTUDaemon.1|?|13:49:56|12/03/06|GMT+3|?|Application error.AUDIT UPDATE ERROR,    File: EventAggregator.cc, Line: 335|?    ./prbru6/12030613.LOG:24514|APPL|prbru6.8269.RTUDaemon.1|?|13:49:57|12/03/06|GMT+3|?|RTUServer Error:Count of Internal    Error Qty (-1) < 0, for Audit group id - 1LM0DJKDN8QRB2T, after record number,1, File: EventAuditor.cc, Line: 394|?    ./prbru6/12030613.LOG:3031|APPL|prbru6.8269.RTUDaemon.1|?|13:49:57|12/03/06|GMT+3|?|Application error.AUDIT UPDATE ERROR,    File: EventAggregator.cc, Line: 335|?    ./prbru6/12030613.LOG:24514|APPL|prbru6.8269.RTUDaemon.1|?|13:49:59|12/03/06|GMT+3|?|RTUServer Error:Count of Internal    Error Qty (-1) < 0, for Audit group id - 1LE65JSD4TJ3TE0, after record number,2, File: EventAuditor.cc, Line: 394|?    ./prbru6/12030613.LOG:3031|APPL|prbru6.8269.RTUDaemon.1|?|13:49:59|12/03/06|GMT+3|?|Application error.AUDIT UPDATE ERROR,    File: EventAggregator.cc, Line: 335|?

I need to extract the fields 1LM0DJKDN8QRB2T,1LE65JSD4TJ3TE0 and so on from the file.can anyone help me in this Smilie

---------- Post updated at 12:33 AM ---------- Previous update was at 12:27 AM ----------

content of filw will be lyk the following:

Code:
24514|APPL|prbru7.16318.RTUDaemon.1|?|23:37:55|12/03/18|GMT+3|?|RTUServer Error:Count of Internal Error Qty (-1) < 0, f
or Audit group id - 1LMXTJJD0W28TX2, after record number,0, File: EventAuditor.cc, Line: 394|?
24514|APPL|prbru7.16336.RTUDaemon.1|?|23:37:57|12/03/18|GMT+3|?|RTUServer Error:Count of Internal Error Qty (-1) < 0, f
or Audit group id - 1LS1XJGDEVWAC5T, after record number,1, File: EventAuditor.cc, Line: 394|?
24514|APPL|prbru7.16315.RTUDaemon.1|?|23:38:06|12/03/18|GMT+3|?|RTUServer Error:Count of Internal Error Qty (-1) < 0, f
or Audit group id - 1LK81JVDE2HRNDG, after record number,0, File: EventAuditor.cc, Line: 394|?

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract content from a file and insert to another file

please help for the following task... I have to extract the mac address & IP address from the file1: ... 0100004512EEF4 03 192.168.0.7 192.168.0.1 -1 ... 0100779hF5D212 03 192.168.0.8 192.168.0.1 -1 ... 0100789lF5D212 03 192.168.0.9 192.168.0.1 -1 ... ... change the format (addidng... (15 Replies)
Discussion started by: fredao
15 Replies

2. Shell Programming and Scripting

Content extract of a file using awk

Hi Everyone, I have a file with the below content: File1.txt ====== ### ###==> the below table was created for testing1 purpose; ### create table 123 ( field1 date, field2 char(10) primary key(field1) ); ### ###==> the below table was created... (5 Replies)
Discussion started by: nr_shan
5 Replies

3. UNIX for Dummies Questions & Answers

Help to extract the content in this string

Hi All, I have a string in the following format: "kf skjgsdjgngnsd sdgsd ksjgbksjgb kjsbgsjdgb dfhdh sjgsjg j jsbekgjsbdkgj". In this format i want to extract the contents which is in between the two empty lines:... (6 Replies)
Discussion started by: bala041
6 Replies

4. Shell Programming and Scripting

Extract specific content from a file

My input file: >sequence_1 ASSSSSSSSSSSDDDDDDDDDDDCCCCCCC ASDSFDFFDFDFFWERERERERFSDFESFSFD >sequence_2 ASDFDFDFFDDFFDFDSFDSFDFSDFSDFDSFASDSADSADASD ASDFFDFDFASFASFASFAFSFFSDASFASFASFAFS >sequence_3 VEDFGSDGSDGSDGSDGSDGSDGSDG dDFSDFSDFSDFSDFSDFSDFSDFSDF SDGFDGSFDGSGSDGSDGSDGSDGSDG My... (22 Replies)
Discussion started by: patrick87
22 Replies

5. Shell Programming and Scripting

[ask]awk in csh to extract content from file

Please suggest a method (in c shell or any other shell) to implement following: -To read file1.txt (sample file1 given below) -To save name field in a variable <name> -To save parameter field in a variable <parameter> for ex. let a line in file1.txt be : bill height weight the extracted... (12 Replies)
Discussion started by: animesharma
12 Replies

6. Shell Programming and Scripting

Extract XML content from a file

310439 2012-01-11 03:44:42,291 INFO PutServlet:? - Content of the Message is:="1.0" encoding="UTF-8"?><ESP_SSIA_ACC_FEED> 310440 <BATCH_ID>12345678519</BATCH_ID> 310441 <UID>3498748823</UID> 310442 <FEED_TYPE>FULL</FEED_TYPE> 310443 <MART_NAME>SSIA_DM_TRANSACTIONS</MART_NAME> 310444... (11 Replies)
Discussion started by: arukuku
11 Replies

7. Shell Programming and Scripting

perl extract content of file

I'm using Mail::Internet module, which will basically filter through email content and extract the body of the message my perl script to extract the body of the email #!/usr/bin/perl -w use Mail::Internet; @lines = <STDIN>; $mi_obj = new Mail::Internet(); ... (2 Replies)
Discussion started by: amlife
2 Replies

8. Shell Programming and Scripting

Shell Script to Dynamically Extract file content based on Parameters from a pdf file

Hi Guru's, I am new to shell scripting. I have a unique requirement: The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this: Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies

9. Solaris

Extract content of .dump file

We have been provided a .dump file.The need is to extract the contents(may includes files and folder). ls -lZ didnt help me as Z is not a valid option. How to extract the file contents ? (7 Replies)
Discussion started by: vinil
7 Replies

10. Shell Programming and Scripting

Extract a part of variable/line content in a file

I have a variable and assigned the following values ***XYZ_201519_20150929140642_20150929140644_211_0_0_211 I need to read this variable from backward and stop read when I get first underscore (_) In this scenario I should get 211 Thanks Kris (3 Replies)
Discussion started by: mkris
3 Replies
Error(3pm)						User Contributed Perl Documentation						Error(3pm)

NAME
APR::Request::Error - wrapper for libapreq2's error API. SYNOPSIS
use APR::Request::Error; DESCRIPTION
This manpage documents version 2.13 of the APR::Request::Error package. SUBROUTINES
APR::Request::Error - derived from "APR::Request" and "APR::Error". strerror strerror($status) Returns the apreq error string associated with a numeric $status code. ERROR CONSTANTS
GENERAL Internal apreq error TAINTED Attempt to perform unsafe action with tainted data BADDATA Malformed input data BADCHAR Invalid character BADSEQ Invalid byte sequence BADATTR Unrecognized attribute BADHEADER Malformed header string NODATA Missing input data NOTOKEN Expected token not present NOATTR Missing attribute NOHEADER Missing header NOPARSER Missing parser MISMATCH Conflicting information OVERLIMIT Exceeds configured maximum limit NOTEMPTY Setting already configured SEE ALSO
APR::Request, APR::Error COPYRIGHT
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. perl v5.10.1 2011-02-28 Error(3pm)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy