From 372f80cfce79254cde6fe6219205dfe078176d70 Mon Sep 17 00:00:00 2001 From: Aridhi-Dhia-eddine Date: Fri, 12 Apr 2024 01:57:23 +0100 Subject: [PATCH] Rework:solve problem of saving result of --sql-query in CSV file --- lib/core/dump.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/dump.py b/lib/core/dump.py index d2f89e165..eaea9e269 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -712,19 +712,18 @@ class Dump(object): def sqlQuery(self, query, queryRes): self.string(query, queryRes, content_type=CONTENT_TYPE.SQL_QUERY) - print ("mon output est ",queryRes) #code to extract columns from the request deb="SELECT" fin="FROM" temp1=(query.upper()).find(deb) - #print ("mon output est ",temp1) + temp2=(query.upper()).find(fin) - #print ("mon output est ",temp2) + T=len(deb)-temp1+1 temp_res=query[T:temp2] temp_res=(temp_res.strip()).split(',') - print ("mon output est ",temp_res) + #****************************************** #dictionarie for every value in queryRes dt_save=[] @@ -747,6 +746,7 @@ class Dump(object): else: print("data don't exist to create CSV file") + def rFile(self, fileData): self.lister("files saved to", fileData, sort=False, content_type=CONTENT_TYPE.FILE_READ)