Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1486
  • Last Modified:

lotus notes, attachment and export

Hello,
 How do I export a view to a comma delimited file (for example .csv file). Also, The documents in this view have attachments how do I download those files to a directory.

thanks in advance for any help.

0
premtemp
Asked:
premtemp
  • 2
  • 2
3 Solutions
 
scottrmaCommented:
The easiest way to do that would be to export the view to Lotus 1-2-3 worksheet format. Choose File -> Export and then select 1-2-3 Worksheet as the type in the drop down list, then name the file with a .wk4 extension. You can then use MS Excel to open the file, and from Excel you can choose File -> Save As, and save it in CSV format.

You could also write a LotusScript agent to export the view directly to a CSV file, but you would also have to write a subroutine in your agent to replace any commas that might be found in your view data with some other character of your choosing (since the file is to be COMMA-delimited, that would mean that commas within the actual data itself would screw up the alignment of columns, so they must be replaced with another character - commas would only be allowed to separate data fields themselves).

Hope this helps.

Scott
0
 
qwaleteeCommented:
The tabdelimited format might also be useful.

One problem with spreadhseet/text eport of views is that multi-value fields export oddly.  If a row in a view/folder contains no multi-value items, it exports as a single line/row.  If it has, say, a multivalue field with three values, and a bunch of single-value fields, then the row exports as three lines or rows.  The firts line is filled, the seocnd and third lines only contains values in the column for the multivalue field.

I typically write a fairly simple, generic export script that can be used with most any view for this sort of situation.
0
 
scottrmaCommented:
Also, here is a good script to export any view directly to Excel, from which you could then save it as a CSV file:

http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/e8404780fc839de488256aa40072bb9a?OpenDocument

Regards,

Scott
0
 
ChrisLeeMarshallCommented:
here's a script I use to detach ID files from person documents. Should be able to modify this to detach all to a directory :

        Dim Sess As New NotesSession
     Dim db As NotesDatabase    
     Dim doc As NotesDocument
     Dim DataDirectory, shortname As String
     Dim view As NotesView
     Dim object As NotesEmbeddedObject
     
     Set db = sess.CurrentDatabase
        'pick view from database
     Set view = db.GetView("People")    
     
     DataDirectory = Sess.GetEnvironmentString("Directory",True)
     
     Set doc = view.GetFirstDocument  
     
     While Not (doc Is Nothing)
          shortname = doc.Shortname(0)
          Set object = doc.GetAttachment( "UserID" )
         
          If (object Is Nothing) Then
               Print "No ID attached"              
          Else
                                    'Replace independent with a subdirectory of the DATA directory
               Call object.ExtractFile(DataDirectory & "\\independent\\" & shortname & ".id")
               Call object.Remove
               Call doc.Save( True, True )
          End If
          Set doc = view.GetNextDocument( doc )
     Wend
0
 
ChrisLeeMarshallCommented:
here's a script I use to detach ID files from person documents. Should be able to modify this to detach all to a directory :

        Dim Sess As New NotesSession
     Dim db As NotesDatabase    
     Dim doc As NotesDocument
     Dim DataDirectory, shortname As String
     Dim view As NotesView
     Dim object As NotesEmbeddedObject
     
     Set db = sess.CurrentDatabase
        'pick view from database
     Set view = db.GetView("People")    
     
     DataDirectory = Sess.GetEnvironmentString("Directory",True)
     
     Set doc = view.GetFirstDocument  
     
     While Not (doc Is Nothing)
          shortname = doc.Shortname(0)
          Set object = doc.GetAttachment( "UserID" )
         
          If (object Is Nothing) Then
               Print "No ID attached"              
          Else
                                    'Replace independent with a subdirectory of the DATA directory
               Call object.ExtractFile(DataDirectory & "\\independent\\" & shortname & ".id")
               Call object.Remove
               Call doc.Save( True, True )
          End If
          Set doc = view.GetNextDocument( doc )
     Wend
0

Featured Post

Independent Software Vendors: 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!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now