سؤال

My list with numbers in OpenOffice calc look so: http://prntscr.com/3hlqaa and on save as .csv my parameters are: http://prntscr.com/3hlrms, as field delimetter "," but if i open this file with notepad i see it so:

546
5454
5456
5446
58654
8796
13211

but i need it to have so:

546,5454,5456,5446,58654,8796,13211

Can someone help me what i do wrong here?

هل كانت مفيدة؟

المحلول

The export is correct, as @Frazz says there is "one line in csv for every row in excel file", if you want all the numbers in one line, there are several ways, i will use this PHP script:

<?
$file = file_get_contents("your_export_file.csv"); //Name of your file
$replaced_data = str_replace("\n",",",$file);
file_put_contents("new_export_file.csv",$replaced_data); //Desired name
?>

If you don't have PHP installed perhaps an advanced editor (Notepad++, Sublime, Eclipse, Netbeans,..) could do the job, just replace \n for ,

نصائح أخرى

It seems that the end-of-lines are not transformed to the delimiters. If you put all the numbers in one line, it should work. At least it does in Excel (which seens to work similar).

You can use the Transpose function to get (a copy) in one line. https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_TRANSPOSE_function

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top