Create a project called Practice 15. Write a program that asks the user to enter a file name. The file directory will be your own project folder. also, the file should have a small text, no longer than 50 characters. Read the file into a buffer that is larger than 50 characters. Search the buffer for the letter "a" and replace it with capital "A". Then write the buffer to a file called test.txt inside your own project folder, and display a message that the following text ... was written to test.txt. Of course, replace the dots with the text found in the user's file.
Reading and Displaying Large Files
Create a program that will ask the user to enter the name of a text file. The text file should be in your project folder, so that you can upload it with your archived folder. The length of the text file should be at least 640 characters. Read the file in a buffer. The buffer has to be 64 bytes. Since your text file is larger than the buffer, you will have to take from the text file 64 bytes at a time and then display them in the console.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.INCLUDE Irvine32.inc
BUFFER_SIZE = 64
buffer BYTE BUFFER_SIZE DUP(?)
filename BYTE 80 DUP(0)
fileHandle HANDLE ?
msg BYTE 0dh, 0ah, "Here is the text:", 0dh,0ah, 0dh, 0ah,0
; Let user input a filename.
mWrite "Enter an input filename: " ; output message
mov edx,OFFSET filename ; setup input buffer
mov ecx,SIZEOF filename ; setup size of buffer
call ReadString ; read string
; Open the file for input.
mov edx,OFFSET filename ; prepare to open the file
call OpenInputFile ; open file
mov fileHandle,eax ; store address of pointer to the file
; Check for errors.
cmp eax,INVALID_HANDLE_VALUE ; error opening file?