Sponsored Content
Top Forums Shell Programming and Scripting how to include field in the output filename of awk Post 302225404 by vidyadhar85 on Friday 15th of August 2008 09:58:30 AM
Old 08-15-2008
what data you want in xxx1 file and in xxx2 file??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Supressing and replacing the output of a field in Awk

Wondering if anybody can help with changing the output of a field. I'm needing to change the output of a field in this file: User Process ID Time Active Licences Type ChangeAdmin (Phys-agsdev/19353 212), start Wed 1/21 6:30 (linger: 1800) u414013 (Phys-agsdev/19353 1491), start Wed 1/21 12:54... (5 Replies)
Discussion started by: Glyn_Mo
5 Replies

2. Shell Programming and Scripting

script to include filename with variations at the beginning of the file

Hi there, I have a bunch of files that I want to modify. As a beginner, but nevertheless enthusiast, in the use of the shell I want to create a script enabling me to modify those files quickly. I had only some partial success with various peaces of scripts but I would like to create one script... (1 Reply)
Discussion started by: iamzesh
1 Replies

3. Shell Programming and Scripting

awk output field delimiter

Dear All, 1.txt (tab in between each value in a line) a b c a b c a c d you can see below, why with ~ i can output with tab, but = cannot? # awk -F'\t' '$2 ~ /b/' 1 a b c a b c # awk -F'\t' '$2 = "b"' 1 a b c a b c a b d ... (1 Reply)
Discussion started by: jimmy_y
1 Replies

4. Shell Programming and Scripting

AWK specific output filename

Hi All, I'd like to create a specific output filename for AWK. The file I am processing with AWK looks like: output_081012.csv* 27*TEXT*1.0*2.0*3.0 where * is my delimeter and the first line of the file is the output filename i'd like to create is there a way to assign an awk... (10 Replies)
Discussion started by: LMSteed
10 Replies

5. UNIX for Dummies Questions & Answers

awk - output field separator

In awk, how do I print all fields with a specified output field separator? I have tried the following, which does not print the output FS: echo a b c d | awk 'BEGIN{OFS = ";"}{print $0}' (3 Replies)
Discussion started by: locoroco
3 Replies

6. UNIX for Dummies Questions & Answers

awk truncating first field output?

Hello, I'm writing an Awk script to take a command line argument (student's name) and output their relevant student#, name, and marks. For some reason, awk arbitrarily removes the first digit from the student number and doesn't show me the proper output. Here is my code: #! /usr/bin/awk -f... (6 Replies)
Discussion started by: trashmouth12
6 Replies

7. Shell Programming and Scripting

Include pathname in awk output?

