2016년 12월 25일 일요일

CSV properties


I wish to append a new row into CSV file (action triggered by clock), being able to open it in Microsoft Excel in the following set of data:

Auto Generated Inline Image 1 표시 중

Auto Generated Inline Image 2 표시 중

What's wrong with these blocks Guys? I'm still getting results in just one row and lots of """ signs that are not desirable.

--
remove the list to csv table block.

-- 
I am still getting all data in exactly one row.

-- 
use Do it to debug your blocks, see also tip 4 here

-- 
I use this approach
CSV.jpg 표시 중
-- 
yes, list to csv row will convert everything into one row
you probably like to use list to csv table instead?
assuming, global templist is a list of lists...
you might want to provide a screenshot incl. Do it result next time...

-- 
To elaborate, my bit of code adds a single line to a CSV file every time it is called (templist is just a simple list). The point is you need to add the /n to make sure the next time the code is called the data is written to a new line.


--
Richard Freestone the problem is that Excel put this entire row into one cell. It doesn't split a list to separete cells in horizontal way. I wish to get rid of the "" marks too.
Auto Generated Inline Image 1 표시 중


-- 
The problem is with Excel. 
Despite the name (Comma Separated Values), it usually uses ; as separator value instead of ,
You could transform the text in the file by using replace all text first to replace " by an empty string, and next, replace , by ;
A problem could be that your values also contain a , therefor the " is used in AI. And maybe, if you use ; instead of , excel will see your " enclosed values as text, and strip them.
Try it out.

-- 
My version of excel (2007) works OK with commas etc. Not sure which version you are using. You could try making the extension .txt then excel will ask for separators etc


--
Here is my csv created by App Inventor which loads OK into Excel 2007

-- 
Does it help to tell Excel ahead of time that those columns should hold only numerical values before loading the csv data?

-- 
I think I can see a problem with your CSV file in that it does not follow the pattern "data1","data2"," data3","data4",         etc. I don't know why it has happened.

I can see things like data1""data2 and data1"data2. This will confuse excel.

Happy to look at your code and your CSV file if you post them.

--


댓글 없음:

댓글 쓰기