Figured out the issue; needed to be;
my $awk_cn_command = qq|awk 'NR>1 && !/cn=/{printf "\\n"}{printf "%s",\$0}END{printf "\\n"}' $tmpfile_1 > $tmpfile_2|;
Hi PHV,
Thanks for this, and it works great.
However, now I need to put this into a perl script & I am having issues with getting it to work. I have tried backticks, qq etc. and no good. Any ideas how to make this work within a perl script?
I run this ->
my $tmpfile_2 =...
Hi,
I have a large file containing lots of data, however, I want to do the following;
Find any lines containing the pattern cn=
and join this line to the preceeding line (same as shift J in vi)- if that makes sense?
Hi CaKiwi,
This is very helpful, however, produces the following output;
| FALSE | client.local/client/Accounts/user1 | Town | | user1 | company name | | 02/12/2009 17:02 | Department1 | | User 1 | CN=user1,OU=Accounts,OU=Client,DC=client,DC=local |...
Hi,
I'm not an expert in AWK, but I've been advised awk could help with this problem...
I have the following file I'd been trying to merge with SQL within a database, basically, I've had to merge AD users and group information, which in SQL is not an issue. However, it's producing me output...
Almost 100% perfect. How can I make it print only the results from the second file? i.e. the delta file? It is showing me inserts / deletes from both files... I need only to display the results from the second...
This issue with result posted is that it is giving me unstructured output. i.e. a mixture of the old and new data. I only want the adds, the modifys, and the deletes - not the old data in the output... Is this possible?
This issue with result posted is that it is giving me unstructured output. i.e. a mixture of the old and new data. I only want the adds, the modifys, and the deletes - not the old data in the output... Is this possible?
Hi - incorrect post above... reposting!
----------------------------------------------------------------
Hi,
I need to create a script that will figure out the deltas between two files e.g. yesterdays csv and todays csv; and write the delta to a new file... the unique key for the script would...
Hi,
I need to create a script that will figure out the deltas between two files e.g. yesterdays csv and todays csv; and write the delta to a new file... the unique key for the script would be $80 in the file...
So I have something like this as input;
yesterday
name, address, dob....snn
name1...
Hi both,
Thanks so much for your responses... it's mostly working; however; I've done some tests around creating deltas between files as follows;
File 1 ->
userid, fname, sname, dob, license number
1, diar, cart, 12/12/12, 13324
17, mickey, mouse, 2/2/22, 22222
14, donald1, duck, 1/1/11...
Thanks feherke,
However, in File 2 if I move e.g.
1, diar, cart, 12/12/12, 13324
to the bottom of the file; this will still flag as a difference (even though it is an identical entry - but in a different place in the file).
Hi,
I've written the following code to compare 2 csvs,
awk 'NR==FNR{_[NR]=$0}
NR!=FNR{
if($0 != _[FNR])
{
print $0
}
}' export1.csv export2.csv
But I need to extend it (as it really only offers diff capabilities) to compare based on some unique ID e.g...
Hi,
I need to create a file to add 300000 users to a directory server. The input should look like this;
Objectclass: User
DN: CN=[XXX123],OU=newaccounts,DC=domain,dc=com
CN: XXX123
userAccountControl: 66080.
sAMAccountName: XXX123
userPrincipalName: xxx123@domain.com
I need to create a file...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.