Handle the csv format is quite common, because many applications you can export the data in this very simple format.
if ($ handle = @ fopen ("../ data / RA.csv "," r ")) {
while (! feof ($ handle)) {$ buffer = fgets
($ handle, 1024); $ row = explode (" the output in a different way than you expect.
A more general solution is possible by using a function as parameter, which allows you to control the output format
file_csv_format function ($ file, $ separator, $ format_funct)
{$ handle = @ fopen ($ file, "r");
if ($ handle) {
while (! feof ($ handle)) {$ buffer = fgets ($ handle, 1024); $ row = explode ($ separator, $ buffer); $
format_funct ($ row);}
fclose ($ handle);
}} function simple_format ($ row) { echo "# USE". $ row [4]. "
\\ n";}
file_csv_format ("../ data / RA.dat ','
post, I share with you my list:
Never say "I can not" clear goals
now, do it!
learn every day, efficiently
Never give up
analyze the situation and learn from the mistakes
concentrated
Do not try to be nice impression
Be reliable
0 comments:
Post a Comment