Add column from another file into specific area between quotes
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But as pan64 said, if this is indeed JSON then better handle it with a JSON parser. If this were part of a shell script, jq would be my tool of choice.
But as pan64 said, if this is indeed JSON then better handle it with a JSON parser. If this were part of a shell script, jq would be my tool of choice.
Wasnt able to do much with that since new-data is data that is a file full of rows that needs to modify that. but i ended up just using paste with that column. i printed just the 2 columns up to the 3rd quote, then i pasted the column with the new data, then i just appended a
Code:
"}},
to the end of each row. simple as that. thank you.
Last edited by rootaccess; 11-19-2021 at 10:29 PM.
Right. But if the format of that data is JSON then there are specific tools which will be easier to work with, reduce or eliminate formatting errors, and be more flexible and less brittle.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.