Search Results

Search: Posts Made By: greenworld
1,300
Posted By greenworld
Shell Programming
Files to be merged.

File1(1.txt)
-----------
1|2|Y
2|5|N

File2(2.txt)
-----------
1|abc
2|xyz
3|pqr

My Code:
---------
nawk '
BEGIN {
FS=OFS="|"
}
NR==FNR {
1,581
Posted By greenworld
JG, It works absolutely fine... Just...
JG,

It works absolutely fine...

Just one more issue if you have few minutes...

Like you said , the 17th filed is being sorted with the way you suggested 17.1 which works fine...

I...
1,581
Posted By greenworld
Sort Issue
these are two records(adr.txt)trying to sort with the the code expl below.
5423|336110|2730 Pierce St|Ste 300|Sioux City|IA|Woodbury|51104|3765||42518651|96405013|A|2|3|U|12/08/2009...
14
3,970
Posted By greenworld
join issue
I have 2 files

1.txt
-----
13
14
16
3

2.txt
-----
13|BV1876032
13|BV9252040
14|MR0316097
17|MH0839742

The following

nawk '
BEGIN {
6,027
Posted By greenworld
sort a file which has 3.7 million records
hi,
I'm trying to sort a file which has 3.7 million records an gettign the following error...any help is appreciated...

sort: Write error while merging.

Thanks
14
3,970
Posted By greenworld
vgersh99, It works perfectly...I really...
vgersh99,

It works perfectly...I really appreciate your help...I'm not a big UNIX guy...

Thank you so much...
14
3,970
Posted By greenworld
one last try please...not sure what i messed...
one last try please...not sure what i messed up...here is the real data I am trying to merge

file1:
----
1|4535|78456|abc|def|ghi|
2|4673|73766|aaa|fgh|dfg|
3|7834|94583|bbb|tyr|yut|
file2:...
14
3,970
Posted By greenworld
vgersh99, It works...my apologies for not...
vgersh99,

It works...my apologies for not putting the data right.. a small change please...

file1:
----
1|abc|def|ghi|
2|aaa|bbb|ccc|
file2:
-----
1|abc|P|1111111111|...
14
3,970
Posted By greenworld
Ahmad, sorry to bother you,...your code...
Ahmad,

sorry to bother you,...your code works great, but i have little tricky need here...please look inot this if you have few mins

file1:
----

1|abc|def|ghi|
2|aaa|bbb|ccc|

file2:...
14
3,970
Posted By greenworld
Ahmad, That works great, thank you so much,...
Ahmad,

That works great, thank you so much, one last questionif you don't mind

now I have,

File 1:
-----
1|M|abc|def
2|M|
3|F|xyz|pqr

File2:
-----
1|MD|
1|MBBS|
2|NR
2|FR|...
14
3,970
Posted By greenworld
join
Ahmad,

it gives only the following

1|abc|def
3|xyz|pqr

Thanks for your reoply though...
14
3,970
Posted By greenworld
Join
joining two files:

File1:
-----
1|M
2|M
3|F

File2:
-----
1|abc|def
3|xyz|pqr

join -t '|' 1.txt 2.txt gives(Itried many other ways)

1|M|abc|def
3|F|xyz|pqr

but I need the...
7
2,700
Posted By greenworld
Join
Hi,
need some help in joining please,
FILE 1:
-------
1|05/20/2009|
2|04/21/2009|
2|03/21/2009|
FILE 2:
-------
1|Michel|Hawkins|05/10/2009|
1|Michel|Hawkins|03/10/2007|...
57,051
Posted By greenworld
Vn
vgersh,

that works...Thanks a lot...

Honestly i still do not completely understand the code which is working totally fine....Trying to learn...

I appreciate it...

Not sure If i can...
57,051
Posted By greenworld
sample.txt file 1873072|PAC|2|3|C|1/4/2009...
sample.txt file
1873072|PAC|2|3|C|1/4/2009 0:00:00
1873072|PA|2|3|U|1/9/2009 0:00:00

nawk -F'|' '{n=split($NF, a, "[ /]"); gsub(":", "", a[n]);print a[3] a[1] a[2] a[n] OFS $0}' OFS='|'...
57,051
Posted By greenworld
Vn
vgersh,

Hope I'm not bothering you...one last question for now

1705614|FNP|2|99|C|1/2/2009 0:00:00
1705614|MSN|2|99|C|1/22/2009 0:00:00

Assuming all those previously sorted fields equal...
57,051
Posted By greenworld
Vn
Vgersh,

I appreciate your help...Seems working...Thank you so much
57,051
Posted By greenworld
Vn
vgersh,

I'm sorry to say that it doesn't work...I'm trying to be clear here

1705614|FNP|2|99|C|1/20/2009 0:00:00
1705614|MSN|1|88|U|1/2/2009 0:00:00

should be sorted on 0th field i.e...
57,051
Posted By greenworld
Vn
1705614|FNP|2|99|U|1/20/2009 0:00:00
1705614|MSN|1|99|C|1/2/2009 0:00:00

I want the above data to be sorted based on 0 / 4 / 3 / 2 fields (assume above data in abc.txt file)

sort -t '|' +0n...
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy