Sponsored Content
Top Forums Shell Programming and Scripting Shell Script to read specific lines in a file Post 81624 by varshanswamy on Monday 22nd of August 2005 07:01:53 PM
Old 08-22-2005
Quote:
Originally Posted by Ygor
Try...
Code:
awk 'BEGIN { FS = "[ :]" }
     $1 == "Record" { r = $2 }
     $1 == "ORA-00001" { print r }
    ' file1

Thank you very much the code is working. Though I still need to improve on the performance, if you have any ideas to improve the performance do let me know.
 

10 More Discussions You Might Find Interesting

1. Programming

How to read specific lines in a bulk file using C file Programming

Please Help me I have a Bulk file containing Hex data I want to read specific lines from that bulk file by ID number. example ID DATE Time data 14 2005/09/28 07:40:08.546 0 5 078B1C 01916C 0FE59C 004B54 0A9670 0D04ED 05B6B4 0E2223... (10 Replies)
Discussion started by: rajan_ka1
10 Replies

2. Shell Programming and Scripting

A script that read specific fileds from the 7th line in a file

Dear All, I need a unix script that will read the 7th line and especially these fileds from a file Mo speed 16, Mt speed 15 every 15 minutes starting from 00:00 to 23:45 on daily basis and put the result in a txt file and name it MT_MO_20090225.txt, please also note that the system date format... (2 Replies)
Discussion started by: samura
2 Replies

3. Shell Programming and Scripting

How to use while loop in bash shell to read a file with 4 lines of gap

Hi , I am currently using the while loop in bash shell, as follows. while read line do echo $line done < file.txt However, i want to use the while loop on file.txt, which will read the file with 4 lines of gap. Ex- if file.txt is a file of 100 lines, then i want to use the loop such... (3 Replies)
Discussion started by: jitendriya.dash
3 Replies

4. Shell Programming and Scripting

Shell script to read lines in a text file and filter user data

hi all, I have this file with some user data. example: $cat myfile.txt FName|LName|Gender|Company|Branch|Bday|Salary|Age aaaa|bbbb|male|cccc|dddd|19900814|15000|20| eeee|asdg|male|gggg|ksgu|19911216||| aara|bdbm|male|kkkk|acke|19931018||23| asad|kfjg|male|kkkc|gkgg|19921213|14000|24|... (4 Replies)
Discussion started by: srimal
4 Replies

5. Shell Programming and Scripting

Why does my script only read two lines of a file and not the third

I'm learning about the read command and wrote this little script to read data from a file: readfile() { while read variable; do echo $variable done } readfile < File.txt I have three lines in File.txt; each a single word. The script only echoes the first two lines and drops the... (9 Replies)
Discussion started by: Straitsfan
9 Replies

6. UNIX for Dummies Questions & Answers

How to use sed to copy specific lines from a file using shell variables?

hello! I am trying to use sed to copy specific set of lines from a file for which the starting and ending line numbers of the lines to be copied are stored in shell variables. How can i copy those lines? if the input_file is something like this and if the following is the script a=2 b=4... (4 Replies)
Discussion started by: a_ba
4 Replies

7. Shell Programming and Scripting

How to read from specific line number in shell script?

I have a text file which is having 30000 lines in it. I have to create a xml file for each 10000 lines until all the lines in the text files are written. Also please help how can i get number of lines in the text file in a shell variable? (19 Replies)
Discussion started by: vel4ever
19 Replies

8. Shell Programming and Scripting

How to change a number on a specific lines in a file with shell?

Hello My problem is that I want to change some specific numbers in a file. It is like, 2009 10 3 2349 21.3 L 40.719 27.388 10.8 FRO 7 0.8 1.1LFRO 2.6CFRO 1.1LMAM1 GAP=157 1.69 5.7 5.9 5.8 0.5405E+01 0.4455E+00 0.1653E+02E STAT SP IPHASW D HRMM SECON CODA AMPLIT... (11 Replies)
Discussion started by: miriammiriam
11 Replies

9. Shell Programming and Scripting

Read in specific lines in a file

I have a text file First title line name1 name2 name3 name4 (etc) other lines other lines other lines I want to read in this text file and parse the name1...name4 to a variable. How do I specificially read in these lines and these lines only? (10 Replies)
Discussion started by: piynik
10 Replies

10. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies
HTTP::OAI::Record(3pm)					User Contributed Perl Documentation				    HTTP::OAI::Record(3pm)

NAME
HTTP::OAI::Record - Encapsulates an OAI record SYNOPSIS
use HTTP::OAI::Record; # Create a new HTTP::OAI Record my $r = new HTTP::OAI::Record(); $r->header->identifier('oai:myarchive.org:oid-233'); $r->header->datestamp('2002-04-01'); $r->header->setSpec('all:novels'); $r->header->setSpec('all:books'); $r->metadata(new HTTP::OAI::Metadata(dom=>$md)); $r->about(new HTTP::OAI::Metadata(dom=>$ab)); METHODS
$r = new HTTP::OAI::Record( %opts ) This constructor method returns a new HTTP::OAI::Record object. Options (see methods below): header => $header metadata => $metadata about => [$about] $r->header([HTTP::OAI::Header]) Returns and optionally sets the record header (an HTTP::OAI::Header object). $r->metadata([HTTP::OAI::Metadata]) Returns and optionally sets the record metadata (an HTTP::OAI::Metadata object). $r->about([HTTP::OAI::Metadata]) Optionally adds a new About record (an HTTP::OAI::Metadata object) and returns an array of objects (may be empty). Header Accessor Methods These methods are equivalent to "$rec->header->$method([$value])". $r->identifier([$identifier]) Get and optionally set the record OAI identifier. $r->datestamp([$datestamp]) Get and optionally set the record datestamp. $r->status([$status]) Get and optionally set the record status (valid values are 'deleted' or undef). $r->is_deleted() Returns whether this record's status is deleted. perl v5.12.4 2011-06-23 HTTP::OAI::Record(3pm)
All times are GMT -4. The time now is 11:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy