Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your job is to create a program that takes in a standard text ( . txt ) file and converts that to a CSV (
Your job is to create a program that takes in a standard text txt file and converts that to a CSV
csv file. Each item will be designated by an individual item per line in the text file. Well define
when you should have a new line in the CSV file by an exit character: So assume each item
is moving horizontally in the CSV until the exit character which will move the file down.
So the following sample text file:
Would be translated to a CSV file as:
Your program should, take in a base filename WITHOUT AN EXTENSION open that filename
with txt added and verify the existence in a loop. Once you have a valid file, read the contents
into a vector and close the input file. Then, open an output file of the input filename with csv
added and write the contents of the vector appropriately.
Your program should end with the following files existing:
filename.txt
filename.csv
A couple sample text files have been provided to use
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started