Home Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

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
The Following User Says Thank You to rdrtx1 For This Useful 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 04:51 PM..
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Check increment values in column jiam912 Shell Programming and Scripting 6 06-24-2015 07:49 AM
Reading multiple values from multiple lines and columns and setting them to unique variables. FMMOLA Shell Programming and Scripting 7 05-23-2014 02:42 PM
Read record from the text file contain multiple separated values & assign those values to variables ketanraut Shell Programming and Scripting 7 03-06-2014 12:25 PM
Check null values column Vivekit82 Shell Programming and Scripting 1 09-04-2013 12:54 PM
How to check values stored in variable? ramsavi Red Hat 1 05-10-2013 04:32 AM
How to check for values in array? ramsavi Red Hat 1 05-09-2013 05:33 AM
How do you [e]grep for multiple values within multiple files? callumw UNIX Desktop Questions & Answers 4 03-18-2012 09:21 PM
check for param values raopatwari Shell Programming and Scripting 4 03-18-2011 05:34 PM
Check values in file sandy1028 Shell Programming and Scripting 4 07-21-2010 08:38 PM
how to check the variable values is blank julirani Shell Programming and Scripting 2 12-06-2008 04:24 PM


All times are GMT -4. The time now is 01:29 PM.

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