Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:32:14+00:00 2026-06-15T11:32:14+00:00

what would be an opposite of split() in awk ? Imagine I have array

  • 0

what would be an opposite of split() in awk?
Imagine I have array containig characters/integers.

What I’ve tried:

color = "#FFFF00";
printf("color original: %s\n", color);
split(color, chars, "");
joined = "";
for (i=1; i <= length(chars); i++) {
    joined = joined + chars[i];
}
printf("color joined: %s\n", joined);

however the output is:

color original: #FFFF00
color joined: 0

that is of course incorrect.

UPDATE:
cool, ended up with the following code (inspired by join function present in answers):

color = "#FFFF00";
printf("color original: %s\n", color);
split(color, chars, "");
joined = "";
for (i=1; i <= length(chars); i++) {
    joined = joined "" chars[i];
}
printf("color joined: %s\n", joined);

the trick was not to use + sign when joining things back

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:32:16+00:00Added an answer on June 15, 2026 at 11:32 am

    Knowing that the opposite of split() is join(), a mere Google Search gives me this page, which seems to contain the solution : http://www.gnu.org/software/gawk/manual/html_node/Join-Function.html . It joins all the elements of an array together, and returns the corresponding string.

    ['f','o','o'] => "foo"
    

    Have fun

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the opposite of: savedPlanets.append(planet.getDisplayName()+,); I have a list and I am
How would I use NSRunningApplication ? I have something opposite of that which is
Would be possible to extend this kind of layout so that I can have
Given a table-valued function such as dbo.Split() from T-SQL: Opposite to string concatenation -
Possible Duplicate: Split string in SQL I have seen a couple of questions related
In this example , StringBuffer is actually faster than StringBuilder, whereas I would have
I'm trying to go the opposite way of what you would normally do. I
I have a data frame composed of numeric and non-numeric columns. I would like
what would be the opposite of intersect in groovy collections?
I would like to know what the opposite of a 'stateless protocol' is. Am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.