Solved

how to remove white space from a value

Posted on 2014-07-24
1
225 Views
Last Modified: 2014-07-25
Hello,
I am pulling a value from a file using this command,  I would then need to remove the white space from the value.

For example,
examplevalue=$(awk -F"\t" 'NR==30 {print $9}' $file )

Returns value
aaaa bbbb cccc

final value should look like this
aaaa-bbbb-cccc
0
Comment
Question by:bje
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 40218126
awk -F"\t" 'NR==30 {gsub(" ","-",$9);print $9}'
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question