Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What file types can use System.IO.File.ReadAllLines()

I'm creating a program that can convert different files types to pdf.

After creating a .txt to .pdf converter, which uses System.IO.File.ReadAllLines()

I realized that I could use that same converter for .csv, which left me wondering what other file types I could theoretically support because of the ReadAllLines approach.

like image 533
stackoverfloweth Avatar asked Mar 06 '23 05:03

stackoverfloweth


1 Answers

Since ReadAllLines() reads the lines as text, you can use it for any text-based file type. There is no comprehensive list of "types" of files in this category (new file types are invented all the time), but most of them are probably going to be files intended for use as code (.cs, .java, etc.), or as structured data which is often used to transfer data between applications (.xml, .json, etc.).

You could theoretically call the method for other (binary) files, but you'd end up with a bunch of useless gobbledegook.

like image 158
StriplingWarrior Avatar answered Mar 16 '23 04:03

StriplingWarrior