I’m having trouble thinking up a good way to implement a file importing class,
I’d like it to be able to read any file, then based on the delimiters of the line’s content, determine the structure of the file (not the type structure),
for instance, say i had a file called, A.txt
the file contains lines of data seperated by the , delimiter,
the result would be an array of strings if i were to split by ‘,’ however, how can i dynamically determine the delimiter, then set the output as column names?
say if the first line of a.txt was “1,2,3,4,5”
the output should be
delimter : ","
column[0] = "1"
column[1] = "2"
column[2] = "3"
column[4] = "4"
column[5] = "5"
Does anyone have any good ideas? and i’m not sure, but would it be possible to somehow magically determine what the data types can be depending on the the values of the strings are, if not this is alright, but i thought id ask anyways.
thanks
you can try this.