it-swarm.cn

# 更改从Toggl下载的CSV报告的格式

1

3

``````#!/usr/bin/env python
import csv
import sys
import operator

rows=[]
for row in r:
row = "'%s" % row
row = "'%s" % row
row = "'%s" % row
rows.append(row)

rows = [rows] + sorted(
rows[1:],
key=operator.itemgetter(5)
)

w = csv.writer(sys.stdout)
for row in rows:
w.writerow(row)
``````

0
{"ft_lang_label":"__label__zh","ft_lang_prob":0.7027229,"math_prob":0.90988344,"size":513,"snap":"2021-43-2021-49","text_gpt3_token_len":268,"char_repetition_ratio":0.11787819,"word_repetition_ratio":0.0,"special_character_ratio":0.29044834,"punctuation_ratio":0.14285715,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95791054,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-16T21:45:59Z\",\"WARC-Record-ID\":\"<urn:uuid:e600bbc3-dd91-4dbb-8607-69746cee5ad2>\",\"Content-Length\":\"78131\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0858f9aa-5c5e-462b-8138-635baa47f4ba>\",\"WARC-Concurrent-To\":\"<urn:uuid:fcd09bc3-d374-4fe5-b085-3a1d6ca6e7fe>\",\"WARC-IP-Address\":\"104.21.48.134\",\"WARC-Target-URI\":\"https://www.it-swarm.cn/zh/formatting/%E6%9B%B4%E6%94%B9%E4%BB%8Etoggl%E4%B8%8B%E8%BD%BD%E7%9A%84csv%E6%8A%A5%E5%91%8A%E7%9A%84%E6%A0%BC%E5%BC%8F/957286199/\",\"WARC-Payload-Digest\":\"sha1:YTAPU4JSXMPCJJA4SZCXZFMYIJA2GPCP\",\"WARC-Block-Digest\":\"sha1:7OJ6MGG6B4DBIIGZWIDBQGNRBYF26TAH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585025.23_warc_CC-MAIN-20211016200444-20211016230444-00364.warc.gz\"}"}