I have a file below that I am wanting to awk. The lines of relevance are lines 7 and 9
At the moment what I am doing is re-directing both lines to a file each using sed. Is there any way that I can awk it right away once I re-direct the output to a file?
The line that is important is line 7, I was hoping I can reference each field based on each heading. For example, if want to be able access SHORTP_POLICY and shows 720 :-)
I do not have much control on how the output looks like and I hope it stays this way even on future Oracle upgrades ... grrr ....
Let's say I write a simple script that contains the following:
date | awk '{print $1}'
date | awk '{print $2}'
Of course, when I run the script the output will look similar to:
Tue
Mar
What if I want my ouput to be on one line as follows:
Tue Mar
What changes would I need to... (2 Replies)
I have a file that is 20 - 80+ MB in size that is a certain type of log file.
It logs one of our processes and this process is multi-threaded. Therefore the log file is kind of a mess. Here's an example:
The logfile looks like: "DATE TIME - THREAD ID - Details", and a new file is created... (4 Replies)
This script is supposed to find out if tomcat is running or not.
#!/bin/sh
if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null
then
echo Tomcat for $1 running
else
echo Tomcat for $1 NOT running
fi
the /tomcat/bases is a file that... (2 Replies)
Hi,
I need to insert a line at a particular line number. I am using the below code:
sed $REV_LINO_NO" i\\
# $CURRENT_DATE $NAME Changed pwd for cindy\'s id" file > file1
This code works, but the formatting is not as I expected. For example, I get lines as shown below... (2 Replies)
Dear all
I require help with AWK regarding this situation
Input is :
fn1 12345
fn1 23456
fn3 231513
fn1 22325
fn3 123125
Desired output is
fn1 12345 23456 22325
fn3 231513 123125 (5 Replies)
when i try this awk its giving out put as below.
awk '!(/^$/||/--/||/selected/||/^ *$/){print $1}' tmp.txt
output
=====
1
2010-08-03-12.31.26.126000
how excluede the 1st line ? i mean i want output only 2nd line i.e 2010-08-03-12.31.26.126000; (5 Replies)
Our vendor produces a report that I would like to format in a particular way.
Here is the sample output from their report:
# AA.INDEX 2 11 2 239 52 (7,2) 07 MAY 11 203.1 55
# ACCOUNT 2 89561 2 ... (4 Replies)
Hi all,
I'm writing a simple awk code:
awk 'BEGIN {FS="|"};{print "Type\tNumber\ttypes\tTotal";};{print $1, "\t", $2, "\t", $3, "\t", $4, "\t";}' db_query.txt
it gives me the result:
Type Number types Total
XXX 498.0 5100.0 5274.661
Type Number types Total... (7 Replies)
Hi ,
I was trying to find files of a particular date and did that but then I also wanted to format a field based on some condition so had put another if else in awk.
Now it is getting the files of particular date or also the files which are matching that if else condition.
find . -name "*"... (1 Reply)
Need assistance on the data extraction using awk
Below is the format and would like to extract the data in another format
-------------------------------------------------------------------------------------------------
Minimum Temperature (deg F )
DAY 1 2 3 4 5 6 7 8 9 10 11... (4 Replies)
Discussion started by: ajayram_arya
4 Replies
LEARN ABOUT DEBIAN
rdf::vcard::entity
RDF::vCard::Entity(3pm) User Contributed Perl Documentation RDF::vCard::Entity(3pm)NAME
RDF::vCard::Entity - represents a single vCard
DESCRIPTION
Instances of this class correspond to individual vCard objects, though it could potentially be used as basis for other RFC 2425-based
formats such as iCalendar.
Constructor
o "new(%options)"
Returns a new RDF::vCard::Entity object.
The only option worth worrying about is profile which sets the profile for the entity. This defaults to "VCARD".
RDF::vCard::Entity overloads stringification, so you can do the following:
my $vcard = RDF::vCard::Entity->new;
print $vcard if $vcard =~ /VCARD/i;
Methods
o "to_string()"
Formats the object according to RFC 2425 and RFC 2426.
o "to_jcard()"
Formats the object according to <http://microformats.org/wiki/jcard>.
to_jcard(1) will return the same data but without the JSON stringification.
o "add_to_model($model)"
Given an RDF::Trine::Model, adds triples to the model for this entity.
o "node()"
Returns an RDF::Trine::Node::Blank identifying this entity.
o "entity_order()"
Returns a string along the lines of "Surname;Forename" useful for sorting a list of entities.
o "profile()"
Returns the entity type - e.g. "VCARD".
o "lines()"
Returns an arrayref of RDF::vCard::Line objects in the order they were originally added.
This excludes the "BEGIN:VCARD" and "END:VCARD" lines.
o "add($line)"
Add a RDF::vCard::Line.
o "get($property)"
Returns a list of RDF::vCard::Line objects for the given property.
e.g.
print "It has an address!
" if ($vcard->get('ADR'));
o "matches($property, $regexp)"
Checks to see if a property's value matches a regular expression.
print "In London
" if $vcard->matches(ADR => /London/);
o "add_component($thing)"
Adds a nested entity within this one. This method is unused for vCard, but is a hook for the benefit of RDF::iCalendar.
o "components"
Lists nested entities within this one.
SEE ALSO
RDF::vCard.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT
Copyright 2011 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-06-23 RDF::vCard::Entity(3pm)