10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
2. Shell Programming and Scripting
Hi, I have files, with fixed length fields/let's say every field 5 positions/, like this:
xxxx 140 xxxxx
xxxx 140 xxxxx
xxxx 1400 xxxxx
xxxx 150 xxxxx
I need to get only the records, which have 140 in the second column. I use that command:
nawk '{if (substr($0,6,3)=="140") print $0}'... (3 Replies)
Discussion started by: apenkov
3 Replies
3. Shell Programming and Scripting
Hi,
I need to replace the ip 1.1.1.1 with the name test.sol.box . I have tried and come up with following code.
do we have any other way of doing this with nawk??
Data:
#This is a test setup.Please enter your values and corresponding port number here
##########################
Server Host... (5 Replies)
Discussion started by: chidori
5 Replies
4. Shell Programming and Scripting
i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies
5. Shell Programming and Scripting
HI,
My file contains data something like
034500,5,B5004946544EB185,DEFAULT,0
Now i want to do a pettern match for DEFAULT and remove that particular line from file and transfer the rest contents to temp file.But my req is i want to do case insensitive matching ie DEFAULT / default.
I... (4 Replies)
Discussion started by: centurion_13
4 Replies
6. Shell Programming and Scripting
Hi,
I have requirement that I need to split my input file into two files based on a search pattern "abc"
For eg. my input file has below content
abc
defgh
zyx
I need file 1 with
abc
and file2 with
defgh
zyx
I can use grep command to acheive this. But with grep I need... (8 Replies)
Discussion started by: sbhuvana20
8 Replies
7. Shell Programming and Scripting
I have a file
1 1 40421 120 18421 112h 019 6 10335 03
1 1 40421 120 18422 124h 055 6 10335 03 I have wriiten a nawk statement
nawk '$5 ~ "18421" {sub($7,"0190"print}' old.txt I am getting the output as
1 1 40421 120 18421 112h 0190 6 10335... (5 Replies)
Discussion started by: prav076
5 Replies
8. Shell Programming and Scripting
i'm puzzled....
trying to look for the pattern }"'. but the below code returns to me the message below (pattern is curley queue + dbl qt + sng qt + period)
nawk -v pat="\}\"\'\."'
{
if (match($0, pat)) {
before = substr($0,1,RSTART-1);
... (11 Replies)
Discussion started by: danmauer
11 Replies
9. Shell Programming and Scripting
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies
10. Shell Programming and Scripting
I've written a script to count the total size of SAN storage LUNs, and also display the LUN sizes.
From server to server, the LUNs sizes differ.
What I want to do is count the occurances as they occur and change.
These are the LUN sizes:
49.95
49.95
49.95
49.95
49.95
49.95
49.95
49.95... (2 Replies)
Discussion started by: cyber111
2 Replies