10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all, I'm trying to match the following two files with the code below:
awk -F, 'NR==FNR {a=$0; next} ($12,$4) in a {print $12,$1,a}' OFS="," file4.csv file3.csv
but the code does not print the entire row from file4 in addition to column 12 and 1 of file3.
file4:
o,c,q,co,ov,b... (1 Reply)
Discussion started by: bkane3
1 Replies
2. UNIX for Dummies Questions & Answers
I have simple test.sh script, see below:
bill_code=`echo $record | awk -F"|" '{print $1}'`
Fullname=`echo $record | awk -F"|" '{print $3}'`
email=`echo $record | awk -F\ '{print $4}'`
The last field contains spaces: see csv below:
A0222|Y|DELACRUZ|-cc dell@yahoo.com-cc support@yahoo.com
... (9 Replies)
Discussion started by: quay
9 Replies
3. Shell Programming and Scripting
Hello
I'm trying to extract two columns from a database using awk, the thing is i have a variable number of columns in each row, and I just need to get out the two first ones ending in ","
This is an example:
ABE, ABE V149 MAZIE ARD CYN ACY, ACY, , , ,TEC, , 5000, , , 1, ZNY,ZDC
ABE, ABE... (1 Reply)
Discussion started by: vir
1 Replies
4. Shell Programming and Scripting
is there a short one-liner that can print out in columns instead of a long list?
as in, instead of:
apples
oranges
cats
dogs
sky
monkey
giraffe
cups
spoons
tv
cable
it'll print something like this (properly indented of course :) ): (9 Replies)
Discussion started by: SkySmart
9 Replies
5. UNIX for Dummies Questions & Answers
Hi Gurus,
I want to extract certain columns from file 2 and combine with file 1.
I am using the following script to extract the columns.
$ awk 'FNR>1{print $2, $9, FILENAME}' *.lim > out1
However, this script does not print the titles of the columns 2 and 9.
Can somebody help me in... (1 Reply)
Discussion started by: Unilearn
1 Replies
6. Shell Programming and Scripting
Im using awk to print columns. Basically I have a file with like 500 columns and I want to print the 200th-300th column and ignore the rest... how would I do it without putting $200, $201 .... $300
thanks (6 Replies)
Discussion started by: kylle345
6 Replies
7. Shell Programming and Scripting
hi guys, i would like to print two lines from a file as two adjacent columns using excel using awk.. i have this so far:
awk '{for(i=1; i<=NF; i++) {printf("%s\n",$i)}}' "$count".ttt > "$count".csv #this to print the first line from the .ttt file as rows of the first column in the .csv... (9 Replies)
Discussion started by: npatwardhan
9 Replies
8. Shell Programming and Scripting
I need to tweek my awk output:
#cat filename
ab cd ef:ghi:jk lm:nop qrs
#cat filename | awk '{ for(i=3;i<NF+1;i++) printf $i}'
ef:ghi:jklm:nopqrs
I would like the ouput to include the original spaces from columns 3 on:
ef:ghi:jk lm:nop qrs
any suggestions? (4 Replies)
Discussion started by: prkfriryce
4 Replies
9. Shell Programming and Scripting
ok. this is a bit of a difficult question but i've been trying to figure this out for quite some time but couldn't.
how do I print columns on the screen?
like take for instant. using the ls and the file command, how do i print it so i can have the filenames on the left hand side and the... (3 Replies)
Discussion started by: Terrible
3 Replies
10. Shell Programming and Scripting
Here's what I wrote:
#!/bin/sh
d1=`grep Dialtone dialtone | awk '{print $2, $3, $4, $5, $6, $7, $8, $9}'`
d2=`grep pstsys dialtone | awk '{print $12}'`
echo "$d1 $d2"
I expected the result to be this:
Dialtone on host 1 slot 13 port 1, pstsys05
Dialtone on host 1 slot 13 port 1,... (3 Replies)
Discussion started by: cdunavent
3 Replies