Python Forum
How can i parse a log file to JSON.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can i parse a log file to JSON.
#1
Hi, I'm noob in python.

How can i parse a log file to JSON.

From this:


Quote: -----------------------------------
Uncollected accounts
-----------------------------------
.
Date debut
16/04/20 22:41:22

PL/SQL procedure successfully completed.

Date end
16/04/20 22:41:39
.
-----------------------------------
Control figures
-----------------------------------
.
Date debut
16/04/20 22:41:23
Date fin
16/04/20 22:41:48
.
----------------------------
End of Daily Treatments
----------------------------
.
Date end
16/04/20 22:41:49


To this:


Quote: ['process', 'date debut', 'date end', 'hour start', 'hour end']

['Uncollected accounts', '16/04/20', '16/04/20', '22:41:22', '22:41:39']

and so on.

Many thanks.
Reply


Messages In This Thread
How can i parse a log file to JSON. - by menarcarlos - May-25-2020, 08:55 PM
RE: How can i parse a log file to JSON. - by buran - May-26-2020, 10:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  encrypt data in json file help jacksfrustration 1 449 Mar-28-2024, 05:16 PM
Last Post: deanhystad
  parse json field from csv file lebossejames 4 897 Nov-14-2023, 11:34 PM
Last Post: snippsat
  parse/read from file seperated by dots giovanne 5 1,248 Jun-26-2023, 12:26 PM
Last Post: DeaD_EyE
  Python Script to convert Json to CSV file chvsnarayana 8 2,777 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,412 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  [split] Parse Nested JSON String in Python mmm07 4 1,686 Mar-28-2023, 06:07 PM
Last Post: snippsat
  Converting a json file to a dataframe with rows and columns eyavuz21 13 5,255 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
  validate large json file with millions of records in batches herobpv 3 1,393 Dec-10-2022, 10:36 PM
Last Post: bowlofred
  Writing to json file ebolisa 1 1,097 Jul-17-2022, 04:51 PM
Last Post: deanhystad
  Trying to parse only 3 key values from json file cubangt 8 3,753 Jul-16-2022, 02:05 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020