Add Tools

This commit is contained in:
daleclack 2021-06-27 19:07:16 +08:00
parent 3ce84a0a09
commit 0eccd43793
3 changed files with 37 additions and 0 deletions

15
tools/csv_to_xls.py Normal file
View File

@ -0,0 +1,15 @@
import csv
import openpyxl
wb = openpyxl.Workbook()
ws = wb.active
csvfile=input("Input CSV File Path:")
xlsxfile=input("Input Xlsx File Path:")
with open(csvfile) as f:
reader = csv.reader(f, delimiter=',')
for row in reader:
ws.append(row)
wb.save(xlsxfile)

22
tools/type_format.cpp Normal file
View File

@ -0,0 +1,22 @@
#include <iostream>
#include <cstring>
#include <cstdio>
int main(){
char filename[512],filename1[512],extbuf[512];
std::cin.getline(filename,512);
std::cin.getline(filename1,512);
FILE *fp,*outfp;
fp=fopen(filename,"rt+");
outfp=fopen(filename1,"wt+");
if(fp!=NULL){
fprintf(outfp,"static const char * const supported_globs[]={\n");
while(fscanf(fp,"%s",extbuf)!=EOF){
fprintf(outfp,"\t\"*.%s\",\n",extbuf);
}
fprintf(outfp,"NULL\n};\n");
}else{
std::cout<<"Error!"<<std::endl;
}
return 0;
}