import pymongo import re client = pymongo.MongoClient('127.0.0.1', 27017) db_name = 'Trade' db = client[db_name] filter1 = {'$or':[{"phone": {'$ne':""}}, {"cell_phone": {'$ne':""}}]} filter2 = {'address':1, 'contact…
public string ExportExcel( DataSet ds,string saveFileName) { try { if (ds == null) return "数据库为空"; bool fileSaved = false; Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); if (xlApp == null) {…
OLEObject ole_object , ole_workbooks ole_object = CREATE OLEObjectIF ole_object.ConnectToNewObject("Excel.Application") <> 0 THEN MessageBox('OLE错误','OLE无法连接!') returnEND IFole_object.workbooks.addole_object.Visible = Trueole_workbooks = o…
using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebAPIServer.Models { [Serializable] public class Product { publi…
pipelines.py文件中 import codecs import csv # 保存到CSV文件中 class CsvPipeline(object): def __init__(self): self.file = codecs.open('a.csv', 'w', encoding='utf_8_sig') def process_item(self, item, spider): fieldnames = ['title', 'img_url', 'download_http'] w…
1.先导入相应的jar包 2.一个小的Demo测试[实体类+测试类:保存excel的方法] Student实体类 public class Student{ private int id; private String name; private String email; private Date birth; //相应的set.get方法 还有构造器(有参.无参的) ··············· } Test测试类 public class Test{ public static List…
// 导出excel文件 /** * 依赖: import XLSX from 'xlsx' */ let obj = { '学生信息表': [ ['姓名', '性别', '年龄', '分数'], ['张三', '男', 18, parseInt(Math.random() * 100)], ['李四', '女', 22, parseInt(Math.random() * 100)] ], '教师信息表': [ ['姓名', '性别', '年龄', '教龄'], ['王五', '男', 18,…
Windows下 使用如下的DOS命令来实现: dir /s /b > lists.txt 可以将当前路径下的所有文件的"文件路径+文件名"存储在lists.txt中. 其中,/s表示的是"列出完整路径"选项,如果命令行是如下形式: dir /b > lists.txt 那么,lists.txt文件中只会记录当前目录中所有文件的文件名信息. Ubuntu下 find <target_path> -name "<file_nam…
include(dirname(__FILE__) .'/phpexcel-1.7.7/Classes/PHPExcel.php'); include(dirname(__FILE__) .'/phpexcel-1.7.7/Classes/PHPExcel/IOFactory.php'); $header_arr = array('A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U'…
import os os.chdir("C:/") path = os.getcwd() print(path) f = open("sql.csv") # print(f.read()) f.seek(0) lst = [] n = 0 for line in f.readlines(): if n > 0: fullname = line.rsplit('/', 1) #从右侧开始以第一个"/"为分隔符将字符串分割为两端,保存为2元素列…