<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ csv - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ csv - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 25 May 2026 05:06:38 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/csv/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Create a CSV File Using Python ]]>
                </title>
                <description>
                    <![CDATA[ CSV is an acronym for comma-separated values. It's a file format that you can use to store tabular data, such as in a spreadsheet. You can also use it to store data from a tabular database. You can refer to each row in a CSV file as a data record. ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-create-a-csv-file-in-python/</link>
                <guid isPermaLink="false">66d45e02a3a4f04fb2dd2e39</guid>
                
                    <category>
                        <![CDATA[ csv ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Damilola Oladele ]]>
                </dc:creator>
                <pubDate>Wed, 01 Mar 2023 00:43:48 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/02/csv-article-cover-image-2.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p><strong>CSV</strong> is an acronym for comma-separated values. It's a file format that you can use to store tabular data, such as in a spreadsheet. You can also use it to store data from a tabular database.</p>
<p>You can refer to each row in a CSV file as a data record. Each data record consists of one or more fields, separated by commas.</p>
<p>This article shows you how to use the Python built-in module called <strong>csv</strong> to create CSV files. In order to fully comprehend this tutorial, you should have a good understanding of the fundamentals of the Python programming language.</p>
<p>The csv module has two classes that you can use in writing data to CSV. These classes are:</p>
<ul>
<li><p>the <code>csv.writer</code> class</p>
</li>
<li><p>the <code>csv.DictWriter</code> class</p>
</li>
</ul>
<h2 id="heading-how-to-create-a-csv-file-using-the-csvwriter-class">How to Create a CSV File Using the <code>csv.writer</code> Class</h2>
<p>You can use the <code>csv.writer</code> class to write data into a CSV file. The class returns a writer object, which you can then use to convert data into delimited strings.</p>
<p>To ensure that the newline characters inside the quoted fields interpret correctly, open a CSV file object with <strong>newline=''</strong>.</p>
<p>The syntax for the <strong>csv.writer</strong> class is as follows:</p>
<pre><code class="lang-python">csv.writer(csvfile, dialect=’excel’, **fmtparams)
</code></pre>
<p>Now, let me walk you through the meaning of the different parameters used in the syntax.</p>
<ol>
<li><p>The <code>csvfile</code> parameter represents the csvfile object with the <code>write()</code> method.</p>
</li>
<li><p>The optional <code>dialect</code> parameter represents the name of the dialect you can use in writing the CSV file.</p>
</li>
<li><p>The optional <code>fmtparams</code> parameter represents the formatting parameters that you can use to overwrite the parameters specified in the dialect.</p>
</li>
</ol>
<p>The <strong>csv.writer</strong> class has two methods that you can use to write data to CSV files. The methods are as follows:</p>
<h3 id="heading-the-writerow-method">The <code>writerow()</code> Method</h3>
<p>The <code>writerow()</code> method takes in iterable data as its parameter and then writes the data to your CSV file in a single row. One popular usage of the <strong>writerow()</strong> method is using it to write the field row of your CSV file.</p>
<p>Now let me show you how you can use the <strong>writerow()</strong> method to write a single row into your CSV file.</p>
<p>In your code editor, create a file with the name <a target="_blank" href="http://profiles1.py"><em>profiles1.py</em></a>. Then write the following code in the file:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> csv

<span class="hljs-keyword">with</span> open(<span class="hljs-string">'profiles1.csv'</span>, <span class="hljs-string">'w'</span>, newline=<span class="hljs-string">''</span>) <span class="hljs-keyword">as</span> file:
    writer = csv.writer(file)
    field = [<span class="hljs-string">"name"</span>, <span class="hljs-string">"age"</span>, <span class="hljs-string">"country"</span>]

    writer.writerow(field)
    writer.writerow([<span class="hljs-string">"Oladele Damilola"</span>, <span class="hljs-string">"40"</span>, <span class="hljs-string">"Nigeria"</span>])
    writer.writerow([<span class="hljs-string">"Alina Hricko"</span>, <span class="hljs-string">"23"</span>, <span class="hljs-string">"Ukraine"</span>])
    writer.writerow([<span class="hljs-string">"Isabel Walter"</span>, <span class="hljs-string">"50"</span>, <span class="hljs-string">"United Kingdom"</span>])
</code></pre>
<p>The explanation for the code in <code>profiles1.py</code> is as follows:</p>
<ol>
<li><p>Line one imports the Python <em>csv</em> module.</p>
</li>
<li><p>Line two is a blank line that separates the imported module from the rest of the code.</p>
</li>
<li><p>Line three of the code opens the CSV file in writing (w mode) with the help of the <code>open()</code> function.</p>
</li>
<li><p>Line four creates a CSV writer object by calling the writer() function and stores it in the <code>writer</code> variable.</p>
</li>
<li><p>Line five creates a variable named <code>fields</code>, which stores a list that consists of strings, each representing the title of a column in the CSV file.</p>
</li>
<li><p>Line six and below writes the field data and other data to CSV file by calling the <strong>writerow()</strong> method of the CSV writer object.</p>
</li>
</ol>
<p>Once you are done, go to your command line terminal and navigate to the directory that has the Python file <em>profiles1.py</em>. Run the following command:</p>
<pre><code class="lang-sh">python profiles1.py
</code></pre>
<p>You should get a CSV file named <em>profiles1.csv</em> in your working directory with the following text in it:</p>
<pre><code class="lang-bash">name,age,country
Oladele Damilola,40,Nigeria
Alina Hricko,23,Ukraine
Isabel Walter,50,United Kingdom
</code></pre>
<h3 id="heading-the-writerows-method">The <code>writerows()</code> Method</h3>
<p>The <strong>writerows()</strong> method has similar usage to the writerow() method. The only difference is that while the writerow() method writes a single row to a CSV file, you can use the <strong>writerows()</strong> method to write multiple rows to a CSV file.</p>
<p>To see how the <strong>writerows()</strong> method works, create a file named <em>profiles2.py</em> in your working directory. Then write the following code in the file you created:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> csv

<span class="hljs-keyword">with</span> open(<span class="hljs-string">'profiles2.csv'</span>, <span class="hljs-string">'w'</span>, newline=<span class="hljs-string">''</span>) <span class="hljs-keyword">as</span> file:
    writer = csv.writer(file)
    row_list = [
        [<span class="hljs-string">"name"</span>, <span class="hljs-string">"age"</span>, <span class="hljs-string">"country"</span>], 
        [<span class="hljs-string">"Oladele Damilola"</span>, <span class="hljs-string">"40"</span>, <span class="hljs-string">"Nigeria"</span>], 
        [<span class="hljs-string">"Alina Hricko"</span>, <span class="hljs-string">"23"</span> <span class="hljs-string">"Ukraine"</span>], 
        [<span class="hljs-string">"Isabel Walter"</span>, <span class="hljs-string">"50"</span> <span class="hljs-string">"United Kingdom"</span>],
    ]

    writer.writerows(row_list)
</code></pre>
<p>After writing the code in your profiles2.py file, go to your command line terminal and run the following command:</p>
<pre><code class="lang-sh">python profiles2.py
</code></pre>
<p>Now you should have a CSV file named <em>profiles2.csv</em> in your working directory. The file should have the data in the <code>row_list</code> variable.</p>
<h2 id="heading-how-to-create-a-csv-file-using-the-csvdictwriter-class">How to Create a CSV File Using the <code>csv.DictWriter</code> Class</h2>
<p>You can use the <code>csv.DictWriter</code> class to write a CSV file from a dictionary. This is unlike the csv.writer Class, which writes to a CSV file from a list.</p>
<p>The syntax for the <strong>csv.DictWriter</strong> is as follows:</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">csv</span>.<span class="hljs-title">DictWriter</span>(<span class="hljs-params">csvfile, fieldnames, restval=<span class="hljs-string">''</span>, extrasaction=<span class="hljs-string">'raise'</span>, dialect=<span class="hljs-string">'excel'</span>, *args, **kwds</span>)</span>
</code></pre>
<p>Now let me explain the meaning of the different parameters in the syntax:</p>
<ol>
<li><p>The <code>csvfile</code> represents the file object with the <code>write()</code> method</p>
</li>
<li><p>The <code>fieldnames</code> parameter is a sequence of keys that identify the order in which Python passes the values in the dictionary.</p>
</li>
<li><p>The <code>restval</code> parameter is optional and it specifies the value to be written if the dictionary is missing a key in fieldnames.</p>
</li>
<li><p>The <code>extrasaction</code> parameter is optional and it specifies the action to take if a key is not found in fieldnames. Setting this parameter to <code>raise</code>, raises a <em>ValueError</em>.</p>
</li>
<li><p>The <code>dialect</code> parameter is optional and it represents the name of the dialect you want to use.</p>
</li>
</ol>
<p>The <strong>csv.DictWriter</strong> class has two methods that you can use to write data to CSV files. The methods are as follows:</p>
<h3 id="heading-the-writeheader-method">The <code>writeheader()</code> Method</h3>
<p>Use the <strong>writeheader()</strong> method to write the first row of your csv file using the pre-specified <code>fieldnames</code>.</p>
<p>To see how the the <strong>writeheader()</strong> method works, create a new file named <em>profiles3.py</em> in your working directory. Then write the following code in the <em>profles3.py</em> file using your code editor:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> csv 

mydict =[{<span class="hljs-string">'name'</span>: <span class="hljs-string">'Kelvin Gates'</span>, <span class="hljs-string">'age'</span>: <span class="hljs-string">'19'</span>, <span class="hljs-string">'country'</span>: <span class="hljs-string">'USA'</span>}, 
         {<span class="hljs-string">'name'</span>: <span class="hljs-string">'Blessing Iroko'</span>, <span class="hljs-string">'age'</span>: <span class="hljs-string">'25'</span>, <span class="hljs-string">'country'</span>: <span class="hljs-string">'Nigeria'</span>}, 
         {<span class="hljs-string">'name'</span>: <span class="hljs-string">'Idong Essien'</span>, <span class="hljs-string">'age'</span>: <span class="hljs-string">'42'</span>, <span class="hljs-string">'country'</span>: <span class="hljs-string">'Ghana'</span>}]

fields = [<span class="hljs-string">'name'</span>, <span class="hljs-string">'age'</span>, <span class="hljs-string">'country'</span>] 

<span class="hljs-keyword">with</span> open(<span class="hljs-string">'profiles3.csv'</span>, <span class="hljs-string">'w'</span>, newline=<span class="hljs-string">''</span>) <span class="hljs-keyword">as</span> file: 
    writer = csv.DictWriter(file, fieldnames = fields)

    writer.writeheader()
</code></pre>
<p>The explanation of the code in <em>profiles3.py</em> is as follows:</p>
<ol>
<li><p>Line one imports the Python <em>csv</em> module.</p>
</li>
<li><p>Line two is a blank space that separates the Python csv module from the rest of the code.</p>
</li>
<li><p>Line three stores a list that contains three different dictionaries in a variable named <code>mydict</code>. The dictionaries have the data of different profiles in them.</p>
</li>
<li><p>Line seven stores strings, which represent the title of each column of the CSV file that you want to create in a variable named <code>fields</code>.</p>
</li>
<li><p>Line nine opens the <em>profiles3.csv</em> file in writing mode using <code>open()</code> function.</p>
</li>
<li><p>The <code>csv.DictWriter()</code> function in line ten creates the CSV dictionary writer object.</p>
</li>
<li><p>Line twelve passes the list of dictionaries to the <code>writer.writeheader()</code> function to write the pre-defined field names.</p>
</li>
</ol>
<p>Once you are done writing the code, go to your command line terminal and navigate to the directory that has the python file <em>profiles3.py</em>. Run the following command:</p>
<pre><code class="lang-sh">python profiles3.py
</code></pre>
<p>Now, you should get a CSV file a named <em>profiles3.csv</em> in your working directory that has the following text in it:</p>
<pre><code class="lang-bash">name,age,country
</code></pre>
<h3 id="heading-the-writerows-method-1">The <code>writerows()</code> Method</h3>
<p>The <strong>writerows()</strong> method has a similar usage as the writeheader() method. You can use the method to write all the rows. The method writes only the values and not the keys.</p>
<p>To use the <strong>writerows()</strong> method, add this line of code to your code in <em>profiles3.py</em>:</p>
<pre><code class="lang-python">writer.writerows(mydict)
</code></pre>
<p>Now delete the <em>profiles3.csv</em> in your working directory and re-run the following command in your command line terminal:</p>
<pre><code class="lang-sh">python profiles3.py
</code></pre>
<p>You should now have a new CSV file named <em>profiles3.csv</em> in your working directory that has the following text in it:</p>
<pre><code class="lang-bash">name,age,country
Kelvin Gates,19,USA
Blessing Iroko,25,Nigeria
Idong Essien,42,Ghana
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Although CSV got its name from a <strong>comma</strong>, the comma is just a delimiter that separates the data.</p>
<p>You should know that a comma is a popular delimiter you will get in most CSV files. However, the delimiter could also be something else. For instance, you can use a semi-colon to separate the data instead of a comma.</p>
<p>If you like this tutorial, kindly <a target="_blank" href="https://twitter.com/activus_d">follow me on Twitter</a> and give me a shout out.</p>
<h3 id="heading-references-and-further-reading">References and Further Reading</h3>
<ul>
<li><a target="_blank" href="https://docs.python.org/3/library/csv.html?highlight=csv">https://docs.python.org/3/library/csv.html?highlight=csv</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ CSV Format – How to Open a .csv File and Export it ]]>
                </title>
                <description>
                    <![CDATA[ You might have heard of a CSV file but what does it mean?  In this article, we are going to learn what a CSV file is, and how to open and export them using Microsoft Excel and Google Sheets.  What is a CSV file? CSV stands for Comma ]]>
                </description>
                <link>https://www.freecodecamp.org/news/csv-format-how-to-open-a-csv-file-and-export-it/</link>
                <guid isPermaLink="false">66b8d941f805ffd579552e81</guid>
                
                    <category>
                        <![CDATA[ csv ]]>
                    </category>
                
                    <category>
                        <![CDATA[ excel ]]>
                    </category>
                
                    <category>
                        <![CDATA[ google sheets ]]>
                    </category>
                
                    <category>
                        <![CDATA[ spreadsheets ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Fri, 17 Sep 2021 18:22:47 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/09/lukas-blazek-mcSDtbWXUZU-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You might have heard of a CSV file but what does it mean? </p>
<p>In this article, we are going to learn what a CSV file is, and how to open and export them using Microsoft Excel and Google Sheets. </p>
<h2 id="heading-what-is-a-csv-file">What is a CSV file?</h2>
<p>CSV stands for Comma Separated Values. This is a file that contains data separated by commas and is usually used in spreadsheets and databases. </p>
<p>This is an example of a CSV file. We have two categories of Full Name and Major and the data is separated by commas. </p>
<pre><code class="lang-txt">Full Name,Major
Dave Wilson,Computer Science Major
Kelly Clarks,Music Major
James Anderson,Business Major
</code></pre>
<p>Sometimes the separation of the data doesn't have to be a comma. It could be a space or semicolon.</p>
<p>This separator is called a delimiter but the most commonly used is a comma. </p>
<p>CSV files are very useful because you can share information between different programs as long as they can open up the file. </p>
<p>For example, I can create a CSV file in Microsoft Excel and import that data into my contacts. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.17.54-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.19.34-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-create-and-export-a-csv-file-in-microsoft-excel">How to Create and Export a CSV file in Microsoft Excel</h2>
<p>Microsoft Excel is a powerful tool that allows you to organize your data in the form of spreadsheets. The most common use cases for Excel would be to create budgets, sort and store data, and create charts or graphs. </p>
<p>Here are the steps for creating and exporting a CSV file in Excel.</p>
<ol>
<li>Click to open Microsoft Excel and go to File &gt; New</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.49.16-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Add data inside the spreadsheet</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.52.46-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Go to File &gt; Save</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.53.58-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>For the file format, choose <code>.csv</code> and click Save</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.55.00-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-open-a-csv-file-in-microsoft-excel">How to Open a CSV File in Microsoft Excel</h2>
<ol>
<li>Open Excel and go to File &gt; Open...</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.30.33-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Find the CVS file and click on Open</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.32.30-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You should then see your data opened in a spreadsheet:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.33.30-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-create-and-export-a-csv-file-in-google-sheets">How to Create and Export a CSV file in Google Sheets</h2>
<p>If you have a Google account, you can create and export CSV files using Google Sheets. </p>
<ol>
<li>Sign into your Google account</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-7.57.54-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Under Google Apps, scroll down and click on Sheets</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.00.22-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>To create a new Google Sheet, click on Blank</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.01.16-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>Add data and name your spreadsheet</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.04.23-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="5">
<li>Click File &gt; Download and choose the Comma Separated Values option</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.08.31-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The file should then download to your machine where you can open it in any program that opens CSV files. </p>
<h2 id="heading-how-to-open-a-csv-file-in-google-sheets">How to Open a CSV File in Google Sheets</h2>
<ol>
<li>Open up a Blank Google Spreadsheet</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.12.16-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Click on File &gt; Import</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.12.53-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You have four options to choose from. </p>
<ul>
<li>Import file from Google Drive</li>
<li>Import files shared with you</li>
<li>Import recent Files</li>
<li>Import Files from your computer</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.14.51-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>To import a file from your computer, click on Upload</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.15.38-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>Select a file from your computer. You should then see a pop up window like this:</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.17.20-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can choose to leave the default option or change your separator type.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.17.58-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can also choose to leave the default option or change the import location.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.19.19-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Once you are done, click on the Import data button.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.20.00-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You should now see the imported information appear in your Google Spreadsheet.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/Screen-Shot-2021-09-17-at-8.20.46-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>That is how to create, open, and export CSV files in Microsoft Excel and Google Sheets. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is a CSV File and How to Open the CSV File Format ]]>
                </title>
                <description>
                    <![CDATA[ What is a .csv file? CSV stands for Comma Separated Values. A CSV file is a plain text file that stores tables and spreadsheet information. The contents are often a table of text, numbers, or dates. CSV files can be easily imported and exported using... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-a-csv-file-and-how-to-open-the-csv-file-format/</link>
                <guid isPermaLink="false">66b2071608bc664c3c097f18</guid>
                
                    <category>
                        <![CDATA[ csv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Fri, 01 Nov 2019 17:56:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9fb1740569d1a4ca4407.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>What is a .csv file? CSV stands for Comma Separated Values. A CSV file is a plain text file that stores tables and spreadsheet information. The contents are often a table of text, numbers, or dates. CSV files can be easily imported and exported using programs that store data in tables.</p>
<h2 id="heading-csv-file-format">CSV File Format</h2>
<p>Usually the first line in a CSV file contains the table column labels. Each of the subsequent lines represent a row of the table. Commas separate each cell in the row, which is where the name comes from.</p>
<p>Here is an example of a CSV file. The example has three columns, labeled 'name', 'id', and 'food'. It has five rows including the header row.</p>
<pre><code>name, id, favorite food
quincy, <span class="hljs-number">1</span>, hot dogs
beau, <span class="hljs-number">2</span>, cereal
abbey, <span class="hljs-number">3</span>, pizza
mrugesh, <span class="hljs-number">4</span>, ice cream
</code></pre><p>Here is how that file looks in a spreadsheet.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/image-33.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Since a CSV file is just a text file, you can create one in almost any text editor. You can also export CSV files from almost any spreadsheet program, such as <a target="_blank" href="https://products.office.com/en-us/excel">Microsoft Word</a>, <a target="_blank" href="https://www.openoffice.org/product/calc.html">OpenOffice Calc</a>, or <a target="_blank" href="https://sheets.google.com">Google Sheets</a>.</p>
<h2 id="heading-how-to-open-a-csv-file">How to open a CSV file</h2>
<p>Opening a CSV file is simpler than you may think. In almost any text editor or spreadsheet program, just choose <strong>File &gt; Open</strong> and select the CSV file.</p>
<p>For most people, it is best to use a spreadsheet program. Spreadsheet programs display the data in a way that is easier to read and work with than a text editor. We'll go into more detail on opening a CSV file in <a target="_blank" href="https://products.office.com/en-us/excel">Microsoft Excel</a>, <a target="_blank" href="https://www.openoffice.org/product/calc.html">OpenOffice Calc</a>, and <a target="_blank" href="https://sheets.google.com">Google Sheets</a>.</p>
<h3 id="heading-open-a-csv-file-microsoft-excel">Open a CSV file Microsoft Excel</h3>
<p>If you already have Microsoft Excel installed, just double-click a CSV file to open it in Excel. After double-clicking the file, you may see a prompt asking which program you want to open it with. Select Microsoft Excel.</p>
<p>If you are already in Microsoft Excel, you can choose <strong>File &gt; Open</strong> and select the CSV file. If you don't see the file you want to open, you may need to change the file type to be opened to "Text Files (<em>.prn, </em>.txt, *.csv)". Excel will display the data in a new workbook.</p>
<p>You can also import data from a CSV file into an existing worksheet.</p>
<ol>
<li>On the <strong>Data</strong> tab, in the <strong>Get &amp; Transform Data</strong> group, click <strong>From Text/CSV</strong>.</li>
<li>In the <strong>Import Data</strong> dialog box, double-click the CSV file you want to import, and click <strong>Import</strong>.</li>
</ol>
<p>In the preview dialog box, you have a few options:</p>
<ul>
<li>Select <strong>Load</strong> if you want to load the data directly to a new worksheet.</li>
<li>Select <strong>Load to</strong> if you want to load the data to a table or existing worksheet. </li>
<li>Select <strong>Transform Data</strong> if you want to load the data to Power Query, and edit it before bringing it to Excel.</li>
</ul>
<h3 id="heading-open-a-csv-file-openoffice-calc">Open a CSV file OpenOffice Calc</h3>
<p>If you already have OpenOffice Calc installed, just double-click a CSV file to open it. After double-clicking the file, you may see a prompt asking which program you want to open it with. Select OpenOffice Calc.</p>
<p>If you are already in OpenOffice Calc, you can choose <strong>File &gt; Open</strong> and select the CSV file.</p>
<h3 id="heading-open-a-csv-file-google-sheets">Open a CSV file Google Sheets</h3>
<p>First, open a new spreadsheet file in Google Sheets. The fastest way is to go to <a target="_blank" href="https://sheets.new">https://sheets.new</a>.</p>
<p>Next, select <strong>File &gt; Import</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/image-35.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Select the <strong>Upload</strong> tab, then either drag the CSV file onto the window or select the CSV from your computer.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/image-36.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can probably keep the default values on the <strong>Import file</strong> window, but look over them just to make sure. Then select <strong>Import data</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/image-37.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You're done!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/10/image-38.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Obtain Historical Weather Forecast data in CSV format using Python ]]>
                </title>
                <description>
                    <![CDATA[ By Ekapope Viriyakovithya Recently, I worked on a machine learning project related to renewable energy, which required historical weather forecast data from multiple cities. Despite intense research, I had a hard time finding the good data source. Mo... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/obtain-historical-weather-forecast-data-in-csv-format-using-python/</link>
                <guid isPermaLink="false">66d45e42d14641365a0508ac</guid>
                
                    <category>
                        <![CDATA[ worldweatheronline ]]>
                    </category>
                
                    <category>
                        <![CDATA[ api ]]>
                    </category>
                
                    <category>
                        <![CDATA[ csv ]]>
                    </category>
                
                    <category>
                        <![CDATA[ dataframe ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Machine Learning ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ weather ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 09 Jul 2019 10:00:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9ca193740569d1a4ca4f62.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Ekapope Viriyakovithya</p>
<p>Recently, I worked on a machine learning project related to renewable energy, which required <strong>historical weather forecast data from multiple cities</strong>.</p>
<p>Despite intense research, I had a hard time finding the good data source. Most websites restrict the access to only past two weeks of historical data. If you need more, you need to pay. In my case, I needed five years of data — hourly historical forecast, which can be costly.</p>
<h3 id="heading-my-requirements-are"><strong>My requirements are...</strong></h3>
<p><strong>1. Free — at least during trial period</strong></p>
<p>No need to provide credit card info.</p>
<p><strong>2. Flexible</strong></p>
<p>Flexible to change forecast interval, time periods, locations.</p>
<p><strong>3. Reproducible</strong></p>
<p>Easy to reproduce and implement in the production phase.</p>
<p>In the end, I decided to use data from <a target="_blank" href="https://www.worldweatheronline.com/developer/api/historical-weather-api.aspx">World Weather Online</a>. This took me less than two minutes to subscribe free trial premium API — without filling credit card info. (500 free requests/key/day for 60 days, as of 30-May-2019).</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*kVPI57az2iE7Kjni3AhxOw.png" alt="Image" width="859" height="245" loading="lazy"></p>
<p><a target="_blank" href="https://www.worldweatheronline.com/developer/signup.aspx"><em>https://www.worldweatheronline.com/developer/signup.aspx</em></a></p>
<p>You can try out requests in JSON or XML format <a target="_blank" href="https://www.worldweatheronline.com/developer/premium-api-explorer.aspx">here</a>. The result is nested JSON which needed a bit pre-processing work before feeding into ML models. Therefore, I wrote some <a target="_blank" href="https://github.com/ekapope/WorldWeatherOnline">scripts</a> to parse them into pandas DataFrames and save as CSV for further use.</p>
<h3 id="heading-introducing-wwo-hist-package">Introducing wwo-hist package</h3>
<p>This <a target="_blank" href="https://pypi.org/project/wwo-hist/">wwo-hist package</a> is used to retrieve and parse historical weather data from <a target="_blank" href="https://www.worldweatheronline.com/developer/api/historical-weather-api.aspx">World Weather Online</a> into pandas DataFrame and CSV file.</p>
<p><strong>Input:</strong> api_key, location_list, start_date, end_date, frequency</p>
<p><strong>Output:</strong> location_name.csv</p>
<p><strong>Output column names:</strong> date_time, maxtempC, mintempC, totalSnow_cm, sunHour, uvIndex, uvIndex, moon_illumination, moonrise, moonset, sunrise, sunset, DewPointC, FeelsLikeC, HeatIndexC, WindChillC, WindGustKmph, cloudcover, humidity, precipMM, pressure, tempC, visibility, winddirDegree, windspeedKmph</p>
<h4 id="heading-install-and-import-the-package">Install and import the package:</h4>
<pre><code class="lang-py">pip install wwo-hist
</code></pre>
<pre><code class="lang-py"><span class="hljs-comment"># import the package and function</span>
<span class="hljs-keyword">from</span> wwo_hist <span class="hljs-keyword">import</span> retrieve_hist_data

<span class="hljs-comment"># set working directory to store output csv file(s)</span>
<span class="hljs-keyword">import</span> os
os.chdir(<span class="hljs-string">".\YOUR_PATH"</span>)
</code></pre>
<p><strong>Example code:</strong></p>
<p>Specify input parameters and call <strong><em>retrieve_hist_data()*</em></strong>.* Please visit <a target="_blank" href="https://github.com/ekapope/WorldWeatherOnline">my github repo</a> for more info about parameters setup.</p>
<p>This will retrieve <strong>3-hour interval</strong> historical weather forecast data for <strong>Singapore</strong> and <strong>California</strong> from <strong>11-Dec-2018</strong> to <strong>11-Mar-2019</strong>, save output into hist_weather_data variable and <strong>CSV</strong> files.frequency = 3</p>
<pre><code class="lang-py">FREQUENCY = <span class="hljs-number">3</span>
START_DATE = <span class="hljs-string">'11-DEC-2018'</span>
END_DATE = <span class="hljs-string">'11-MAR-2019'</span>
API_KEY = <span class="hljs-string">'YOUR_API_KEY'</span>
LOCATION_LIST = [<span class="hljs-string">'singapore'</span>,<span class="hljs-string">'california'</span>]

hist_weather_data = retrieve_hist_data(API_KEY,
                                LOCATION_LIST,
                                START_DATE,
                                END_DATE,
                                FREQUENCY,
                                location_label = <span class="hljs-literal">False</span>,
                                export_csv = <span class="hljs-literal">True</span>,
                                store_df = <span class="hljs-literal">True</span>)
</code></pre>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*Ga1fGBrxkoKgfzbu" alt="Image" width="795" height="747" loading="lazy"></p>
<p><em>This is what you will see in your console.</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*0-UJ7XO4ZG76oDlVvHQNVA.png" alt="Image" width="761" height="121" loading="lazy"></p>
<p><em>Result CSV(s) exported to your working directory.</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*gdtco3Zi0Kv03uz9" alt="Image" width="1200" height="245" loading="lazy"></p>
<p><em>Check the CSV output.</em></p>
<p>There you have it! The script detailed is also <a target="_blank" href="https://github.com/ekapope/WorldWeatherOnline">documented on GitHub</a>.</p>
<hr>
<p>Thank you for reading. Please give it a try, and let me know your feedback! If you like what I did, consider following me on <a target="_blank" href="https://github.com/ekapope">GitHub</a>, <a target="_blank" href="https://medium.com/@ekapope.v">Medium</a>, and <a target="_blank" href="https://twitter.com/EkapopeV">Twitter</a> to get more articles and tutorials on your feed.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What I learned building three services in three months while working full-time ]]>
                </title>
                <description>
                    <![CDATA[ By taira To give you a bit of a context, I’ll start off with a little bit about me. I’m a self-taught developer currently working in Japan. I’m not special in any way, I don’t have any Internet celebrity friends, but I do love coding and have a posit... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-i-learned-building-three-services-in-three-months-while-working-full-time-5cf1bbf207d0/</link>
                <guid isPermaLink="false">66c365538e244e1678738620</guid>
                
                    <category>
                        <![CDATA[ csv ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ serverless ]]>
                    </category>
                
                    <category>
                        <![CDATA[ side project ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Vue.js ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 06 Jun 2018 17:23:02 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*gxHw9bxhEY-ezPeMC26kOQ.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By taira</p>
<p>To give you a bit of a context, I’ll start off with a little bit about me. I’m a self-taught developer currently working in Japan. I’m not special in any way, I don’t have any Internet celebrity friends, but I do love coding and have a positive can-do attitude.</p>
<p>At the end of last year, I decided to launch an experimental project, to try to create one service per month in 2018 in my spare time. I wanted to see if I, an Indie-hacker-wanna-be, could work something out. And here’s my story so far.</p>
<p>I’ll break my discussion of each service into these sections:</p>
<ul>
<li>How the idea came about</li>
<li>What the service is</li>
<li>Tech stack</li>
<li>How much $ I spent</li>
<li>Lessons learned</li>
</ul>
<h3 id="heading-january-scratch-my-own-itch">January: scratch my own itch.</h3>
<h4 id="heading-how-the-idea-came-about"><strong>How the idea came about</strong></h4>
<p>The first thing that came to my mind was to build something that I’d use heavily. In the worst case scenario, if my service attracted no one, it would still help me.</p>
<p>I started to look into my day-to-day flow. I realized that I spent quite a lot of time every day going to a variety of websites. So wouldn’t it be nice to have a web service to keep eyes on those sites for me, and send me updates via email? This would help me focus on the important things.</p>
<h4 id="heading-what-the-service-is"><strong>What the service is</strong></h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*tNX15eL8kX2r5Pz_8L1C7w.png" alt="Image" width="800" height="495" loading="lazy">
<em>KMPPP</em></p>
<p><a target="_blank" href="https://kmppp.com">Keep Me PPPosted</a> is what I ended up building. To make the service even more user-friendly, I built a <a target="_blank" href="https://chrome.google.com/webstore/detail/keep-me-ppposted/fnfioeoaippeenifnfhpblddioiaaeji?utm_source=medium">Chrome extension</a> as well, which allowed the user to subscribe to updates for any website right on the spot. You can check out the detailed user stories and design decisions on the <a target="_blank" href="https://kmppp.com/about?perspective=dev">About</a> page, and I’m in the progress of opening sourcing this project, here’s the Github <a target="_blank" href="https://github.com/slashbit/spider-less">repo</a> :)</p>
<h4 id="heading-tech-stack"><strong>Tech stack</strong></h4>
<p>I went with what I’m most comfortable with: front-end Vue.js and back-end AWS Lambda Serverless combo. I have been working with these in my current company on a daily basis for the last year and a half. Serverless fits my design very well, considering most parts of my service follow the event-sourcing pattern.</p>
<h4 id="heading-how-much-i-spent"><strong>How much I spent</strong></h4>
<p>$22 in total: $7 for the domain, $10 for the Sendgrid subscription (100,000 emails per month, I could use it for my other services as well), and a $5 one-time fee for publishing the extension on the Chrome web store. Everything else was covered by the AWS free tier plan.</p>
<h4 id="heading-lessons-learned"><strong>Lessons learned</strong></h4>
<p>It was definitely a valuable learning experience, since it was my very first full-scale web service. I posted it on Indie hackers and got a couple of users. But more importantly, I got the chance to talk directly with my users, working as a developer in the company.</p>
<p>In my job, I never get to talk with my end users to get instant feedback and have full control over the product that I build. That alone was worth the time and effort I put into it.</p>
<h3 id="heading-february-leverage-my-resources">February: leverage my resources.</h3>
<h4 id="heading-how-the-idea-came-about-1"><strong>How the idea came about</strong></h4>
<p>January was pretty tense, so I decided to take it easy. I thought about what else I could offer, besides my half box of chicken wings in my fridge. Something that others might need.</p>
<p>I’m in Japan, and working here might be something developers would be interested in. On top of that, I often get recruiters sending me job opportunities. Connecting developers and recruiters might be something I could work on.</p>
<h4 id="heading-what-the-service-is-1"><strong>What the service is</strong></h4>
<p>Instead of jumping right into coding, I created a mailing list using MailChimp. I started to share my experience in developer communities whenever I got the chance. It worked, and my mailing list grew to 500+ subscribers within a month.</p>
<p>In the meantime, whenever a recruiter reached out to me, I would casually mention my mailing list, and ask if I could share that with my subscribers.</p>
<h4 id="heading-how-much-i-spent-1"><strong>How much I spent</strong></h4>
<p>$0. The outgoing mails are covered by the same Sendgrid account, and the backend cron job which was built with AWS Lambda was again covered by my AWS free tier plan.</p>
<h4 id="heading-lesson-learned"><strong>Lesson learned</strong></h4>
<p>It seems that the less time I spent on coding, and the more time on promoting my service, the more potential users I’d get. Two weeks after I started, I got an email from one of my subscribers thanking me for what I did.</p>
<p>He hadn’t gotten a job using the service yet, he just wanted to thank me for sharing that information. That email just warmed my heart, knowing that what I’m doing actually helps others. That’s just the best feeling ever!</p>
<h3 id="heading-march-get-ideas-from-others">March: get ideas from others.</h3>
<h4 id="heading-how-the-idea-came-about-2"><strong>How the idea came about</strong></h4>
<p>At this point, I’d kinda run out of ideas. That’s when I started to talk with my non-developer friends. I tried to understand what their day to day life is like, and if there were pain points they have that I could help with.</p>
<p>As part of his job, one of my friends receives CSV files from clients, and then imports those files into an internal system. Often times, the files he receives does not match the requirements, are missing columns, or contain incompatible data types — and so on.</p>
<p>He often has to go back and ask his client to redo and re-send the files. He has tried using Excel to automate the process, but failed because most of the files were really big (300+ MB with 1M+ rows). That sure sounded like something that I could help with.</p>
<h4 id="heading-what-the-service-is-2"><strong>What the service is</strong></h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*vlk_6w7yVafO3dkFjFTDyA.png" alt="Image" width="800" height="431" loading="lazy"></p>
<p>I created <a target="_blank" href="https://csvlint.com">CSV Lint</a>, a CSV file validation service for businesses, that allows a user to create a schema easily for validating CSV files once the schema is created. It can be shared with others (who could use it without having an account). This means that once my friend created the schema, he could ask his clients to use it to validate their files before sending them to him.</p>
<h4 id="heading-tech-stack-1"><strong>Tech stack</strong></h4>
<p>Instead of AWS, I went with Google Cloud Platform, Firebase for hosting and database, and Google Cloud Functions to handle the backend logic. Once again, their free tier covered everything.</p>
<h4 id="heading-how-much-i-spent-2"><strong>How much I spent</strong></h4>
<p>$17 in total. I spent $7 for the domain — and it is a pretty awesome domain, I have to say, patting myself on the back. And another $10 on Udemy for a how to make demo video using a Keynote course. It was money well spent, another new skill learned. ?</p>
<h4 id="heading-lessons-learned-1"><strong>Lessons learned</strong></h4>
<p>Ideas that I come up with lead to nothing 9 out of 10 times. Talking with others, especially people outside my normal circle, often helps me get new ideas. However, the sad part is I don’t really have a lot of friends that I can talk to — looks like I’ll need to work on that as well. ?</p>
<h3 id="heading-wrapping-up">Wrapping up</h3>
<p>So, that’s my journey so far. None of my projects have succeeded big time, and I’m currently making $0 out of them. But each one of those services is helping people one way or another, and that puts a big smile on my face every day as I go to sleep. Also, they cost me close to nothing, there’s still some chicken wings left in my fridge. All good, all good.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
