Sponsored Content
Top Forums Shell Programming and Scripting concat 6 files in 1 file ( maybe use AWK?) Post 302235717 by naoseionome on Friday 12th of September 2008 01:45:45 PM
Old 09-12-2008
better example

explaining my situation best:




the information may came like this:

410000000000001,dummy, data,separated,by,comma,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,
410000000000002,,dummy, data,separated,by,comma,,,,,,,,
410000000000003,,dummy, data,separated,by,comma,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,

and in some files i cames with the first value in all the lines.
like this:
410000000000002,,dummy, data,separated,by,comma,,,,,,,,
410000000000003,,dummy, data,separated,by,comma,,,,,,,,

i want it to stay like for each file:

X,410000000000001,dummy, data,separated,by,comma,,,,,,,,
X,410000000000001,,,,,,,,,,,,,,,,,,,,,,,,,
X,410000000000001,,,,,,,,,,,,,,,,,,,,,,,,,
X,410000000000001,,,,,,,,,,,,,,,,,,,,,,,,,
X,410000000000002,,dummy, data,separated,by,comma,,,,,,,,
X,410000000000003,,dummy, data,separated,by,comma,,,,,,,,
X,410000000000003,,,,,,,,,,,,,,,,,,,,,,,,,

or like this:
410000000000001,X,dummy, data,separated,by,comma,,,,,,,,
410000000000001,X,,,,,,,,,,,,,,,,,,,,,,,,,,
410000000000001,X,,,,,,,,,,,,,,,,,,,,,,,,,,
410000000000001,X,,,,,,,,,,,,,,,,,,,,,,,,,,
410000000000002,X,,dummy, data,separated,by,comma,,,,,,,,
410000000000003,X,,dummy, data,separated,by,comma,,,,,,,,
410000000000003,X,,,,,,,,,,,,,,,,,,,,,,,,,,

the final result depends on how the sort function works because i need the sort to be done by the value 4100000000000XXX.

And for final result i need this:
1,410000000000001,,dummy, data,separated,by,comma,,,,,,,,
2,410000000000001,,dummy, data,separated,by,comma,,,,,,,,
3,410000000000001,,dummy, data,separated,by,comma,,,,,,,,
...
7,410000000000001,,dummy, data,separated,by,comma,,,,,,,,
1,410000000000002,,dummy, data,separated,by,comma,,,,,,,,
2,410000000000002,,dummy, data,separated,by,comma,,,,,,,,


which means, i need to sort the files by the number 4100000000000XX in order to process all the information for the same number sequentially ( it goes to a oracle database after processing)

I hope this explains my situation best and that you can help me.

best regards,
Ricardo Tomás
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Search and then concat 4m other file (comma seperated)

My query is now a bit simplified. file1.txt names; ID; value1 ; values N; ABC; 1 ; a18 ; ... CDF; 2 ; b16 ; .. ABC; 1 ; c13 ; ...... EFG; 3 ;d12 ; ... file2.txt ID(Unique);smVals; smVal1; smVal N; 1; ...; ...; ...; 2; ..; ..; ..; 3; ..; ..; ..; ... (1 Reply)
Discussion started by: szchmaltz
1 Replies

2. Shell Programming and Scripting

Conditional concat lines awk

Hello, I have a text file like this: NONE FILE_Rename frompath: /log_audit/AIX/log/current/AIXAFTPP.log NONE FILE_Unlink filename /audit/tempfile.14041142 NONE FILE_Rename ... (8 Replies)
Discussion started by: carloskl
8 Replies

3. Programming

Concat of two html file

