Copying column from CSV to CSV with python
<p>I'm new with python and I would like to know if it's possible to copy the first column from a .csv file to another .csv file. The reason is that I have a lot of .csv and instead of opening each one manually and copying to only one .csv I would like to automate this step.</p>

<p>Thank you very much!</p>

<p><strong>Code Snipet:</strong>
<strong>You need to configure source and destination</strong>   </p>

<pre><code>import os
from os import listdir
from os.path import isfile, join
import csv

mypath="sourcePath"
newcsv="destination"
# for just files in a directory and not the subDirectory
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]

print(onlyfiles)
for file in onlyfiles:
    if file.endswith(".csv"):
        with open(os.path.join(mypath,file ), newline='') as f:
            reader = csv.reader(f)
            for row1 in reader:

                out = csv.writer(open(newcsv,"w"), delimiter=',',quoting=csv.QUOTE_ALL)
            out.writerow(row1);
</code></pre>

python