Json Log File Creation

Hi Does any one share Json log file creation sample or any guidlines or steps to create.

I don’t understand the question you have @sunilraju, I hope this is the second topic you created related to the same question. You want to convert the text to JSON file right?

Yes…normally i have created .txt file and append all log messages into .txt file. At last i want to show the same thing in a Json format.

That was quite difficult task @sunilraju, because the json may not be in correct format if we try to append the braces or the arrays. I don’t understand the requirement you have. But it is hard and not sure that works

below is my log data. I have created one .txt file add below log messages into .txt file.
Now i want to convert this pure text(.txt file) into Json format.
below is my sample log data,
09/22/2019 18:12:04Read Time Sheet Details
09/22/2019 Logged In Successfully
09/22/2019 Clicked On Time & Expenses Successfully
09/22/2019 Clicked On My TimeSheets Successfully
09/22/2019 18:12:24 Data Extracted From Table Successfully
Description: Edit
View
BeginDate: 09/15/2019
EndDate: 09/21/2019
State: Submitted
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 09/08/2019
EndDate: 09/14/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 09/01/2019
EndDate: 09/07/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 08/25/2019
EndDate: 08/31/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 08/18/2019
EndDate: 08/24/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 08/11/2019
EndDate: 08/17/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 08/04/2019
EndDate: 08/10/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 07/28/2019
EndDate: 08/03/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 07/21/2019
EndDate: 07/27/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 07/14/2019
EndDate: 07/20/2019
State: Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 07/07/2019
EndDate: 07/13/2019
State: Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 06/30/2019
EndDate: 07/06/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 06/23/2019
EndDate: 06/29/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
Description: Edit
View
BeginDate: 06/16/2019
EndDate: 06/22/2019
State: Partially Approved
Print: Print
Duplicate: Duplicate
I hope u understand now.

Hi @sunilraju

What exactly do you want with json file ?

cheers :smiley:

Happy learning :smiley:

3 Likes

I want to show the above .txt data in below format,
[{“First Name”:“John”,"Last Name ":“Smith”,“Company Name”:“IT Solutions”,“Role in Company”:“Analyst”,“Address”:“98 North Road”,“Email”:“jsmith@itsolutions.co.uk”,“Phone Number”:“40716543298”},{“First Name”:“Jane”,"Last Name ":“Dorsey”,“Company Name”:“MediCare”,“Role in Company”:“Medical Engineer”,“Address”:“11 Crown Street",“Email”:"jdorsey@mc.com”,“Phone Number”:“40791345621”},{“First Name”:“Albert”,"Last Name ":“Kipling”,“Company Name”:“Waterfront”,“Role in Company”:“Accountant”,“Address”:“22 Guild Street",“Email”:"kipling@waterfront.com”,“Phone Number”:“40735416854”},{“First Name”:“Michael”,"Last Name ":“Robertson”,“Company Name”:“MediCare”,“Role in Company”:“IT Specialist”,“Address”:“17 Farburn Terrace",“Email”:"mrobertson@mc.com”,“Phone Number”:“40733652145”},{“First Name”:“Doug”,"Last Name ":“Derrick”,“Company Name”:“Timepath Inc.”,“Role in Company”:“Analyst”,“Address”:“99 Shire Oak Road”,“Email”:“dderrick@timepath.co.uk”,“Phone Number”:“40799885412”},{“First Name”:“Jessie”,"Last Name ":“Marlowe”,“Company Name”:“Aperture Inc.”,“Role in Company”:“Scientist”,“Address”:“27 Cheshire Street",“Email”:"jmarlowe@aperture.us”,“Phone Number”:“40733154268”},{“First Name”:“Stan”,"Last Name ":“Hamm”,“Company Name”:“Sugarwell”,“Role in Company”:“Advisor”,“Address”:“10 Dam Road",“Email”:"shamm@sugarwell.org”,“Phone Number”:“40712462257”},{“First Name”:“Michelle”,"Last Name ":“Norton”,“Company Name”:“Aperture Inc.”,“Role in Company”:“Scientist”,“Address”:“13 White Rabbit Street",“Email”:"mnorton@aperture.us”,“Phone Number”:“40731254562”},{“First Name”:“Stacy”,"Last Name ":“Shelby”,“Company Name”:“TechDev”,“Role in Company”:“HR Manager”,“Address”:“19 Pineapple Boulevard",“Email”:"sshelby@techdev.com”,“Phone Number”:“40741785214”},{“First Name”:“Lara”,"Last Name ":“Palmer”,“Company Name”:“Timepath Inc.”,“Role in Company”:“Programmer”,“Address”:“87 Orange Street”,“Email”:“lpalmer@timepath.co.uk”,“Phone Number”:“40731653845”}]

1 Like

so you want to convert txt format to json object am i correct ?
@sunilraju

cheers :smiley:

Happy learning :smiley:

3 Likes

Yes.

1 Like

Hi @sunilraju

you can download my components here Patty Ricarte - Read JSON File

Hope this might be helpful to you

cheers :smiley:

Happy learning :smiley:

4 Likes

Thanks for sharing your component @pattyricarte. :slight_smile: