Solved

how to remove white space from a value

Posted on 2014-07-24
1
222 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Report events not being triggered 8 100
copyEvens challenge 6 64
for loop with Set 4 46
word0 challenge 3 58
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now