<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[בעיה בפתיחת קובץ CSV באקסל]]></title><description><![CDATA[<p dir="auto">אני מאפשר לייצא קובץ עם נתונים של התוכנה לפורמט CSV לקריאה באקסל.<br />
כאשר אני מגדיר לתכנה לשמור אותו עם ".csv" בסוף אז זה נפתח אוט' באקסל, אבל הבעיה שכל הנתונים נמצאים בתא אחד והוא לא מזהה שהוא צריך לחלק אותם לעמודות לפי הפסיקים.<br />
כאשר אני לא מגדיר את הסיומת של הקובץ, אז המחשב לא יודע דרך איזה תכנה לפתוח אותו, וכאשר אני בוחר באקסל ועושה שם המרה מפורשת אז הכל  מצויין.<br />
מישהו יודע האקסל לא יודע לזהות אותו בצורה אוט', או מה עושים כדי שזה יעבוד אוט'?</p>
<p dir="auto">תודה רבה!</p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב16/08/2015 22:15 (+03:00)</em></p>
]]></description><link>https://tchumim.com/topic/766/בעיה-בפתיחת-קובץ-csv-באקסל</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 08:10:58 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/766.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 29 Jan 2018 11:09:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:12 GMT]]></title><description><![CDATA[<p dir="auto">ביוניקוד כל תו מקבל 16 סיביות ואילו ה Default הוא למעשה קידוד שנקרא windows-1255 ושם כל תו מקבל 8 סיביות<br />
ראה בהרחבה <a href="https://he.wikipedia.org/wiki/%D7%99%D7%95%D7%A0%D7%99%D7%A7%D7%95%D7%93" target="_blank" rel="noopener noreferrer nofollow ugc">כאן</a></p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב17/08/2015 17:41 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4891</link><guid isPermaLink="true">https://tchumim.com/post/4891</guid><dc:creator><![CDATA[רחמים]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:12 GMT</pubDate></item><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%A8%D7%97%D7%9E%D7%99%D7%9D">@<bdi>רחמים</bdi></a></p>
<blockquote>
<p dir="auto">נראה לי שצריך לקודד את הקובץ עם Encoding.Default</p>
</blockquote>
<p dir="auto">מעולה!! זה פתר את הבעיה!!<br />
וסתם ליידע כללי מה ההבדל בין encoding.Default ל encoding.Unicode?<br />
תודה רבה!</p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב17/08/2015 17:29 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4890</link><guid isPermaLink="true">https://tchumim.com/post/4890</guid><dc:creator><![CDATA[avr416]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:11 GMT</pubDate></item><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:10 GMT]]></title><description><![CDATA[<p dir="auto">נראה לי שצריך לקודד את הקובץ עם Encoding.Default</p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב17/08/2015 16:30 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4889</link><guid isPermaLink="true">https://tchumim.com/post/4889</guid><dc:creator><![CDATA[רחמים]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:10 GMT]]></title><description><![CDATA[<p dir="auto">כן<br />
הנה<a href="/assets/uploads/files/1517224149101-%D7%93%D7%95%D7%92%D7%9E%D7%901.csv">דוגמא1.csv</a><br />
את ההוא שהוא בלי סיומת CSV האתר לא נותן לי להעלות   :lol:<br />
(כנראה מטעמי אבטחה??)<br />
תודה רבה</p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב16/08/2015 23:15 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4888</link><guid isPermaLink="true">https://tchumim.com/post/4888</guid><dc:creator><![CDATA[avr416]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:10 GMT]]></title><description><![CDATA[<p dir="auto">תוכל להעלות קובץ CSV לדוגמא?</p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב16/08/2015 23:03 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4887</link><guid isPermaLink="true">https://tchumim.com/post/4887</guid><dc:creator><![CDATA[clickone]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:09 GMT]]></title><description><![CDATA[<p dir="auto">הם מופרדות עם פסיק.<br />
אם אני לא כותב בסיומת .csv ואח"כ אני פותח אותו דרך אקסל (כמובן הוא לא מכיר אותו ואני עושה המרה, ובוחר להפריד עמודות לפי פסיקים..) אז התוצאה מצויינת.. הבעיה היא שאני לא יכול לצפות שהלקוח יעשה את כל זה..</p>
<p dir="auto">השתמשתי במחלקה הבאה ליצירת CSV (מצאתי אותה ב"גלישת מחסנית" :lol:)</p>
<pre><code>public class CsvExport&lt;T&gt; where T : class
    {
        public List&lt;T&gt; Objects;

        public CsvExport(List&lt;T&gt; objects)
        {
            Objects = objects;
        }

        public string Export()
        {
            return Export(true);
        }

        public string Export(bool includeHeaderLine)
        {

            StringBuilder sb = new StringBuilder();
            //Get properties using reflection.
            IList&lt;PropertyInfo&gt; propertyInfos = typeof(T).GetProperties();

            if (includeHeaderLine)
            {
                //add header line.
                foreach (PropertyInfo propertyInfo in propertyInfos)
                {
                    sb.Append(propertyInfo.Name).Append(",");
                }
                sb.Remove(sb.Length - 1, 1).AppendLine();
            }

            //add value for each property.
            foreach (T obj in Objects)
            {
                foreach (PropertyInfo propertyInfo in propertyInfos)
                {
                    sb.Append(MakeValueCsvFriendly(propertyInfo.GetValue(obj, null))).Append(",");
                }
                sb.Remove(sb.Length - 1, 1).AppendLine();
            }

            return sb.ToString();
        }

        //export to a file.
        public void ExportToFile(string path)
        {
            File.WriteAllText(path,Export(),Encoding.Unicode);
        }

        //export as binary data.
        public byte[] ExportToBytes()
        {
            return Encoding.UTF8.GetBytes(Export());
        }

        //get the csv value for field.
        private string MakeValueCsvFriendly(object value)
        {
            if (value == null) return "";
            if (value is Nullable &amp;&amp; ((INullable)value).IsNull) return "";

            if (value is DateTime)
            {
                if (((DateTime)value).TimeOfDay.TotalSeconds == 0)
                    return ((DateTime)value).ToString("yyyy-MM-dd");
                return ((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss");
            }
            string output = value.ToString();

            if (output.Contains(",") || output.Contains("\""))
                output = '"' + output.Replace("\"", "\"\"") + '"';

            return output;

        }
    }
</code></pre>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב16/08/2015 22:27 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4886</link><guid isPermaLink="true">https://tchumim.com/post/4886</guid><dc:creator><![CDATA[avr416]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:09 GMT</pubDate></item><item><title><![CDATA[Reply to בעיה בפתיחת קובץ CSV באקסל on Mon, 29 Jan 2018 11:09:09 GMT]]></title><description><![CDATA[<p dir="auto">מה המבנה של הCSV שלך?<br />
אתה צריך להפריד את העמודות עם פסיק.</p>
<p dir="auto"><em>פורסם במקור בפורום CODE613 ב16/08/2015 22:17 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/4885</link><guid isPermaLink="true">https://tchumim.com/post/4885</guid><dc:creator><![CDATA[clickone]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:09:09 GMT</pubDate></item></channel></rss>