10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
2. Shell Programming and Scripting
What i'm trying to do here is show X amount of lines before and after the string "serialNumber" is found.
BEFORE=3
AFTER=2
gawk '{a=$0} {count=0} /serialNumber/ && /./ {for(i=NR-'"${BEFORE}"';i<=NR;i++){count++ ;print a}for(i=1;i<'"${AFTER}"';i++){getline; print ; count ++; print... (5 Replies)
Discussion started by: SkySmart
5 Replies
3. Shell Programming and Scripting
Hello all,
I would like to ask your help here:
I've a huge file that has 2 columns. A part of it is:
sorted.txt:
kss23 rml.67lkj
kss23 zhh.6gf
kss23 nhd.09.fdd
kss23 hp.767.88.89
fl67 nmdsfs.56.df.67
fl67 kk.fgf.98.56.n
fl67 bgdgdfg.hjj.879.d
fl66 kl..hfh.76.ghg
fl66... (5 Replies)
Discussion started by: Padavan
5 Replies
4. Shell Programming and Scripting
hi,
i have a fixed width file with multiple columns and need to print data using awk command.
i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file.
but now i have a fixed width file like below:
7518 8269511BH 20141224951050N8262
11148 8269511BH... (5 Replies)
Discussion started by: kcdg859
5 Replies
5. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
6. Shell Programming and Scripting
Dear All,
I have a data file input.csv like below. (Only five column shown here for example.)
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
3,2,4,5,6
5,3,5,5,6
From this I want the below output
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
where the second column... (4 Replies)
Discussion started by: ks_reddy
4 Replies
7. Shell Programming and Scripting
input:
123456 1111
124567 2222
125678 3333
234567 aaaa
456789 abcd
awk logic:
- read lines for recurring 1st 2 chars of the 1st field
- if recurrence detected count up and print value
output:
1 123456 1111
2 124567 2222
3 125678 3333 (6 Replies)
Discussion started by: ux4me
6 Replies
8. Shell Programming and Scripting
Hi. How do I find an expression with awk in only one column, and if it fits, then print that whole column.
1 apple oranges
2 bannanas pears
3 cats dogs
4 hesaid shesaid
echo "which number:"
read NUMBER (user inputs number 2 for this example)
awk " /$NUMBER/ {field to search is field... (2 Replies)
Discussion started by: glev2005
2 Replies
9. Shell Programming and Scripting
I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this).
For example, i have a input file1.txt:
cat inputfile1.txt
218299910417
1172051195
1172070231
1172073514
1183135117
1183135118
1183135119
1281440202
... (3 Replies)
Discussion started by: poliver
3 Replies
10. Shell Programming and Scripting
Hi Friends,
I have a log file as below
siteid = HYD
spc = 100
rset = RS_D_M
siteid = DEL
spc = 200
rset = RS_K_L
siteid = DEL2
spc = 210
rset = RS_D_M
Now I need a output like column wise as below.
siteid SPC rset
HYD 100 RS_D_M (2 Replies)
Discussion started by: suresh3566
2 Replies