csv

Export only visible rows to CSV with Powershell

拥有回忆 提交于 2021-01-29 04:16:16
问题 I have logic in an Excel macro that parses the documents and hides rows that don't have data in certain cells per row. Looking to export only the visible cells to CSV. I have code (below) to export everything, but how do I make it only do visible rows? $oWorksheet = $objExcel.Worksheets.item(6) $oWorksheet.Activate() "saving $filecsv" $oWorksheet.SaveAs($filecsv,[Microsoft.Office.Interop.Excel.XlFileFormat]::xlCSVWindows) $workbook.Saved = $true 回答1: Please see this answer I believe you could

why do I keep getting child out of range error?

僤鯓⒐⒋嵵緔 提交于 2021-01-29 03:27:06
问题 I am using this python script to convert xml's to csv: import os import glob import pandas as pd import xml.etree.ElementTree as ET def xml_to_csv(path): xml_list = [] for xml_file in glob.glob(path + '/*.xml'): tree = ET.parse(xml_file) root = tree.getroot() for member in root.findall('object'): value = (root.find('filename').text, int(root.find('size')[0].text), int(root.find('size')[1].text), member[0].text, int(member[4][0].text), int(member[4][1].text), int(member[4][2].text), int(member

why do I keep getting child out of range error?

送分小仙女□ 提交于 2021-01-29 03:21:03
问题 I am using this python script to convert xml's to csv: import os import glob import pandas as pd import xml.etree.ElementTree as ET def xml_to_csv(path): xml_list = [] for xml_file in glob.glob(path + '/*.xml'): tree = ET.parse(xml_file) root = tree.getroot() for member in root.findall('object'): value = (root.find('filename').text, int(root.find('size')[0].text), int(root.find('size')[1].text), member[0].text, int(member[4][0].text), int(member[4][1].text), int(member[4][2].text), int(member

FileHelpers - Creating a field object

最后都变了- 提交于 2021-01-29 03:10:56
问题 I am trying to dynamically add field properties to a record class that I am also building dynamically using FileHelpers.Dynamic.DelimitedClassBuilder. I have no issues creating the class object and I currently add a field using the AddField(String) method. As my apps grows I now have a need to declare specific field properties in various situations. So in the same sense I wanted to use FileHelpers.Dynamic.DelimitedFieldBuilder to create a field object and then pass that to my

Python/wxPython: Importing CSV file onto wxGrid not displaying to fit on frame

天大地大妈咪最大 提交于 2021-01-29 03:10:36
问题 Am working on a project where I have to import CSV files into wx.Grid for further manipulations. I have searched and found a useful way here http://wxpython-users.1045709.n5.nabble.com/new-to-the-list-opening-a-text-file-in-a-grid-using-splitterwindows-td2373808.html Now my CSV never seems to display on my screen frame at all (as per the code below)? Any way around this? csv1.py is the GUI class MyFrame3 ( wx.Frame ): def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID

Vba Import CSV files to Excel

好久不见. 提交于 2021-01-29 03:03:41
问题 I'm trying to import Csv file to excel using VBA code, I want it to work with all Csv files but it didn't. Here is my code: Sub Input_CSV() Dim Wb As String Dim Arr Set Wb = GetObject(Application.GetOpenFilename("csv file,*.csv", , "please choose a csv file", , False)) Dim blnImportData As Boolean blnImportData = ImportCSV(Wb, "Sheet1", "A1") If blnImportData Then MsgBox "Import CSV process complete", vbInformation, ThisWorkbook.Name _ Else MsgBox "Import CSV process failed", vbCritical,

XML to CSV using XSLT with missing elements

左心房为你撑大大i 提交于 2021-01-29 01:39:06
问题 I need to convert XML into CSV using an XSLT (compatible with .NET framework). For the moment I came up with the following solution: XML: <items> <item> <col1>AAA1</col1> <col2>BBB1</col2> <col3>CCC1</col3> <col4>DDD1</col4> <col5>EEE1</col5> </item> <item> <col1>AAA2</col1> <col2>BBB2</col2> <col5>EEE2</col5> </item> <item> <col1>AAA3</col1> <col2>BBB3</col2> <col3>CCC3</col3> <col4>DDD3</col4> <col5>EEE3</col5> </item> </items> XSLT: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns

XML to CSV using XSLT with missing elements

时光毁灭记忆、已成空白 提交于 2021-01-29 01:35:52
问题 I need to convert XML into CSV using an XSLT (compatible with .NET framework). For the moment I came up with the following solution: XML: <items> <item> <col1>AAA1</col1> <col2>BBB1</col2> <col3>CCC1</col3> <col4>DDD1</col4> <col5>EEE1</col5> </item> <item> <col1>AAA2</col1> <col2>BBB2</col2> <col5>EEE2</col5> </item> <item> <col1>AAA3</col1> <col2>BBB3</col2> <col3>CCC3</col3> <col4>DDD3</col4> <col5>EEE3</col5> </item> </items> XSLT: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns

XML to CSV using XSLT with missing elements

随声附和 提交于 2021-01-29 01:35:27
问题 I need to convert XML into CSV using an XSLT (compatible with .NET framework). For the moment I came up with the following solution: XML: <items> <item> <col1>AAA1</col1> <col2>BBB1</col2> <col3>CCC1</col3> <col4>DDD1</col4> <col5>EEE1</col5> </item> <item> <col1>AAA2</col1> <col2>BBB2</col2> <col5>EEE2</col5> </item> <item> <col1>AAA3</col1> <col2>BBB3</col2> <col3>CCC3</col3> <col4>DDD3</col4> <col5>EEE3</col5> </item> </items> XSLT: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns

Using MysqlDb in python converts null to None

♀尐吖头ヾ 提交于 2021-01-28 22:13:50
问题 Below is my code import MysqlDB as mob Mysqlconn = mdb.connect(hostname, username, password, databasename,port=3306,cursorclass=mdb.cursors.DictCursor) Mysqlcur = self.Mysqlcon.cursor() Mysqlcur.execute("Select * from users where date = %(date_check)s,{"date_check":current_date}) row = self.Mysqlcur.fetchall() fileOpen = open("filename.csv","w") for each in row: fileOpen.write(str(each["A"])+","+str(each["B"])) It works fine for the rows which does not have null values. When it encounters a