By launching two SQL scripts I get two html files report_1.html and report_2.html with different background and text colors (white/blue for the former and silver/black for the latter) but if I try to concat the two html by using the CAT function on UNIX Server where Oracle is installed (cat... (1 Reply)
Discussion started by: Mark1970
1 Replies

4. Web Development

Concat of two html files

By launching two SQL scripts I get two html files report_1.html and report_2.html with different background and text colors (white/blue for the former and silver/black for the latter) but if I try to concat the two html by using the CAT function on UNIX Server where Oracle is installed (cat... (2 Replies)
Discussion started by: Mark1970
2 Replies

5. Shell Programming and Scripting

Awk Concat

Hi All this may be somewhere in internet , but couldnt find the it. i have file as abc01 2010-07-01 12:45:24 2010-07-01 12:54:35 abc02 2010-07-01 12:59:24 2010-07-01 01:05:13 abc03 . . . the output using awk should look like this abc01|2010-07-01 12:45:24|2010-07-01 12:54:35... (3 Replies)
Discussion started by: posner
3 Replies

6. Shell Programming and Scripting

Need help in concat of two lines in a file

Hi , Need help in concating two lines based on certain character, for example my file has the messages : :57A:qweqweww :58A:qeqewqeqe -}$ {1:fffff2232323}{2:123123dasds}{4: :20:121323232323232 :21:sdsadasdasddadad if the line ends with "-}$" or if a line starts with "{1:" then it... (5 Replies)
Discussion started by: ulin
5 Replies

7. Shell Programming and Scripting

concat 3 files

Hello Unix gurus, how to concat 3 files content side by side . i have 3 files more report1.txt select *from tab1 A JOIN tab1 B ON more report2.txt A.PK1=B.PK1 where more report3.txt A.AAA <> B.AAA or A.BBB <> B.BBB or A.CCC<> B.CCCC or .. .. .. A.ZZZ <> B.ZZZ; if i concatinate... (3 Replies)
Discussion started by: kanakaraju
3 Replies

8. Shell Programming and Scripting

awk concat lines between 2 sequent digits

I would like to print string between two sequent digits and concatenate it into one single line. input.txt 99 cord, rope, strand, twine, twist, 100 strand, twine, twist, cord, rope 101 strand, twine, twist, twine, twist, cord, rope 105 cord, rope ,twi ... (8 Replies)
Discussion started by: sdf
8 Replies

9. UNIX for Dummies Questions & Answers

concat any two lines in a file

I have a file with line 4 : F SITE SPA_M2 SPA_M3 SPA_M4 and a line 237 with: BV_N4 VbdGO_PW Rs_NW_STI Rc_N+OD need a awk liner to concat the two lines so that line 2 sits next to line1 and looks like: F SITE SPA_M2 SPA_M3 SPA_M4 BV_N4 VbdGO_PW ... (8 Replies)
Discussion started by: awkaddict
8 Replies

10. Shell Programming and Scripting

Concat String with variable after a 'grep' and awk

Here is the structure of my file: MyFile.txt g-4.n.g.fr 10.147.243.63 g-4.n.g.fr-w1 Here is my sript: test.sh #! /bin/sh ip=10.147.243.63 worker=$(grep -e $ip $1 | awk '{ print $3; }') echo "" echo $worker echo "" echo $worker echo "" echo "$worker.v.1" echo... (7 Replies)
Discussion started by: chercheur111
7 Replies
RSA_sign_ASN1_OCTET_STRING(3)					      OpenSSL					     RSA_sign_ASN1_OCTET_STRING(3)

NAME
RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures SYNOPSIS
#include <openssl/rsa.h> int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, unsigned int m_len, unsigned char *sigret, unsigned int *siglen, RSA *rsa); int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m, unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, RSA *rsa); DESCRIPTION
RSA_sign_ASN1_OCTET_STRING() signs the octet string m of size m_len using the private key rsa represented in DER using PKCS #1 padding. It stores the signature in sigret and the signature size in siglen. sigret must point to RSA_size(rsa) bytes of memory. dummy is ignored. The random number generator must be seeded prior to calling RSA_sign_ASN1_OCTET_STRING(). RSA_verify_ASN1_OCTET_STRING() verifies that the signature sigbuf of size siglen is the DER representation of a given octet string m of size m_len. dummy is ignored. rsa is the signer's public key. RETURN VALUES
RSA_sign_ASN1_OCTET_STRING() returns 1 on success, 0 otherwise. RSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, 0 otherwise. The error codes can be obtained by ERR_get_error(3). BUGS
These functions serve no recognizable purpose. SEE ALSO
ERR_get_error(3), objects(3), rand(3), rsa(3), RSA_sign(3), RSA_verify(3) HISTORY
RSA_sign_ASN1_OCTET_STRING() and RSA_verify_ASN1_OCTET_STRING() were added in SSLeay 0.8. 0.9.7d 2003-11-20 RSA_sign_ASN1_OCTET_STRING(3)
All times are GMT -4. The time now is 03:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy