10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
Thanks for answering my previous question. Could you please explain the highlighted code?
awk -v pos='9 27 39 54 59 64 71 78 83 103 108' 'BEGIN{split(pos,var)} {for (i in var) $0=gensub(/./,"|",var)} 1' test.txt | head
I understood that the split function splits the pos string into... (2 Replies)
Discussion started by: mrcool4
2 Replies
2. SCO
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
3. Shell Programming and Scripting
Hi
I have strings like these :
Vengeance mitt
Men Vengeance gloves
Women Quatro Windstopper Etip gloves
Quatro Windstopper Etip gloves
Girls Thermobite hooded jacket
Thermobite Triclimate snow jacket
Boys Thermobite Triclimate snow jacket
and I would like to get the lower case words at... (2 Replies)
Discussion started by: louisJ
2 Replies
4. UNIX for Dummies Questions & Answers
Hi Unix.com !
I would need some help for something I don't understand :confused:
input:
111|2 Y Z blue.
333|4 W X blue.; 5 Y Z red.
666|7 W X red.; 8 Y Z blue.
999|10 U V red.; 11 W X blue.; 12 Y Z red.
From $2, I would like to remove the sub-strings containing "blue" (and the... (4 Replies)
Discussion started by: beca123456
4 Replies
5. Programming
hi i've already created this script. When I execute the script it takes the argument and compares it to the 3rd column of the script. What I was wondering if I could get some help with is. I want to add another column to the script and it will be the result of a set number for example, (2000 - 3rd... (3 Replies)
Discussion started by: gengar
3 Replies
6. Shell Programming and Scripting
People,
Ive been trying to make a script but i just cant figure it out.
Problem/ Case:
I have a logfile.txt that contains data. The only two things i need to filter on = $1 (date), $6 (errorcode).
In the script i am trying to make, u need to fill in a date. So he searches on that date... (11 Replies)
Discussion started by: Pow3R
11 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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