Sponsored Content
Full Discussion: Chemist Needs Help
Top Forums UNIX for Dummies Questions & Answers Chemist Needs Help Post 302250959 by gingburg on Friday 24th of October 2008 04:16:53 PM
Old 10-24-2008
Quote:
Originally Posted by jim mcnamara
Code:
printf "%s\n%s\n%s\n%s\n" "comment" "x y x" "101" "4 7" > newfile
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3
awk '/Done/ {print $2; exit}' Cl_b3lyp_pv5z.out | read col4
awk '/Done/ {print $2}' ArCl_b3lyp_pv5z.out | \
awk -v col4="$col4" -v col3="$col3" ' BEGIN { cnt =1.5 }
    {printf("%.1f %s %s %s\n", cnt, $0, col3 col4); cnt+=.1 }'>> newfile

There was a missing comma after the word "cnt" on the last line. I ran it with dummy files, zero errors. Copy and paste this back into your script. There are no syntax errors.
Logic errors, maybe.

Still getting the error, could I attach the .out files

awk: cmd. line:1: (FILENAME=- FNR=1) fatal: not enough arguments to satisfy format string
`%.1f %s %s %s
'
^ ran out for this one

Thanks Jim.
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Chemist Needs Help part II

Hello friends, I was wondering if you can help me with probably a simple function to you all: the sample looks and has this format. I was wondering how I could extract the first and second column starting including the line 'E/N and Ko' and not stop until there are no more lines. Thank you for... (5 Replies)
Discussion started by: gingburg
5 Replies
Plack::Runner(3pm)					User Contributed Perl Documentation					Plack::Runner(3pm)

NAME
Plack::Runner - plackup core SYNOPSIS
# Your bootstrap script use Plack::Runner; my $app = sub { ... }; my $runner = Plack::Runner->new; $runner->parse_options(@ARGV); $runner->run($app); DESCRIPTION
Plack::Runner is the core of plackup runner script. You can create your own frontend to run your application or framework, munge command line options and pass that to "run" method of this class. "run" method does exactly the same thing as the plackup script does, but one notable addition is that you can pass a PSGI application code reference directly to the method, rather than via ".psgi" file path or with "-e" switch. This would be useful if you want to make an installable PSGI application. Also, when "-h" or "--help" switch is passed, the usage text is automatically extracted from your own script using Pod::Usage. NOTES
Do not directly call this module from your ".psgi", since that makes your PSGI application unnecessarily depend on plackup and won't run other backends like Plack::Handler::Apache2 or mod_psgi. If you really want to make your ".psgi" runnable as a standalone script, you can do this: my $app = sub { ... }; unless (caller) { require Plack::Runner; my $runner = Plack::Runner->new; $runner->parse_options(@ARGV); return $runner->run($app); } return $app; WARNING: this section used to recommend "if (__FILE__ eq $0)" but it's known to be broken since Plack 0.9971, since $0 is now always set to the .psgi file path even when you run it from plackup. SEE ALSO
plackup perl v5.14.2 2012-03-21 Plack::Runner(3pm)
All times are GMT -4. The time now is 10:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy