everyone. I am quite new with linux and I am learning a lot with all of you reading this site. I am into a bit of trouble with my accounting program and that's why I am recurring to you. I want to move my data from plain text to json, what I believe will give me better results and more flexibility.
I have a folder containing info in separated files. The files are like this:
20170404
pago
80051442-4
002-001-0080057
310000
310000
si
2017-06-05
I want to copy this info in new files where each line is a new json field. Something like this:
{
"field1":"20170404",
"field2":"pago",
"field3":"80051442-4",
"field4":"002-001-0080057",
"field5":"310000"
"field6":"",
"field7":"";
"field8":"310000"
"field9":"si"
"field10":"2017-06-05"
}
I am looking for a script to read the whole directory and build these new files: oldfile.json.
And after that I want to tab results of several of these files in different columns:
file1 field1 field2 field3 field4 field5 field6 field7
file2 field1 field2 field3 field4 field5 field6 field7
file3 field1 field2 field3 field4 field5 field6 field7
file4 field1 field2 field3 field4 field5 field6 field7
file5 field1 field2 field3 field4 field5 field6 field7
Thank you all for your time.