Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: stu78
  • Order by date
  1. stu78

    Join line containing pattern to preceding line

    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|;
  2. stu78

    Join line containing pattern to preceding line

    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 =...
  3. stu78

    Join line containing pattern to preceding line

    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?
  4. stu78

    Merge using AWK

    Thanks guys - that's fantastic!
  5. stu78

    Merge using AWK

    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 |...
  6. stu78

    Merge using AWK

    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...
  7. stu78

    Delta Script

    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...
  8. stu78

    Compare two CSVs based on unique ID

    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?
  9. stu78

    Delta Script

    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?
  10. stu78

    Delta Script

    Diff doesn't really give me what I need... e.g. if the file gets sorted differently in the delta; diff will give me invalid results...
  11. stu78

    Delta Script

    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...
  12. stu78

    Delta Script

    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...
  13. stu78

    Split file based on delimiter

    Hi, I have some data to split; the delimiter will always be ! so I just need to format e.g. test1!test2!test3! into test1! test2! test3!
  14. stu78

    Compare two CSVs based on unique ID

    Thank you feherke!
  15. stu78

    Compare two CSVs based on unique ID

    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...
  16. stu78

    Compare two CSVs based on unique ID

    -F as in the file seperator? How would this help?
  17. stu78

    Compare two CSVs based on unique ID

    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).
  18. stu78

    Compare two CSVs based on unique ID

    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...
  19. stu78

    Load Testing

    Hi - I have tried using mail merge in MS Word - someone suggested scripting this, but I have never done this before. Any help is appreciated, Stu
  20. stu78

    Load Testing

    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...

Part and Inventory Search

Back
Top