Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to remove white space from a value

Posted on 2014-07-24
1
Medium Priority
?
230 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 85

Accepted Solution

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
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 …
Starting up a Project

773 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