python ¿Ä¸ê¿Ä¨é·JÁ` (¥þ³¡)"¸ê®Æ
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 17# lpk187
´ú¸Õµ²ªG¦p¤U¡G
±q¦hÓ¨¤«×¨Ó´ú¸Õ¡A¹ê¦b¤Ó´Î¤F¡C
ÁÂÁÂÅo¡I |
|
|
|
|
|
|
- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
|
¥»©«³Ì«á¥Ñ lpk187 ©ó 2016-9-25 17:22 ½s¿è
¦^´_ 13# c_c_lai
¬ã¨s¤F¤@¤U pandas ¨ú¥X ¦A¾É¤J¨ìCSV ©ÎExcel- import pypyodbc
- import pandas as pd
- MDB = 'D:\\Python\\¿Ä¸ê¿Ä¨é·JÁ`\\twsedata.mdb'
- DRV = '{Microsoft Access Driver (*.mdb, *.accdb)}'
- con = pypyodbc.connect('DRIVER={};DBQ={}'.format(DRV, MDB))
- data = pd.read_sql('select * from 1220', con) # ¨ú¥X
- data.to_excel('1220.xlsx', sheet_name='1220') #¾É¤J¨ìExcel
- data.to_csv('1220.csv') #¾É¤J¨ì CSV
- data
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 55
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 81
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- 10
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2016-5-15
- ³Ì«áµn¿ý
- 2018-11-1
|
|
|
|
|
|
|
- ©«¤l
- 55
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 81
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- 10
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2016-5-15
- ³Ì«áµn¿ý
- 2018-11-1
|
¥»©«³Ì«á¥Ñ koshi0413 ©ó 2016-9-25 14:30 ½s¿è
¦^´_ 13# c_c_lai
µ¹±z°Ñ¦Ò SQLite3 ¾É¤J Excel
acc§@ªkÀ³¸Ó¤]®t¤£¦h
ª`·N!!! ³o¬O¤@¦¸¥þ¾É¤J¡A©Ò¥H¸ê®Æ¶q¤Ó¤j¡A·|«ÜºC
À³¸Ó¥i¥H¾É¤J§½³¡¡A¥u¬O¤p§Ì©|¥¼¥Î¨ì¡AÁÙ¨S²`¤J- Sub SQLite3_to_Excel()
- ¦L¹³¤¤¥i¥H¦b "SELECT * FROM " & TableName & " " ¥[¤J¥u´£¨ú¤Q¦æ
- Dim cn, rs, f, SQLName, TableName, ix%, SheetsName
- SQLName = "C:\Users\Koshi\Documents\Python Scripts\SQLite3\2330.sqlite"
- TableName = "sqlªí®æ¦WºÙ"
- SheetsName = "Excel¤u§@ªí¦WºÙ"
- ix = 10 '¶}©l©ó²Ä¤Q¦æ
-
- Sheets(SheetsName).Select
- Set cn = CreateObject("adodb.connection")
- cn.Open ("Driver={SQLite3 ODBC Driver};database=" & SQLName) '¶}±Òsqlite«ü©w¸ê®Æ®w¡A¸ô®|»PÀɮצWºÙn¹ï
- Set rs = cn.Execute("SELECT * FROM " & TableName & " ") '¼g¥XSQL¬d¸ß»yªk
- Sheets(SheetsName).Cells.Delete '²M°£¤u§@ªí¸ê®Æ
- For f = 0 To rs.Fields.Count - 1
- Sheets(SheetsName).Cells(ix, f + 1).Value = rs.Fields(f).Name '¾É¤JÄæ¦ì¦WºÙ
- Next
- Sheets(SheetsName).Cells(ix + 1, 1).CopyFromRecordset (rs) '¾É¤JÄæ¦ì¸ê®Æ
- cn.Close
- Set rs = Nothing
- Set cn = Nothing
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
|
¦^´_ 13# c_c_lai
¦bpython ¤¤¡A§Ú¤]ÁÙ¬O¦b¾Ç²ß¡A©Ò¥Hª¾¹Dªº¬Æ¤Ö
n±q¸ê®Æ®w¤¤®³¥X¨Ó¡A¥HPywin32 ADODBªº¥Îªk©MVBA«ÜÃþ¦ü
§A¥i¥H°Ñ¦Òhttp://wiki.alarmchang.com/index.php?title=Python ¸Ì±¦³«Ü¦h¨Ò¤l°Ñ¦Ò
¬Æ¦Ü±±¨îExcel³£¥i¥H¡A´Nn¬Ý±q¸ê®Æ®w¤¤´£¨ú¥X¨Ó«án°µ¤°»ò(¦]¬°§Ú¨Sª±ªÑ²¼¡A¤]¤£ª¾¹D³o¨Ç¼Æ¾Ú¸Ó¥Î¤°»ò¡H³o°ÝÃD¥i¯àn½Ð±Ð¦U¦ì¤j¤j¤F) |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-9-25 10:21 ½s¿è
¦^´_ 11# lpk187
«·s´ú¸Õµ²ªG¡G
ÁÂÁ§A¡I
¦pªGn±q¸ê®Æ®wŪ¨ú¥X¸ê®Æ¤S¸Ó¦p¦ó¼¶¼g¡A
Ä´¦p¦P¨B'¼g¤J pandas ¸Ì¡H ©Î¬O¨ä¥L¤è¦¡¡H |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 11# lpk187
§Ú¦A¸Õ¸Õ¬Ý !
(¸ÕµÛ¥ý±N¸ê®Æ®w²¾°£¡B¦b°õ¦æ)> |
|
|
|
|
|
|
- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
|
¦^´_ 10# c_c_lai
|
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
|
|
|
|
|
|
- ©«¤l
- 109
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 116
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2016-8-4
- ³Ì«áµn¿ý
- 2018-10-22
|
¦^´_ 1# lpk187
«z¡A³Ìªñ¤]·Q¬ã¨s¤@¤U¸ê®Æ®w¡Aè¦nL¤j´Nµo¤F³o½g¡A3Q~ |
|
|
|
|
|
|