Answers for "awk how to print without adding spaces between fields"

1

awk how to print without adding spaces between fields

# Short answer:
# If you're getting unwanted spaces between the items you're printing 
# with awk you probably need to remove commas between the items.

# Example of problem:
awk '{print $1, "some-text", $2}' file_to_parse # $1 and $2 are the 
# first and second fields/columns of the the file_to_parse
--> field_1 some text field_2 # Output

# If you didn't want spaces, remove the commas:
awk '{print $1 "some-text" $2}' file_to_parse
--> field_1some-textfield_2 # Output
Posted by: Guest on September-09-2020

Code answers related to "awk how to print without adding spaces between fields"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language