pereges said:
This might be a little offtopic..But I wanted to know if there are any
functions in C library (even if its in the most recent C standard)
that can aid me in creating EDI files from CSV files. I've managed to
read the CSV files line by line with standard C library functions.
In order to extract information from a data format you need to employ a parser that recognizes that
particular language/data format. The only reason you were able to use standard functions to extract
information from a specific data format (CSV) is due to nothing more than sheer dumb luck. In fact,
I'm not sure if the word "luck" should be used to describe this because, as that particular data
input procedure doesn't employ any error detection, if you rely on this method to import data then
there is absolutely no assurance that you are handling a valid data format, let alone that the data
you have been importing is valid.
So, if you need to import data from any file, whether it's CSV or EDI, you should make sure that the
data is correctly described through a valid language/data format and you should rely on a parser to
both extract the information and react to any possible error. As the C standard library doesn't
include any parser, you need to either write your own or get your hands on a library that does that
for you.
Hope this helps,
Rui Maciel