Search Results

Search: Posts Made By: chrismcg24
7,451
Posted By chrismcg24
Perfect! Many thanks!
Perfect! Many thanks!
7,451
Posted By chrismcg24
awk ' ( NF == 5 ) && ( /^\./ ) { ...
awk ' ( NF == 5 ) && ( /^\./ ) { gsub(/[0-1][0-9][0-3][0-9][0-9][0-9][0-2][0-9][E][DS][T]/, dateblock synoptime tz, $4) ; print } 1' dateblock=$(date +%m%d%y) tz=$(date +%Z)...
7,451
Posted By chrismcg24
I have been unable to find documentation to tell...
I have been unable to find documentation to tell me how that works exactly -- it seems to print the entire file as well as the changed lines. I can get rid of the duplicates with uniq, but since I...
7,451
Posted By chrismcg24
OK, that helped -- thanks! I was under the...
OK, that helped -- thanks!

I was under the impression that gsub would make the substitutions in the matching lines in the input file itself, but that the output would contain both the changed and...
7,451
Posted By chrismcg24
I defined dateblock earlier in the program,...
I defined dateblock earlier in the program, before the awk statement. Unfortunately, the desired hour number is not just system time, but one of (02, 08, 14, 20) under EDT and (01, 07, 13, 19) under...
7,451
Posted By chrismcg24
AWK and sub/gsub: updating a date/time block
I have a file ("modtest") in which I want to update the last date/time block in the lines beginning with a period. Here is a sample:


.ROMULT 10150908EDT 10270908EDT 10010908EDT RANGE
RAWV2 ...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy