How to export documents to CSV file in different format?

Hello,

I would like to export the document information to text file in this format.

First document in a view

“HEADER”,“Active”, 1234, “Customer”, “2008-07-25”

“LINE”,“Active”,”2008-07-25”, A, 2000

“LINE”, “Active”,”2008-07-25”, B, 2500

“LINE”, “Active”,”2008-07-25”, C, 3000

next document in a view

“HEADER”, “Active”, 6789, “Customer”, “2008-08-25”

“LINE”,“Active”,”2008-08-25”, A, 1000

“LINE”, “Active”,”2008-08-25”, B, 1500

“LINE”, “Active”,”2008-08-25”, C, 5000

I have a form which has the fields Status, UniqueNumber, Customer, startdate, Category and values

Category and Values are multivalue fields

Category contains values (A, B, C, D, E etc) and values for corresponding categories in Value filed.

I would like to export the values in above format to a text file. How can I achieve this?

I can do this in one line but I need it in above format. Please let me know

Thanks

Srini

Subject: RE: How to export documents to CSV file in different format?

You’re going to have to code it yourself. Pay attention to how you handle quotes in your data – you’ll need to escape them. I assume you have a spec for the format of this file that includes that information.

Subject: RE: How to export documents to CSV file in different format?

Thanks Andrei. I have the spces and will write the code by myself. All I want is a bit of logic on how to seperate the header and line. that’s all. rest evrything I can handle.

Thanks

sri

Subject: RE: How to export documents to CSV file in different format?

If you don’t expect to have any quotes (or just want to fix them yourself beforehand), you can use the Write# statement.

As for separating the data, I don’t understand what the problem is. You have a document, say, and you’re going to write certain fields once, and other fields in a loop.

Write #fn, “HEADER”, doc.Something(0), doc.TheOtherThing(0), doc.Thing3(0)

dim mv1, mv2, mv3

mv1 = doc.getitemvalue(“firstmultivaluefield”)

mv2 = doc.getitemvalue(“anothermultivaluefield”)

mv3 = doc.getitemvalue(“lastmultivaluefield”)

if mv1(0) <> “” then

Dim i%

for i = 0 to ubound(mv1)

write#fn, “LINE”, mv1(i), mv2(i), mv3(i)

Next

End If

Subject: RE: How to export documents to CSV file in different format?

Hi Andre,

Thanks for your help . I used the print and solved the issue.

sri