# coding = utf-8 import os import xlwt import re def readTxt_toExcel(valueList, Pathlist): workbook = xlwt.Workbook() # sheet = workbook.add_sheet('finish_郑磊', cell_overwrite_ok=True) # Excel单元格名字 style = xlwt.XFStyle() font = xlwt.Font() font.name =…
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using Microsoft.Office.Interop.Excel; using Syste…
Dim fso,f,a set oExcel = CreateObject( "Excel.Application" ) oExcel.Visible = false '4) 打开已存在的工作簿: oExcel.WorkBooks.Open( "F:\1.xlsx" ) On Error Resume Next '判断是否存在Sheet2工作表,不存在新建 If oExcel.WorkSheets("Sheet2") Is Nothing The…
读取txt文件,然后存入excel中 import xlwt #从txt文件中读取内容,放到ftext1中 f1=open('/Users/XXX/Documents/pythonwork/tensorflow/list1.txt') ftext1=f1.read() length1=len(ftext1) print(length1) new_workbook=xlwt.Workbook() #创建工作簿 new_sheet=new_workbook.add_sheet("ext_ch&quo…
Logstash读取文本信息并写入到ES 前提是ELK安装没问题 进入到logstash安装目录下的bin目录(我的logstash安装目录:/usr/local/) [root@es1 bin]# cd /usr/local/logstash-5.5.2/bin [root@es1 bin]# ll total 100 -rwxr-xr-x 1 root root   377 Aug 14  2017 cpdump -rw-r--r-- 1 root root 15821 Dec 27 00:…
使用场景: 在工作中,常见某个功能的查询,当查询关联表特别多时,开发写的SQL语句等等问题导致响应时间较慢,那么作为测试需要将每个接口的响应时间进行测试,对同个接口多次执行,并将测试结果写入到excel,方便后期的接口时间分析. 实现路径分析: (1)在测试接口时,直接返回url和times (2)将每个接口获取到的url和times写入到txt文件中 (3)将txt内容复制到Excel中(目的:方便筛选和计算总和.平均响应时间等) 框架截图: 代码示例: (1)write_reponseTim…
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #filename get_linux_info.py #获取Linux主机的信息 # titles=['Hostname','OS','Arch','Distribution','IPs','cpu','core','Mem','Data','Disk'] import paramiko import sys ssh = paramiko.SSHClient() ssh.set_missing_hos…
package poi; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date;…
IO流想必大家都很熟悉了,本次实现的需求是按行读取文件内容并且按行写入,代码如下: try { String encoding="utf-8"; //设定自己需要的字符编码集 File file = new File("c:/text.txt"); if(file.exists() && file.isFile()){ InputStreamReader read = new InputStreamReader( new FileInputStrea…
package com.nickwong.code; import java.io.*; /** * Created by Nickwong on 31/07/2018. * 根据1-8楼的建议,优化了代码 */ public class ReadTxt { public static void main(String args[]) { readFile(); writeFile(); } /** * 读入TXT文件 */ public static void readFile() { Str…