Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do I get the fields after a string Post 11467 by vincew on Wednesday 5th of December 2001 06:57:11 PM
Old 12-05-2001
OK .. OK. Here is some background.
We have an old application for selling Insurance policies. The new replacement application has got to be as quick as the old, which I doubt. I am looking at the old applications log file. I've been asked how many Insurance policies we sell as an indication of the load the new application must handle? I've worked that out (average 5/minute). Now they want to know how much money this represents per minute. So I need the two fields after the word "policy" occurs in the log file so I can caluculate how much each policy is worth.

PS. I've found the command, fold so I am piping the log file through "fold -w 2000" first before using the awk
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

2. Shell Programming and Scripting

script to sort a string of numerical data in set fields

So, I will be working with someone and basically we are trying to build a form that is submitted most likely via the web and the data is just a string of numbers. like: 19383882872201110929282821818182827349190102837364718191001932873711 Now, each number is part of a numerical value of... (4 Replies)
Discussion started by: tlarkin
4 Replies

3. Shell Programming and Scripting

AWK break string into fields + pattern match

I am trying to break a string into separate fields and print the field that matches a pattern. I am using awk at the moment and have gotten this far: awk '{for(i=1;i<=NF;++i)print "\t" $i}' longstring This breaks the string into fields and prints each field on a separate line. I want to add... (2 Replies)
Discussion started by: Moxy
2 Replies

4. Shell Programming and Scripting

mappin strings of two different file and finding the mapped string and then map other fields.

As i am new to unix so facing some problems in scripting: here is my question: i m having two files. 1st file say a.txt contain 3 column like SPECIALITY|UMP_CODE|SPECIALTY_CODE Addictive Diseases|25ADD|ADD Addictive Diseases/Family Practice|25ADD|ADD/FP Aerospace Medicine|1.041666667|AM... (4 Replies)
Discussion started by: dsh007
4 Replies

5. Shell Programming and Scripting

How to read a delimited string and assign fields to incremented variables?

How can I read a string delimited on spaces and assign the fields to incremented variables. For example: Given $exts= txt dat mov I want to read in $exts and have "txt" "dat" and "mov" assigned to incremented variables like $ext1, $ext2, etc. I would like to do this in a loop so that I can... (4 Replies)
Discussion started by: runit
4 Replies

6. Shell Programming and Scripting

Identifying entries based on 2 fields in a string.

Hi Guys, I’m struggling to use two fields to do a duplicate/ unique by output. I want to look IP addresses assigned to more than one account during a given period in the logs. So duplicate IP and account > 1 then print all the logs for that IP. I have been Using AWK (just as its installed... (3 Replies)
Discussion started by: wabbit02
3 Replies

7. Shell Programming and Scripting

Need a separator string between fields in cut -c command

Hi All, I'm trying to view data using cut command for a fixed length file using the below command: cut -c 1-3,4-5 FALCON_PIS_00000000.dat I want to mention a separator say | (pipe) in between 1-3 and 4-5. Please let me know how to achieve this. Thanks in Advance, (3 Replies)
Discussion started by: HemaV
3 Replies

8. Shell Programming and Scripting

How to print 1st field and last 2 fields together and the rest of the fields after it using awk?

Hi experts, I need to print the first field first then last two fields should come next and then i need to print rest of the fields. Input : a1,abc,jsd,fhf,fkk,b1,b2 a2,acb,dfg,ghj,b3,c4 a3,djf,wdjg,fkg,dff,ggk,d4,d5 Expected output: a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies

9. Shell Programming and Scripting

awk partial string match and add specific fields

Trying to combine strings that are a partial match to another in $1 (usually below it). If a match is found than the $2 value is added to the $2 value of the match and the $3 value is added to the $3 value of the match. I am not sure how to do this and need some expert help. Thank you :). file ... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
DBD::Gofer::Policy::Base(3)				User Contributed Perl Documentation			       DBD::Gofer::Policy::Base(3)

NAME
DBD::Gofer::Policy::Base - Base class for DBD::Gofer policies SYNOPSIS
$dbh = DBI->connect("dbi:Gofer:transport=...;policy=...", ...) DESCRIPTION
DBD::Gofer can be configured via a 'policy' mechanism that allows you to fine-tune the number of round-trips to the Gofer server. The policies are grouped into classes (which may be subclassed) and referenced by the name of the class. The DBD::Gofer::Policy::Base class is the base class for all the policy classes and describes all the individual policy items. The Base policy is not used directly. You should use a policy class derived from it. POLICY CLASSES
Three policy classes are supplied with DBD::Gofer: DBD::Gofer::Policy::pedantic is most 'transparent' but slowest because it makes more round-trips to the Gofer server. DBD::Gofer::Policy::classic is a reasonable compromise - it's the default policy. DBD::Gofer::Policy::rush is fastest, but may require code changes in your applications. Generally the default "classic" policy is fine. When first testing an existing application with Gofer it is a good idea to start with the "pedantic" policy first and then switch to "classic" or a custom policy, for final testing. POLICY ITEMS
These are temporary docs: See the source code for list of policies and their defaults. In a future version the policies and their defaults will be defined in the pod and parsed out at load-time. See the source code to this module for more details. POLICY CUSTOMIZATION
XXX This area of DBD::Gofer is subject to change. There are three ways to customize policies: Policy classes are designed to influence the overall behaviour of DBD::Gofer with existing, unaltered programs, so they work in a reasonably optimal way without requiring code changes. You can implement new policy classes as subclasses of existing policies. In many cases individual policy items can be overridden on a case-by-case basis within your application code. You do this by passing a corresponding "<go_<policy_name">> attribute into DBI methods by your application code. This let's you fine-tune the behaviour for special cases. The policy items are implemented as methods. In many cases the methods are passed parameters relating to the DBD::Gofer code being executed. This means the policy can implement dynamic behaviour that varies depending on the particular circumstances, such as the particular statement being executed. AUTHOR
Tim Bunce, <http://www.tim.bunce.name> LICENCE AND COPYRIGHT
Copyright (c) 2007, Tim Bunce, Ireland. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. perl v5.18.2 2013-06-24 DBD::Gofer::Policy::Base(3)
All times are GMT -4. The time now is 03:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy