1. The problem statement, all variables and given/known data:
filename = awkdata
Quote:
Arizona Phoenix 6285295 Tucson 32
California Sacramento 38593635 Eureka 12
Oregon Salem 12345234 Portland 45
Washington Olympia 6549872 Seattle 36
Illinois Springfield 6759346 Chicago 14
Maine Augusta 456923 Lewiston 23
Texas Austin 23967433 Houston 26
Part 1: Write an awk program that removes the first field and prints only those lines where the third field is greater than 15 million.
Part 2: Do the same command above, but with perl instead of awk.
3. The attempts at a solution (include all code and scripts):
Using a2p, I get:
When I run this perl script, I get no errors, but it acts as if the command is not finished and gives me a blank line instead of the desired output.
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Pima Community College, Tucson AZ, PScott, CIS 137
PS. This is an Intro to UNIX course, not a programming course. I have no knowledge of perl, so staring at this script is like staring at Chinese writing.
So I have a perl script that prompts the user to enter either q or Q to exit the program or c to continue said program. If the user inputs anything other than those three keys they will be prompted again and again for an appropriate input. My script works for the most part except for one small... (6 Replies)
hi
Here is my code written to identify the particular position which is after a string (chr*). my input file looks some thing like this aaanbb:anhn:iuopl:12345 chr1 12345 asnmkol * # kjiiii.....anmkij:lpolk:lopll:abnnj chr5 123222 polko * dddfgg ....
aaanbb:anhn:iuopl:aanjuj chr2 44345 asnmkol... (1 Reply)
Hello All
I am facing an issue
The unix script is running fine in unix environment which uses ssh connection but when I try to run the same in informatica environment (same server where I was running the unix script manually successfully) its showing the below error
command-line line 0:... (11 Replies)
I am getting a strange error with perl's inbuilt script flush.pl. I am callling this script in my other script but it kept throwing error:
flush.pl did not return a true value at ./abc.pl line 1
abc.pl has:
require 'flush.pl';
Not sure why this error is coming. Can someone pls throw... (4 Replies)
I solicited this site earlier this week and got a good answer for a perl
Script so I made this script from what understood from the answers
But now I have a bug and I'm stump. It doesn't parse correctly the
Output it stays on the first line My $f2 and reprints in a endless loop
I'm sure there... (3 Replies)
Hi,
This is my piece of code.
my $logFile = $ARGV;
die "usage: $0 <logFile>" unless $logFile;
die "Logfile $logFile doesn't exist" unless -f "$logFile";
open(my $log, "<", $logFile) or die "Can't open $logFile for reading.";
print "Processing file $logFile...\n";
#my $authenticates... (2 Replies)
Hello everyone,
I'm a starting website admin who 2 days ago decided to make the move from shared hosting to a vps on a linux (ubuntu 8.04) platform. This opened a whole new world for me, since I never worked with the console, SSH, linux,... before. I managed to get LAMP setup after a day of... (2 Replies)
Hi all
I keep getting a segmentation fault error while running the script below.
#!/usr/bin/perl -w
use CGI ':standard';
use GD::Graph::pie;
use strict;
use warnings;
sub trim($)
{
my $string = shift;
$string =~ s/^\s+//;
$string =~ s/\s+$//;
... (4 Replies)