[SOLVED] How to make Array into string in AWK and split
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
To expand on the previous post by Turbocapitalist ...
Help us to help you. Provide a sample input file (10-15 lines will do). Construct a sample output file which corresponds to your sample input and post both samples here. With "Before and After" examples we can better understand your needs and also judge if our proposed solution fills those needs.
Help us to help you. Provide a sample input file (10-15 lines will do). Construct a sample output file which corresponds to your sample input and post both samples here. With "Before and After" examples we can better understand your needs and also judge if our proposed solution fills those needs.
Guess we will have to take your word for it seeing as you did not want any of our help ... not really sure why you asked the question in the first place.
I didn't know how to do it. I tested A=A+Array[I], A+=Array[I], A[Array[I]] and even split(Array,B,";") but got bad results and I wanted to split into a new array after I collected all in a same variable. I got really lost, I am still a newbie to use "awk". After I asking questions I still continue to look around if it is not a really complex, but sometimes even simple things can be complex. I found out that in awk it works a little different, to add a variable to another for splitting is: "A=A Array[I]", I isn't necessary to use + as I thought, impossible to split in whole array, it is just enough to use space between variables.
Well I am glad you found a solution, it may not be the most expedient and you have not given anyone here a chance to show you an alternative because you refuse to answer any of the questions asked
of you. No one is knocking you learning, but your question was made moot by the fact you would not tell anyone the information requested ... which is why I thought it was kind of a waste
to ask the question in the first place if you didn't really want help.
Hopefully your future endeavours will come to you as well Good luck
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.