10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
i was tried using the awk command for replacing '-' in the second column. but the below command replacing the entire file.
cat 1.txt |awk '{gsub(/-/,"")}1'
Input file
1,2,3,-4,5,6
1,-2,3,4,5,-6
1,2,3,4,5,6
1,-2,3,4,-5,6
Output file
1,2,3,-4,5,6
1,2,3,4,5,-6
1,2,3,4,5,6... (3 Replies)
Discussion started by: onesuri
3 Replies
2. UNIX for Dummies Questions & Answers
I have two files, and I'm interested in the first two columns of each.
File1 compares set1 to set2 (column1 = set1 name, column2 = set2 name).
File2 compares set2 to set1 (column1 = set2 name, column2 =set1 name).
I want to print the set names (column values) that appear as pairs in both... (1 Reply)
Discussion started by: pathunkathunk
1 Replies
3. Shell Programming and Scripting
Experts,
Can you please help how to get the output that are written just below "bad"
calls badcalls nullrecv
439486 54 0
badlen xdrcall dupchecks ... (6 Replies)
Discussion started by: rveri
6 Replies
4. Shell Programming and Scripting
Hi,
Please help with this.
I have several excel files (with and .xlsx format) with 10-15 columns each.
They all have the same type of data but the columns are not ordered in the same way.
Here is a 3 column example. What I want to do add the alphabet
from column 2 to column 3, provided... (9 Replies)
Discussion started by: newbie83
9 Replies
5. Shell Programming and Scripting
Hello,
I have some tab delimited data and I need to move the last col. I could hard code it,
awk '{ print $1,$NF,$2,$3,$4,etc }' infile > outfile
but it would be nice to know the syntax to print a range cols.
I know in cut you can do,
cut -f 1,4-8,11-
to print fields 1,... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
6. Shell Programming and Scripting
Hi
My file have 7 column, FIle is pipe delimed
Col1|Col2|col3|Col4|col5|Col6|Col7
I want to find out uniq record count on col3, col4 and col2 ( same order) how can I achieve it.
ex
1|3|A|V|C|1|1
1|3|A|V|C|1|1
1|4|A|V|C|1|1
Output should be
FREQ|A|V|3|2
FREQ|A|V|4|1
Here... (5 Replies)
Discussion started by: sanranad
5 Replies
7. Shell Programming and Scripting
Hello Friends,
I am in situation where I have to note down few SQL queries from specific hexdump format. Here is an example (the query text starts at 65th character on each line)
----------------------
0x000007FEB0E701C0 : 7365 6C65 6374 2063 7573 746E 6F2C 2020 select custno, ... (9 Replies)
Discussion started by: Sunusernewbie
9 Replies
8. UNIX for Advanced & Expert Users
Hello everyone,
I am writing a script to process data from the ATP world tour.
I have a file which contains:
t=540 y=2011 r=1 p=N409
t=540 y=2011 r=2 p=N409
t=540 y=2011 r=3 p=N409
t=540 y=2011 r=4 p=N409
t=520 y=2011 r=1 p=N409
t=520 y=2011 r=2 p=N409
t=520 y=2011 r=3 p=N409
The... (4 Replies)
Discussion started by: imahmoud
4 Replies
9. Shell Programming and Scripting
I have 2 files as follows:
filename1: :
6742 /welcome/mundial98_ahf1_404.htm 1020
6743 /welcome/mundial98_ahf1_404.htm 2224
6744 /welcome/mundial_ef1_404.htm 21678
6745 /welcome/mundial_if_404.htm 4236
6746 /welcome/mundial_lf1_404.htm 21678
filename2:
6746 894694763 1... (2 Replies)
Discussion started by: jontjioe
2 Replies
10. Shell Programming and Scripting
Hi Guys...
I am newbie to awk and would like a solution to probably one of the simple practical questions.
I have a test file that goes as:
1,2,3,4,5,6
7,2,3,8,7,6
9,3,5,6,7,3
8,3,1,1,1,1
4,4,2,2,2,2
I would like to know how AWK can get me the distinct values say for eg: on col2... (22 Replies)
Discussion started by: anduzzi
22 Replies