rs and ors in gawk ...????


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting rs and ors in gawk ...????
# 1  
Old 10-05-2004
Data rs and ors in gawk ...????

Smilie dear members I have a good knowledge of gawk and seem to do quite well with it.. but I have never understood what the use of the rs and ors are for or how they are used.. i am thinking they are for seperating lines and paragraphs but i have absolutely no idea how to make it work, if that is what it is for..
any input or example welcome
thanx moxxx68:Smilie
# 2  
Old 10-05-2004
Hmmm moxxx its hard to believe you have a good understanding of gawk if you are not sure what RS and ORS are used for. Check out the GNU.org side, search for Gawk documentation as there is a complete manual on Gawk that provides an indepth explanation of these key words. Read More Here...
# 3  
Old 10-05-2004
Computer google you the man!

Smilie finally some text that I can understand a lilttle more clearly.. I have read a few books on sed, grep and awk and have found that in the awk department sometimes its hard to tell what the author is talking about exactly.. but this quite clear and infact i have book marked the whole home page of that site to look at some other things I haven't quite understood to well yet.. like get "getline", and some that i just need to brush up on...
thanx moxxx68Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Can someone please explain why we need to set ORS in below awk code?

Question: Write a command to print the fields in a text file in reverse order? awk 'BEGIN {ORS=""} { for(i=NF;i>0;i--) print $i," "; print "\n"}' filename I was thinking it should be (what is the need to set ORS="" ? )- awk 'BEGIN { for(i=NF;i>0;i--) print $i," "; print "\n"}' filename (3 Replies)
Discussion started by: Tanu
3 Replies

2. Shell Programming and Scripting

awk : ORS not to be printed after the last record

Hello Team, here is the code: scripts]# ls /etc/init.d/ | awk 'BEGIN{ORS=" && "} /was.init/ && !/interdependentwas/ && !/NodeAgent/ && !/dmgr/{print "\$\{service_cmd\} "$0 " status"}' 2>/dev/null ${service_cmd} cmserver_was.init status && ${service_cmd} fmserver_was.init status &&... (6 Replies)
Discussion started by: chandana.hs
6 Replies

3. Shell Programming and Scripting

awk RS/ORS error

Hello, I am trying to filter fastq file (in short, every 4 lines to be a record) based on the GC counts (GC-contents) in sequence (i.e. field 2), which is the count % of the G/C chars in the string. The example script is to pick up records with GC contents > 0.6 in the sequence (second field). ... (9 Replies)
Discussion started by: yifangt
9 Replies

4. SCO

Need help with gawk

I am trying to use gawk to search a file and put the second value of the string into a string. gawk -F: '$1~/CXFR/ {print $2}' go.dat Below is the file 'go.dat' ==================== HOME :/ CTMP :/tmp CUTL :/u/rdiiulio/bin CWRK :/u/work CXFR :/u/xfer ... (1 Reply)
Discussion started by: trolley
1 Replies

5. Shell Programming and Scripting

gawk: not found

While running gawk, OS stating that command not found. (5 Replies)
Discussion started by: sbaisakh
5 Replies

6. Shell Programming and Scripting

Gawk Help

Hi, I am using the script to print the portion of the file containing a particular string. But it is giving error "For Reading (No such file or directory). I am using cygwin as unix simulator. cat TT35*.log | gawk -v search="12345678" ' /mSOriginating /,/disconnectingParty/ { ... (1 Reply)
Discussion started by: vanand420
1 Replies

7. Shell Programming and Scripting

gawk to perl

Hi all I’m looking for a perl equivalent to this command string I need to imbed this in a existing perl script cat file1 | gawk -F"|" '{print $1","$2,",",$3,",",$11 >> "new-file"}' Thank you (4 Replies)
Discussion started by: Ex-Capsa
4 Replies

8. Shell Programming and Scripting

gawk and bash

Hi. I'm having trouble using gawk within a bash script and I can't figure out why. I have a command that takes in a data file with two columns, the first one numbers and the second words. My code takes each line, and prints the word its corresponding number of times. The code works from the... (2 Replies)
Discussion started by: cdislater
2 Replies

9. Shell Programming and Scripting

unable to use GAWK

The following message is being prompted while using gawk in my ksh : gawk: not found any idea how to fix this ? (1 Reply)
Discussion started by: sinpeak
1 Replies

10. Shell Programming and Scripting

gawk HELP

I have to compare records in two files. It can be done using gawk/awk but i am unable to do it. Please help me File1 ABAAAAAB BC asa sa ABAAABAA BC bsa sm ABBBBAAA BC bxz sa ABAAABAB BC csa sa ABAAAAAA BC dsa sm ABBBBAAB BC dxz sa File 2 ABAAAAAB BC aas ba ABAAAAAB BC asa sa... (6 Replies)
Discussion started by: sandeep_hi
6 Replies
Login or Register to Ask a Question