I am running an awk to verify all the memory settings for tomcat, and need to include path or directory in output .... I am running: awk '{ print $3 }' /opt/dir1/dir2/*/tomcat/bin/setenv.sh Output results: -Xms1024m -Xmx1536m -Xmx1536m -Xmx1024m -Xms1024m -Xms1024m -Xms512m -Xms1024m... (3 Replies)
Discussion started by: kgolli
3 Replies

8. Shell Programming and Scripting

awk to parse field and include the text of 1 pipe in field 4

I am trying to parse the input in awk to include the |gc= in $4 but am not able to. The below is close: awk so far: awk '{sub(/\|]+]++/, ""); print }' input.txt Input chr1 955543 955763 AGRN-6|pr=2|gc=75 0 + chr1 957571 957852 AGRN-7|pr=3|gc=61.2 0 + chr1 970621 ... (7 Replies)
Discussion started by: cmccabe
7 Replies

9. UNIX for Dummies Questions & Answers

awk : dynamic output flatfile filename

Hello, I'm using the awk command to insert empty columns on a tab delimited flatfile - which works fine - => But I'm not able to manage dynamicaly the filename of the awk output based on the source flatfile filename I have 3 source flatfile: flatfile_Jan-2016.csv flatfile_Feb-2016.csv... (3 Replies)
Discussion started by: Tipiak
3 Replies

10. Shell Programming and Scripting

awk to create separate files but not include specific field in output

I am trying to use awk to create (in this example) 3 seperate text file from the unique id in $1 in file, if it starts with the pattern aa. The contents of each row is used to populate each text file except for $1 which is not needed. It seems I am close but not quite get there. Thank you :). ... (3 Replies)
Discussion started by: cmccabe
3 Replies
LWP::Authen::OAuth(3pm) 				User Contributed Perl Documentation				   LWP::Authen::OAuth(3pm)

NAME
LWP::Authen::OAuth - generate signed OAuth requests SYNOPSIS
require LWP::Authen::OAuth; Google # Google uses 'anonymous' for unregistered Web/offline applications or the # domain name for registered Web applications my $ua = LWP::Authen::OAuth->new( oauth_consumer_secret => "anonymous", ); # request a 'request' token my $r = $ua->post( "https://www.google.com/accounts/OAuthGetRequestToken", [ oauth_consumer_key => 'anonymous', oauth_callback => 'http://example.net/oauth', xoauth_displayname => 'Example Application', scope => 'https://docs.google.com/feeds/', ] ); die $r->as_string if $r->is_error; # update the token secret from the HTTP response $ua->oauth_update_from_response( $r ); # open a browser for the user # data are returned as form-encoded my $uri = URI->new( 'http:' ); $uri->query( $r->content ); my %oauth_data = $uri->query_form; # Direct the user to here to grant you access: # https://www.google.com/accounts/OAuthAuthorizeToken? # oauth_token=$oauth_data{oauth_token} "; # turn the 'request' token into an 'access' token with the verifier # returned by google $r = $ua->post( "https://www.google.com/accounts/OAuthGetAccessToken", [ oauth_consumer_key => 'anonymous', oauth_token => $oauth_data{oauth_token}, oauth_verifier => $oauth_verifier, ]); # update the token secret from the HTTP response $ua->oauth_update_from_response( $r ); # now use the $ua to perform whatever actions you want Twitter Sending status updates to a single account is quite easy if you create an application. The "oauth_consumer_key" and "oauth_consumer_secret" come from the 'Application Details' page and the "oauth_token" and "oauth_token_secret" from the 'My Access Token' page. my $ua = LWP::Authen::OAuth->new( oauth_consumer_key => 'xxx1', oauth_consumer_secret => 'xxx2', oauth_token => 'yyy1', oauth_token_secret => 'yyy2', ); $ua->post( 'http://api.twitter.com/1/statuses/update.json', [ status => 'Posted this using LWP::Authen::OAuth!' ]); DESCRIPTION
This module provides a sub-class of LWP::UserAgent that generates OAuth 1.0 signed requests. You should familiarise yourself with OAuth at <http://oauth.net/>. This module only supports HMAC_SHA1 signing. OAuth nonces are generated using the Perl random number generator. To set a nonce manually define 'oauth_nonce' in your requests via a CGI parameter or the Authorization header - see the OAuth documentation. METHODS
$ua = LWP::Authen::OAuth->new( ... ) Takes the same options as "new" in LWP::UserAgent plus optionally: oauth_consumer_key oauth_consumer_secret oauth_token oauth_token_secret Most services will require some or all of these to be set even if it's just 'anonymous'. $ua->oauth_update_from_response( $r ) Update the "oauth_token" and "oauth_token_secret" from an HTTP::Response object returned by a previous request e.g. when converting a request token into an access token. $key = $ua->oauth_consumer_key( [ KEY ] ) Get and optionally set the consumer key. $secret = $ua->oauth_consumer_secret( [ SECRET ] ) Get and optionally set the consumer secret. $token = $ua->oauth_token( [ TOKEN ] ) Get and optionally set the oauth token. $secret = $ua->oauth_token_secret( [ SECRET ] ) Get and optionally set the oauth token secret. SEE ALSO
LWP::UserAgent, MIME::Base64, Digest::SHA, URI, URI::Escape Rationale I think the complexity in OAuth is in the parameter normalisation and message signing. What this module does is to hide that complexity without replicating the higher-level protocol chatter. In Net::OAuth: $r = Net::OAuth->request('request token')->new( consumer_key => 'xxx', request_url => 'https://photos.example.net/request_token', callback => 'http://printer.example.com/request_token_ready', ... extra_params { scope => 'global', } ); $r->sign; $res = $ua->request(POST $r->to_url); $res = Net::OAuth->response('request token') ->from_post_body($res->content); ... etc In LWP::Authen::OAuth: $ua = LWP::Authen::OAuth->new( oauth_consumer_key => 'xxx' ); $res = $ua->post( 'https://photos.example.net/request_token', [ oauth_callback => 'http://printer.example.com/request_token_ready', ... scope => 'global', ]); $ua->oauth_update_from_response( $res ); ... etc Net::OAuth, OAuth::Lite. AUTHOR
Timothy D Brody <tdb2@ecs.soton.ac.uk> Copyright 2011 University of Southampton, UK This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself perl v5.12.3 2011-03-31 LWP::Authen::OAuth(3pm)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy