Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C + + Your job is to create a program that takes in a standard text ( . txt ) file and converts that to

C++ 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. We'll
define|
when you should have a new line in the CSV file by an exit character: -1. 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:
1
2
-1
3
4
-1
Would be translated to a CSV file as:
1,2
3,4
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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago