An odd issue with the export > APPEND data


#1

Couple of things, first, I'm having an issue when I export data a second time to the same file, it is adding a funky "y" to the prepended data.

Second, is there way to prevent the fixed constants from being exported more than once? Row 1 is the master row for all the other rows 2>infinity.....I don't need the row one repeated over and over......is there a way to trap on that if exists don't append? I only want row 1 once, and all append data in sequential row below.

I've attached the images here for issue 1....hopefully someone can help with issue 2.

thanks!


#2

You would need a second report definition that does not have the line with output text before the $loop statement.


#3

I do not know if I understand the problem in the right way.
You should show us your report script.
At 1.
Perhaps the one and only leading BOM has been added again when appending further text to an existing text file?
At 2.
See manual how the function $loop is explained.
There is a parameter, which controls whether the loop should be run only once resp. as many as items exists.
Loops can be applied nested.

DD.20120816.0812.CEST


#4

The image shows the "Y" with 2 dots over it when the I do a second export and MP3TAG is appending to the document. I don't think that should be there as it's not part of my tag structures. I will take another look at the $loop features and see if I can figure out the "only export the first line once issue"....right now its a continuous loop for all files. Here is the export code:

$filename(csv,utf-8)product_sku     product_name     category_path     product_desc     published     product_s_desc     product_price     product_override_price     max_order_level     min_order_level     product_in_stock     file_url     file_url_thumb     product_params
$loop(%_path%)$replace($left(%ARTIST%,1)$left(%initialkey%,2)$left(%BPM%,2)$left(%ALBUM%,3)$left(%YEAR%,4)$left(%TITLE%,4)$num(%_counter%,6), ,X,',',X,'(',X,')',X,'%',X,'',X,.,X,-,X,'$',X,!,X,#,X,&,X,~,X,^,X,|,X)     %artist%--%title%    $if($isdigit($left(%ARTIST%,1)),ABP Alphabetical Music List/NUMBERS,ABP Alphabetical Music List/$upper($left(%ARTIST%,1)))     %artist%--%title%--%album%--%year% (Artist, Title, Album, Year)      1     %year%     0.00001     0.00001     5     1     10000000    images/stories/virtuemart/product/$lower($replace(%artist%-%title%-%album%-%track%-$left(%ARTIST%,1)$left(%initialkey%,2)$left(%BPM%,2)$left(%ALBUM%,3)$left(%YEAR%,4)$left(%TITLE%,4),$,S,#,X,'%', percent,!,X,?,X,", inch,:,X,/,X,\,X)-FRONT COVER.jpg)    images/stories/virtuemart/product/$lower($replace(%artist%-%title%-%album%-%track%-$left(%ARTIST%,1)$left(%initialkey%,2)$left(%BPM%,2)$left(%ALBUM%,3)$left(%YEAR%,4)$left(%TITLE%,4),$,S,#,X,'%', percent,!,X,?,X,", inch,:,X,/,X,\,X)-FRONT COVER_90x90.jpg)    min_order_level="0"|max_order_level="0"|
$loopend()

#5

I just want to add, while this may look like I am reselling MP3 files through an online store I am not. I am using virtualmart for Joomla! I can provide info for the site login if you need to see for yourself. I've hacked the crap out of it to be an online playlist generator......nothing more.

Thanks


#6

Do you happen to have an example of this? I can't find anything in the forums or I'm not searching it correctly.

Thanks


#7

If you have a look at the example you supplied in post #4

$filename(csv,utf-8)product_sku     product_name     category_path     product_desc     published     product_s_desc     product_price     product_override_price     max_order_level     min_order_level     product_in_stock     file_url     file_url_thumb     product_params
$loop(%_path%)$replace($left(%ARTIST%,1)$left(%initi .....

you simply leave out the part between filename and $loop:

$filename(csv,utf-8)
$loop(%_path%)$replace($left(%ARTIST%,1)$left(%initi....

as that line that I now left out is nothing but plain text to supply the column headers.


#8

I actually need the first row for the delimiter import. So I'd have to then insert a row and them try to paste those values in.

Is there a way for the loop to look and see if there is data in the first cell and if so, skip that initial population, and then just do a second loop and append the data?

My biggest concern with the append part is the "Y" with the two dots over it.....that is repeatable on every append of the document.


#9

The delimiter is also between the variables - the text at the beginning could be left out if you want to append.

Either you are in the loop or not. Any export does not know anything about other exports you have done before.

You should look at the text document you have created as it looks to me as if the definition has an incomplete line.
if you enter a $chr(13)$chr(10) after the last $loop() then you might get an extra line but I hope the "y" will disappear.


#10

This looks like a byte order marker. You can disable it at Options > Export
You need it when a new file is written to indicate the text encoding, but when you append data it should be omitted.
Unfortunately the program doesn't do it automatically.


#11

Turning off write BOM did the trick to get rid of the Y issue

Thanks!