Write a function in C to merge text files
- or -
Post a project like this303
$
- Posted:
- Proposals: 14
- Remote
- #2778017
- OPPORTUNITY
- Awarded
Description
Experience Level: Entry
Estimated project duration: 1 day or less
I have written a program in C that process lines from a text file. I would like to expand the program with a function that includes the text from referenced files and text from files referenced by the referenced files and writes the output to a new file. Where a file is referenced the calling line should be written to the output file and preceded with a %. I would like to write this but don’t have the time.
The function is to be written in C with emphasis on reliability, readability and future maintenance. The files can be large so speed is a consideration. Memory and disk space are not an issue but any memory used should be released before leaving the function
Checks are to be included to pick up any errors with the errors written to a text string that is passed back to the calling program. The referenced files are called with the command \vimport{path/file.txt}
My preference is to format the code GNU style with 3 character tab.
I use Linux so the path is formatted accordingly.
See the attached files for example input and output files. Due to the pph limits, three input files are combined into one file.
THE BUDGET HAS BEEN REMOVED
The function is to be written in C with emphasis on reliability, readability and future maintenance. The files can be large so speed is a consideration. Memory and disk space are not an issue but any memory used should be released before leaving the function
Checks are to be included to pick up any errors with the errors written to a text string that is passed back to the calling program. The referenced files are called with the command \vimport{path/file.txt}
My preference is to format the code GNU style with 3 character tab.
I use Linux so the path is formatted accordingly.
See the attached files for example input and output files. Due to the pph limits, three input files are combined into one file.
THE BUDGET HAS BEEN REMOVED

Tim H.
100% (7)Projects Completed
7
Freelancers worked with
5
Projects awarded
73%
Last project
3 Aug 2020
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
How deeply nested can the referenced files be, I.e. how many levels of nesting?
Tim H.01 Apr 2020Ideally, the number of levels would be undefined, I had assumed that references to the open files would be stored on a stack. If you need a defined number then allow for 16 deep.
906996
We use cookies to improve your experience and our services. By using PeoplePerHour, you agree to ourCookie Policy