Important announcements from CouchCMS team
29 posts Page 3 of 3
This is great :D
It's a revolution :D :D

Thank you very much
Thanks, @KK - great code and amazing feature :)
Ok, so now 'db_persist' tag can create folders (as seen in attached 'get_folders.html')? That's nice. Will bookmark this topic :)
Is it possible to choose the columns to get the specific data, and not loop through all of them, without importing the data into db, just reading them?Thnx
Short answer is 'no'. The nature of addon is to read csv file row by row and then split it into all columns. Excluding some columns shouldn't speed up things noticeably.
Hey trendoman, thanks so much for replying so fast. I have 28 columns in my csv and I just need to show 3 of them, the problem was these three values were always iterated through the loop of all 28 columns; speeding up the process was not the issue.
Anyway, never mind, I got it to work, adding new parameters for csv_column and csv_headers.
Maybe you could share your final solution?
Of course, sure!

I edited the csv.php file adding new parameter in csv_columns_handler and csv_headers_handler function separately, cause they use different values for indexing columns (I also added these two parameters to csv_reader_handler function, although I'm not sure, maybe this is not necessary).

All this to be able to control the input through my template, where the csv is imported (ie <cms:csv_columns yourparameter='RecNo, Name'>, where these values are your header names and <cms:csv_headers yourparameter2='1,2'>, where these are column numbers - corresponding to column values). This could probably be uniform (one parameter), column numbers for both, i guess, easy..

So then I got these strings, exploded them into arrays and added the conditions in foreach and for loops, for columns and headers respectively, if in_array (or !in_array, which ever you need) and then set the values and headers.

I hope this is clear enough, if you have any further questions, just ask away
Alternative solution to fetch and filter content of CSV files is to import them to a mysql table and apply SQL with 'cms:query'.
29 posts Page 3 of 3

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests