Search Results

Search: Posts Made By: Gautham
3,044
Posted By Akshay Hegde
I can see you updated first post $ awk...
I can see you updated first post

$ awk 'p,p{if($0 ~ p){print;if(k>0){k=0}next}else{if(++k <= 3)print}}' p='country=india' file
3,044
Posted By Akshay Hegde
With your original input I get this $ cat...
With your original input I get this

$ cat file
country=india
ram
ajit
sham
vijay //need to be removed
country=india
suman
tharan
raju

$ awk 'FNR != s ;$0 ~ pat{s = FNR +...
8,999
Posted By Don Cragun
The cp utility will have to use creat() (or...
The cp utility will have to use creat() (or open(...O_CREAT)) to create the file it is copying to. The mv will have to do the same thing cp does if it is a move across filesystem boundaries, or use...
8,999
Posted By Don Cragun
Huh? How does "an incoming file" get to that...
Huh? How does "an incoming file" get to that path if a file isn't created with that path? You can use dtrace to track link() and symlink() as well as open() with O_CREAT set (AKA creat()) if you...
3,036
Posted By Don Cragun
Scrutinizer's code makes assumptions about what...
Scrutinizer's code makes assumptions about what the 1st line of a header looks like (based on your sample input) that might not be true in your real data and only requires that the 3rd line of a...
3,036
Posted By Scrutinizer
@Gautham: FWIW I tried it with the emulator...
@Gautham:

FWIW I tried it with the emulator link you provided:
/var/root # cat test.sh
awk -F, ' ...
3,311
Posted By RudiC
Try awk '$0 ~ PATT {P=NR+5} NR!=P' PATT=10000 file
Try awk '$0 ~ PATT {P=NR+5} NR!=P' PATT=10000 file
3,311
Posted By SriniShoo
awk '$0 ~ patt {n = NR} NR != n+5' patt='10000'...
awk '$0 ~ patt {n = NR} NR != n+5' patt='10000' file
Showing results 1 to 8 of 8

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