Solved

I want to import address data

Posted on 2000-05-11
6
233 Views
Last Modified: 2013-12-18
I am using Notes 4.6.  We have several .csv files that contain address data (the fields and field names are unique in each .csv file).  I would like to be able to import each file into my persaonl address book and into a particular category.  To further complicate matters I wuld also like the ability to either append or overwrite any data that already exists in that given category.  Is this easily doable?
0
Comment
Question by:Kuba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2802962
Hi

You can do that by using script only, there is no other way to achieve this easily.

If I am correct are you looking for sample code.???

~Hemanth
0
 

Author Comment

by:Kuba
ID: 2808551
I guess I am looking for code or some direction.  Assuming the answer is that I can do what i want I then need to know *how* to do it.

0
 

Accepted Solution

by:
sunvanitha earned 100 total points
ID: 2816556
Dear Kuba,

This can be done through scripts. First you can archive all the details in the existing address book through the archivedatabase method in lotusscript. This will archive the database(documents created with any specific forms) and then you can create a button in the address book and run an agent in the click event of the button. The agent will open the csv file and then using the input# statement of lotusscript store every value in a separate variable and then you can set doc.form to any form that you want to store the data and then create the document by using the createdocument method. You can find a good example of how to read the .csv file by looking through the notes help under the example for the "open statement". Cut and paste the example in the agent and then change the necessary details and try running it.

I have done the same task myself and it works fine. Hope you are successful in doing this.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:sunvanitha
ID: 2819934
Code to archive database

Dim archiveDb As New NotesDatabase( "", "" )
Dim doc  As NotesDocument
If ( doc.Form= "Person" ) Then
  Call doc.CopyToDatabase( archiveDb )
End If

Code for the agent that reads the csv file

Type RecType
   empId As Double
   employee As String
End Type      
Dim arrayOfRecs() As RecType
Dim txt As String
Dim fileNum As Integer
Dim counter As Integer
Dim countRec As Integer
fileNum% = FreeFile()
counter% = 0
Open "c:\My Documents\Test.csv" For Input As fileNum%
Do While Not EOF(fileNum%)
      Line Input #fileNum%, txt$
      counter% = counter% + 1
Loop
Seek fileNum%, 1
ReDim arrayOfRecs(1 To counter%)
For countRec% = 1 To counter%
   Input #fileNum%, arrayOfRecs(countRec%).employee$, _
      arrayOfRecs(countRec%).empId#
Employee=arrayofRecs(countRec%).employee$
EmpId=arrayofRecs(countRec%).empId#
dim newdoc as notesdocument
newdoc.form="Person"
newdoc.Firstname(0)=Employee
set newdoc=db.createdocument
call newdoc.save(true,true)
Next
Close fileNum%
Print arrayOfRecs(2).employee$ & " " arrayOfRecs(2).empId#


Hi Kuba,

I have written the code for the agent too. All the best.
0
 

Author Comment

by:Kuba
ID: 2835341
Wow that looks great!  Of course I don't understand much of it :)

I'd like to keep the question open a bit in case I have implementation problems (I assume I have to modify the script for my environment). If I don't get around to this soon I'll close out the question with this as the answer.
0
 

Author Comment

by:Kuba
ID: 2885467
Answer accepted
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question