Code in Python.
Ask the user to enter the backend error log file name ("ErrorLog.txt")
Read the file (Errorlog.txt)
[Sun Mar 7 16:02:00 2018] [notice] Apache/1.3.29 (Unix) configured --
resuming normal operations
[Sun Mar 7 16:02:00 2018] [info] Server built: Feb 27 2018 13:56:37
[Sun Mar 7 16:02:00 2018] [notice] Accept mutex: sysvsem (Default:
sysvsem)
[Sun Mar 7 16:05:49 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 16:45:56 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:13:50 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:21:44 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:23:53 2018] statistics: Use of uninitialized value in
concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.
[Sun Mar 7 17:23:53 2018] statistics: Can't create file
/home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied
[Sun Mar 7 17:27:37 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
(USE TRY/EXCEPT when opening a file)
(DO NOT COUNT EMPTY LINES, use strip() method)
ANSWER:
try: #opening errorlog and reporterror files
f=open("ErrorLog.txt","r")
f1=open("reportError.txt","w")
except:
print("Error while opening file")
count_lines=0
count_err=0
print("Lines having word error:\n")
for i in f:
if(len(i)!=1): #checking weather lines is empty ornot 1 is beacause
it counts \n
count_lines+=1 #line count
if "Error" in i: #checking the word "Error"
f1.write(i)
f1.write("\n")
print(i)
count_err+=1 #error word count
if "error" in i:
f1.write(i)
f1.write("\n")
print(i)
count_err+=1
if "ERROR" in i:
f1.write(i)
f1.write("\n")
print(i)
count_err+=1
print("Number of lines which are not empty:",count_lines)
#sidplaying on screem
print("Number of lines having word error:",count_err)
f1.write(("\nNon-empty lines:"+str(count_lines))) #writing into
files
f1.write(("\nlines having word error:"+str(count_err)))
f.close()
f1.close()
#code for indendation:

ouptut:

log file considered:
[Sun Mar 7 16:02:00 2018] [notice] Apache/1.3.29 (Unix) configured --
resuming normal operations
[Sun Mar 7 16:02:00 2018] [info] Server built: Feb 27 2018 13:56:37
[Sun Mar 7 16:02:00 2018] [notice] Accept mutex: sysvsem (Default:
sysvsem)
[Sun Mar 7 16:05:49 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 16:45:56 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:13:50 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:21:44 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:23:53 2018] statistics: Use of uninitialized value in
concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.
[Sun Mar 7 17:23:53 2018] statistics: Can't create file
/home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied
[Sun Mar 7 17:27:37 2018] [info] [client 64.242.88.10] (104)Connection
reset by peer: client stopped connection before send body completed
[quote][Thu Mar 13 19:04:13 2014] [error] [client 50.0.134.125] File does not exist: /var/www/favicon.ico[/quote]
reportError.txt:

Code in Python. Ask the user to enter the backend error log file name ("ErrorLog.txt") Read...
I am new to Python and
am having trouble coming up with writing code to the following
problem...
The program must:
Prompt for a file name
Opens that file and reads through the file
Displays a custom error message if the file does not exist
You can pull the hour out from the 'From ' line by finding the
time and then splitting the string a second time using a
colon.
From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008
Accumulated the...
c++ please :)
First, ask the user to enter a year (4-digit) and what week day does this year starts with (String) For example, the year 2018 starts with the week day "Friday". In this case, the calendar should start from January 1 which is Friday, 2018 Your program should produce a formatted calendar for the specified year and there should be a blank line after each month. Moreover, the month and the year should be centered over each month....
Most system administrators would like to know the utilization of their systems by their users. On a Linux system, each user's login records are normally stored in the binary file /var/log/wtmp. The login records in this binary file can not be viewed or edited directly using normal Linux text commands like 'less', 'cat', etc. The 'last' command is often used to display the login records stored in this file in a human readable form. Please check the man page of...
Use the csv file on spotify from any date
Code from lab2
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class SongsReport {
public static void main(String[] args) {
//loading name of file
File file = new File("songs.csv");
//reading data from this file
//scanner to read java file
Scanner reader;
//line to get current line from the
file
String line="";
...
Here is the red_sox.txt file 2011-07-02 Red Sox @ Astros Win 7-5 2011-07-03 Red Sox @ Astros Win 2-1 2011-07-04 Red Sox vs Blue Jays Loss 7-9 2011-07-05 Red Sox vs Blue Jays Win 3-2 2011-07-06 Red Sox vs Blue Jays Win 6-4 2011-07-07 Red Sox vs Orioles Win 10-4 2011-07-08 Red Sox vs Orioles Win 10-3 2011-07-09 Red Sox vs Orioles Win 4-0 2011-07-10 Red Sox vs Orioles Win 8-6 2011-07-15 Red Sox @ Rays Loss 6-9 2011-07-16 Red...
PYTHON The program needs to process the arrival and departure of each patient documented in the patient data file. While processing each patient, send the following output to an output file: a.Use your two new functions to initially print out a "0". b. As each patient arrives, print out the name of the patient & the time that they arrive at. c. Update the billboard counter to indicate that the wait time has increased. d. Print out the new billboard...
Please write the python functions
Problem: Electric wire (Figure is a cylindrical conductor covered by an insulating material. Figure 2 shows the structure ofa single conductor. The resistance of a piece ofwire is given by the formula: A d where ρ is the resistivity of the conductor, and I (in meter), A, and d (in meter) are the length, cross-sectional area, and diameter of the wire. The wire diameter, d, is commonly specified by the American Wire Gauge (AWG). Which...
c++ programming
no use of classes
use of functions
pseudo code with comments
Requirement: Provide one application for a business store that sale 2 models of one proo model FA218 and model FA318. The application first provides the menu to allow users can select one of the following tasks per time and when they finish one task, they can continue the application to select other task from the menu until they choose exit. All the output on the screen and...
I'm making a To-Do list in Python 2 and had the program running
before remembering that my professor wants me to put everything in
procedures. I can't seem to get it to work the way I have it now
and I can't figure it out. I commented out the lines that was
originally in the working program and added procedures to the top.
I've attached a screenshot of the error & pasted the code
below.
1 todo_list = []
2...
Create a new What SUP Operating
Cash Receipts Budget using the ch6-02 file to start your work,
create a worksheet similar to the one created in this chapter to
budget operating cash receipts by month for 3 months. Place
assumption information in the cells provided, and define and use
names extensively. The company expects to incur repair hours of
800, 900, and 950 in January, February, and March (respectively) at
an expected hourly rate of $80. Product sales revenue of...