10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
This post is already here but want to do this with another way
Merge multiples files with multiples duplicates keys by filling "NULL" the void columns for anothers joinning files
file1.csv:
1|abc
1|def
2|ghi
2|jkl
3|mno
3|pqr
file2.csv:
1|123|jojo
1|NULL|bibi... (2 Replies)
Discussion started by: yjacknewton
2 Replies
2. Shell Programming and Scripting
I need to work with records having #AX in the EXP1 , please see my data sample and my attempt below:
$ cat xx
08:30:33 KEY1 (1255) EXP1 VAL:20AX0030006
08:30:33 KEY1 (1255) EXP1 VAL:20AX0030006
08:30:33 KEY1 (1255) EXP1 VAL:20AW0030006
08:30:33 KEY1 (1255) EXP1 VAL:20AW0030006
$ gawk '{... (1 Reply)
Discussion started by: migurus
1 Replies
3. Shell Programming and Scripting
Hello All,
I have this script to awk IP to new file.
#awk '/myip|yourip/ {sub(/...\....\....\..../, newip)}1' newip=$IP existing.txt > new.txt
When existing.txt has myip=192.168.123.123 and $IP has 192.168.12.12, the awk script is not working. But while I add zero left padding to $IP i.e,... (3 Replies)
Discussion started by: Shaan_Shaan
3 Replies
4. Shell Programming and Scripting
Hi,I've a unix pipe delimited file as below f1|f2|f3|f4|f5|f6 My requirement is to pad spaces on the left to fields f2, f3 and f5. Field Lengths according to file layout f2 - 4 char f3 - 5 char f5 - 3 char If my record is as below 1|43|bc|h0|34|a Output record should be as below 1| 43| bc|h0|... (4 Replies)
Discussion started by: Soujanya_K
4 Replies
5. Shell Programming and Scripting
Hi guys,
I need AWK to merge the following 2 files:
file1
1 a 1 1
2 b 2 2
3 c 3 3
4 d 4 4
file2
a a/a c/c a/c c/c a/a c/t
c c/t c/c a/t g/g c/c c/t
desired output:
1 a 1 1 a/a c/c a/c c/c a/a c/t
2 b 2 2 x x x x x x
3 c 3 3 c/t c/c a/t g/g c/c c/t
4 d 4 4 x x x x x x (2 Replies)
Discussion started by: g1org1o
2 Replies
6. Programming
I have a data table as follows:
mysql> select * from validations where source = "a03";
+------------+-------+--------+
| date | price | source |
+------------+-------+--------+
| 2001-01-03 | 80 | a03 |
| 2001-01-04 | 82 | a03 |
| 2001-01-05 | 84 | a03 |
| 2001-01-06... (2 Replies)
Discussion started by: figaro
2 Replies
7. Shell Programming and Scripting
So I have 2 files:
File 1:
111,Mike,Stipe
222,Peter,Buck
333,Mike,Mills
File 2:
222,Mr,Bono
444,Mr,Edge
I want output to be below, where 222 records joined and all none joined records still in output
111,Mike,Stipe
222,Peter,Buck,Mr,Bono
333,Mike,Mills
444,Mr,Edge (4 Replies)
Discussion started by: stack
4 Replies
8. Shell Programming and Scripting
Hello,
I want to get the User Name details of a user from a file list.
This list can be in the format:
FirstName_MiddleName1_LastName_ID
FirstName_LastName_ID
FirstName_MiddleName1_MiddleName2_LastName_ID
What i want it to return is FirstName_MiddleName1_LastName of a user.
I... (6 Replies)
Discussion started by: limamichelle
6 Replies
9. UNIX for Dummies Questions & Answers
Hello,
My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns:
File A: (tab-delimited)
PDB CHAIN Start End Fragment
1avq A 171 176 awyfan
1avq A 172 177 wyfany
1c7k A 2 7... (3 Replies)
Discussion started by: InfoSeeker
3 Replies
10. Shell Programming and Scripting
nawk 'NR==FNR{a;next} {if($1 in a) print $1,"Found" else print}' OFS="," File_B File_A
The above code is not working help is appreciated (6 Replies)
Discussion started by: pinnacle
6 Replies