What is the purpose of the $nterms variable? Refer to the PERL script shown in Figures 8.1
Question:
What is the purpose of the $nterms variable?
Refer to the PERL script shown in Figures 8.1 and 8.2.
Transcribed Image Text:
C:\Users ex h\Documents\Book SearchForTerms.prl - Notepad++ File Edit Search View Encoding Language Settings Macro Run Plugins Window? *O 510 SearchForTerms pr 13 #Sample program to scan file for a list of matching terms; #write records with matches to an output file for later import to a database 2 3 6 7 8 9 10 11 12 13 14 15 16 # 28 29 30 31 32 use TIME::Local; #open the file containing a list of terms of interest and load #them into an array; offset for first row = 0 $infile= "mysearchterms.txt"; open (IN, Sinfile) or die "Couldn't open input file $infile "; Sterma= 0; while ($input = ) ( chomp ($input); $searchterms [Si] $input; $nterms++; } close (IN); $set a flag for first output record Smatch="n"; identify the file to be searched 17 18 19 $infile="SystemLog.txt"; 20 #identify the output file for records that match search terms 21 Soutfile="Output/SystemLogMatches.txt"; 22 #open and process the input file 23 open (IN, Sinfile) or die "Can't open input file $input "; 24 $num=0; 25 while ($input = ) [ 26 chomp ($input); 27 #this sample file contains non-printable characters; remove them $input = /[\x7E-\xFF]//g; $num++; for ($i=0; $i < $nterms; $i++) { if ($input = /Ssearchterms [Si]/) ( #found a match Norm length: 1,381 lines: 47 Ln: 1 Col: 59 Sel: 010 Windows (CRLF) UTF-8 0 FIGURE 8.1 First part of script to search file based on search terms. X INS
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
It gives the number of ...View the full answer
Answered By
Branice Buyengo Ajevi
I have been teaching for the last 5 years which has strengthened my interaction with students of different level.
4.30+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
What is the purpose of the $match variable? Refer to the PERL script shown in Figures 8.1 and 8.2. C:\Users ex h\Documents\Book SearchForTerms.prl - Notepad++ File Edit Search View Encoding Language...
-
In line 42, what is the purpose of the \ character? Refer to the PERL script shown in Figures 8.3 and 8.4. C:\Users ex_h\Documents\Book\SQLServerLogCheck.prl - Notepad+. Eile Edit Search View...
-
Using quarterly data for 10 years, the regression results are given in the following table where CAR = number of new car sales per thousand population, PRICE = new car price index, INC= per-capita...
-
Do service-sector companies have inventoriable costs? Explain.
-
Prepare a report for the dean of the college that summarizes your assessment of the nature of cheating by business students at Bayview University. Be sure to include the following items in your...
-
1. Describe "intangible" assets. 2. Is it possible for working capital to be negative? Retained earnings? Why? 3. The liquidity of assets is important to creditors. Does the liquidity of assets...
-
Required Identify which of the following items are added to or subtracted from the unadjusted book balance to arrive at the true cash balance. Distinguish the additions from the subtractions by...
-
Allocate overhead using a single plantwide rate, multiple department rates, and activity-based costing Downhill Sports Inc. manufactures two products: snowboards and skis. The factory overhead...
-
What records are written to the Out file? Refer to the PERL script shown in Figures 8.1 and 8.2. C:\Users rex h\Documents\Book SearchForTerms.pri- Notepad++ File Edit Search View Encoding Language...
-
As the logical data model is developed, should any significant usage requirements be noted or documented? Why or why not? You are asked to lead a design team for a new database to be used by your...
-
Instead of an investment of $4,000, assume the book value is $9,000 and the terminal value at time 4 is $1,756.92. a. Compute the NPV using the cash flows. b. Compute the economic incomes of each...
-
describe the function of global investment banking ? 2)how you will utilize your academic skills and experience to add value to investment banking division?
-
what is investment banking & investment bank ?
-
A broker-dealer must establish information barriers between which two departments? give reasons
-
What is the molecular structure and causative agent behind the formation of a thymine dimer in DNA?
-
help me with technology innovation in finance and investment banking. Need innovation done in finance , could be retail, commercial and investment banking. Need to write an assignment so pointers or...
-
What financial ratios would a credit rating agency such as Moodys or Standard & Poors be most interested in? Which ratios would be of most interest to a stock market analyst deciding whether to buy a...
-
Per Bag Direct materials: 25 pounds of CWhiz-2000 @ $0.08/lb. = $ 2.00 Direct labor: 0.05 hour @ $32.00/hr. = $ 1.60 The company manufactured 100,000 bags of Cheese-Be-Good in December and used...
-
Given a sequence S of n values, each equal to 0 or 1, describe an in-place method for sorting S.
-
Suppose S is a sequence of n values, each equal to 0 or 1. How long will it take to sort S stably with the bucket-sort algorithm?
-
Suppose S is a sequence of n values, each equal to 0 or 1. How long will it take to sort S with the merge-sort algorithm? What about quick-sort?
-
8. Debby is trying to decide whether to put her $6000 of savings into an account earning 3% simple interest or 2.6% interest compounded weekly. Which account would have more money after 25 years and...
-
Consider F and C below. F(x, y, z) = yz i + xz j + (xy + 4z)k C is the line segment from (2, 0, -2) to (6, 4, 1) (a) Find a function f such that F = Vf. (b) Use part (a) to evaluate fc Vf. dr along...
-
For the following function, find the full power series centered at x = 0 and then give the first 5 nonzero terms of the power series and the open interval of convergence. f(2) = n0 f(x)=0+ + +++****...
Study smarter with the SolutionInn App