sed/awk or help please


 
Thread Tools Search this Thread
# 8  
In the future, please start with the representative data set instead of going through multiple reiterations with different solutions.
Code:
nawk -v f1=MIN -v f2=0100 'BEGIN{RS=FS=""} $1 == (f1 " " f2) {print >("file" f2)}' myFile

Good luck.
# 9  
Great codes!! Work nicely!Thank you
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Science: Gadgets
Difficulty: Easy
The communication protocol NFC stands for Near-Field Control.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

2. Shell Programming and Scripting

Using Sed / Awk how we can do this?

In a file contains N number of line like this . "Anish.com, Inc.",3499,"Kumar.CO",1815413,3/28/12 7:55,3/27/14 23:59,"ZW","Zimbabwe","ZA","2nd" "Restricted and Reserved names .AfOInternet",3798,"Anish.CO",1201208,6/16/10 0:00,6/16/13 0:00,,,"CO","2nd" i want the output like this ... (7 Replies)
Discussion started by: anishkumarv
7 Replies

3. Shell Programming and Scripting

Is this possible using SED and AWK?

Dear Geeks, I want to manipulate a file with certain modifications for that using sed or AWK how to do this process for one file i have this type of data. Input File: "Restricted and Reserved names .ANISH",3798,"TEST.CO",1201208,6/16/10 0:00,6/16/13 0:00,,,"CO","2nd"^M "Restricted and... (4 Replies)
Discussion started by: anishkumarv
4 Replies

4. Shell Programming and Scripting

using awk or sed need help

Hi experts, I have a file with the following output HOST = host1 SERVICE_NAME = service1 HOST = host2 SERVICE_NAME = service2 HOST = host3 SERVICE_NAME = service3 Need the output like this host1;service1 host2;service2 host3;service3 (2 Replies)
Discussion started by: iron_michael86
2 Replies

5. Shell Programming and Scripting

Sed /awk

I have a interesting problem, The data is of the format 1,264,sjfgd,6738,jsfg then there are certain bad records of the format 1,265,jsfgdh These records are not complete ,I want to delete these records. (1 Reply)
Discussion started by: smee
1 Replies

6. Shell Programming and Scripting

Help with awk / sed

Hi i need some help with extracting text from an bash output and I am trying to learn how to use awk - sed. I have a shell script that will mount an image file and i need to grab some script output and process it by piping the input to awk or sed. ie. Output : add map loop0p1 : 0 208782... (7 Replies)
Discussion started by: wizkidnono
7 Replies

7. UNIX for Advanced & Expert Users

sed in awk ? or nested awk ?

Hey all, Can I put sed command inside the awk action ?? If not then can i do grep in the awk action ?? For ex: awk '$1=="174" { ppid=($2) ; sed -n '/$ppid/p' tempfind.txt ; }' tempfind.txt Assume: 174 is string. Assume: tempfind.txt is used for awk and sed both. tempfind.txt... (11 Replies)
Discussion started by: varungupta
11 Replies

8. Shell Programming and Scripting

awk vs. sed

These tools seem very similar to me in terms of text/file manipulation. Can someone explain to me why I would choose one over the other? TIA, Jennifer (3 Replies)
Discussion started by: yoonixq4u
3 Replies

9. Shell Programming and Scripting

sed,awk

Hi, I know sed is stream text editor and not a bit more than that. Can anyone explain its usage and advantages? How is awk different from sed? I donno i am a bit confused about it. But i have coded in awk and shell. Thanks, Nisha :confused: (7 Replies)
Discussion started by: Nisha
7 Replies

10. Shell Programming and Scripting

awk / sed

I have many messages such as the test message below: 00:00000:00021:2002/05/13 13:57:00.51 ERROR:- Test error, my test error!!! I am writing a script in which I need to get everything from the word "ERROR:-" onwards. I normally use awk for these things, but I am not an expert at it so i am... (6 Replies)
Discussion started by: baileyr1
6 Replies

Featured Tech Videos