Trying to use awk to check values and multiple

Tags
shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 8  
Old 03-21-2018
That worked perfect rdrtx1. Can you tell me what to add to that so I can write the output to a file?
# 9  
Old 03-21-2018
See update to post #7
This User Gave Thanks to rdrtx1 For This Post:
ziggy6 (03-21-2018)
# 10  
Old 03-21-2018
sed mayhap?
Code:
sed 's/\([0-9.]\+\)-/-\1/g' file

EDIT: Unfortunately,my mawk doesn't provide "back references", so the closest approximation would be
Code:
awk '{gsub (/[0-9.]+-/, "-&x"); gsub (/-x/, "")} 1' file


Last edited by RudiC; 03-21-2018 at 05:51 PM..
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Do replace operation and awk to sum multiple columns if another column has duplicate values as7951 Shell Programming and Scripting 12 05-06-2018 03:22 PM
awk to extract multiple values from file and add two additional fields cmccabe Shell Programming and Scripting 2 10-10-2016 04:16 PM
Merge values from multiple directories into one file in awk or bash cmccabe Shell Programming and Scripting 2 10-05-2016 06:31 PM
awk GSUB read field values from multiple text files dellanicholson UNIX for Beginners Questions & Answers 1 06-05-2016 11:37 PM
Check multiple patterns in awk kannan13 Shell Programming and Scripting 3 10-14-2015 06:17 AM
Check file from multiple files is empty using awk siramitsharma Shell Programming and Scripting 8 07-31-2015 06:49 AM
How to get index values for multiple matches in the same line with awk? chilicuil Shell Programming and Scripting 6 07-14-2015 02:39 PM
Reading multiple values from multiple lines and columns and setting them to unique variables. FMMOLA Shell Programming and Scripting 7 05-23-2014 03:42 PM
Get multiple values from an xml file using one of the following commands or together awk/perl/script slbmind Shell Programming and Scripting 2 03-17-2014 09:19 AM
Read record from the text file contain multiple separated values & assign those values to variables ketanraut Shell Programming and Scripting 7 03-06-2014 01:25 PM
Splitting record into multiple records by appending values from an input field (AWK) imtiaz99 Shell Programming and Scripting 4 04-24-2012 08:18 AM
awk + gsub to search multiple input values & replace with located string + extra text dazhoop Shell Programming and Scripting 2 01-24-2012 02:12 PM
Array in awk outputs multiple values alan Shell Programming and Scripting 1 11-09-2011 11:00 PM
Use AWK to check for numeric values? (BASH script) TauntaunHerder Shell Programming and Scripting 4 07-17-2011 03:10 PM
matching multiple values in awk VGR Shell Programming and Scripting 0 06-12-2009 12:37 PM
All times are GMT -4. The time now is 02:16 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?