Simplicty and flexibility!


Exporting Data


Started by steve Turnbull
Search
You will need to Sign In to be able to add or comment on the forum!

Exporting Data

Download: IMG_0999.jpg

Hi, I am trying to export data into excel using .csv. it seems to run ok but it isnt appearing as it should. Part of the numbers are taken from one column and put at the end of the other as pictures show. 


Written by steve Turnbull 22/05/23 at 16:44:38

Re:Exporting Data

Written by steve Turnbull 22/05/23 at 16:50:19

Re:Re:Exporting Data

To be honest, I'm more impressed that some of the numbers end up in a separate column...

What is your field separator? 

From when we can see you basically send it all as one string.

Calling fields 1,2,3,4 etc. is not advisable either.


Written by DataEase 22/05/23 at 17:54:21

Re:Re:Re:Exporting Data

hi,

for csv files, normally if you choose " as text delimiter solves the issue.

kind regards

Josef


Written by Josef Vella 22/05/23 at 18:01:16

Re:Re:Re:Exporting Data

tbh, I have called the fioelds different names to try and solve the problem. 


Written by steve Turnbull 23/05/23 at 08:06:51

Re:Re:Re:Re:Exporting Data

Where would I insert " as text delimiter in the DQL?


Written by steve Turnbull 23/05/23 at 08:09:01

Re:Re:Re:Exporting Data

Where would I put a field separator in DQL


Written by steve Turnbull 23/05/23 at 08:23:08

Re:Re:Re:Re:Exporting Data

Tab is normally the most convenient field separator, unless you wat to use any comma (,) or any other character.

Create a variable to hold the 'Tab' value

define "tTab" Text .

tTab := "  "   .  (make sure there is a tab between the quotes)

tTab can be listed and referred to in the export like any field

Put tTab in the export between each field required to be in a new column (not at the beginning or end of line) .


Written by Sam Bird 23/05/23 at 10:34:49

Re:Re:Re:Re:Re:Exporting Data

Download export.csv
Excel will import directly if you have "around" the values and , (comma) as separator.

WHat you do with the .export is to create a text file so you can format it as you please.

.items
etc
"1 VAT Due in this period on sales","@f[1,3]"
"2 VAT Due in this period on EC acquisitions","@f[1,4]"
etc

.end

You can do any other formatting you please to.

<html>

<table>

<tr>
<td>1 VAT due on in this period on sales</td><td>@f[1,3]</td>
</tr>
</table>

</html>

Try to download the above file and open it in Excel. You will see it formats correctly immediately.


Written by DataEase 23/05/23 at 12:40:28

Re:Re:Re:Re:Re:Re:Exporting Data

Fantstic help as always, works great now :-)


Written by steve Turnbull 23/05/23 at 13:35:50
DG3_ForumList