IPB

Welcome Guest ( Log In | Register )

> Notice!

Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.

Also make sure you've read the Forum Guidelines before posting in this forum.

 
Reply to this topicStart new topic
> An odd issue with the export > APPEND data
kittmaster
post Aug 15 2012, 23:07
Post #1


Member


Group: Full Members
Posts: 81
Joined: 14-September 10
From: Providence RI
Member No.: 12931
Mp3tag Version: 2.52



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!








Go to the top of the page
 
+Quote Post
ohrenkino
post Aug 16 2012, 06:11
Post #2


Member


Group: Full Members
Posts: 4753
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.65



ZITAT
Second, is there way to prevent the fixed constants from being exported more than once?

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


--------------------
42 - wie war die Frage / what was the question / comment était la question
Go to the top of the page
 
+Quote Post
DetlevD
post Aug 16 2012, 07:12
Post #3


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (kittmaster @ Aug 16 2012, 00:07) *
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? ...

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


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
kittmaster
post Aug 16 2012, 13:15
Post #4


Member


Group: Full Members
Posts: 81
Joined: 14-September 10
From: Providence RI
Member No.: 12931
Mp3tag Version: 2.52



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:

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()


Go to the top of the page
 
+Quote Post
kittmaster
post Aug 16 2012, 13:23
Post #5


Member


Group: Full Members
Posts: 81
Joined: 14-September 10
From: Providence RI
Member No.: 12931
Mp3tag Version: 2.52



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

Go to the top of the page
 
+Quote Post
kittmaster
post Aug 21 2012, 18:40
Post #6


Member


Group: Full Members
Posts: 81
Joined: 14-September 10
From: Providence RI
Member No.: 12931
Mp3tag Version: 2.52



QUOTE (ohrenkino @ Aug 16 2012, 01:11) *
You would need a second report definition that does not have the line with output text before the $loop statement.


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




Go to the top of the page
 
+Quote Post
ohrenkino
post Aug 21 2012, 19:37
Post #7


Member


Group: Full Members
Posts: 4753
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.65



ZITAT(kittmaster @ Aug 21 2012, 19:40) *
Do you happen to have an example of this?

If you have a look at the example you supplied in post #4
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(%initi .....

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

CODE
$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.


--------------------
42 - wie war die Frage / what was the question / comment était la question
Go to the top of the page
 
+Quote Post
kittmaster
post Aug 21 2012, 20:55
Post #8


Member


Group: Full Members
Posts: 81
Joined: 14-September 10
From: Providence RI
Member No.: 12931
Mp3tag Version: 2.52



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.

This post has been edited by kittmaster: Aug 21 2012, 20:56
Go to the top of the page
 
+Quote Post
ohrenkino
post Aug 21 2012, 21:12
Post #9


Member


Group: Full Members
Posts: 4753
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.65



ZITAT(kittmaster @ Aug 21 2012, 21:55) *
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.

The delimiter is also between the variables - the text at the beginning could be left out if you want to append.
ZITAT(kittmaster @ Aug 21 2012, 21:55) *
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?

Either you are in the loop or not. Any export does not know anything about other exports you have done before.
ZITAT(kittmaster @ Aug 21 2012, 21:55) *
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.

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.

This post has been edited by ohrenkino: Aug 21 2012, 21:13


--------------------
42 - wie war die Frage / what was the question / comment était la question
Go to the top of the page
 
+Quote Post
dano
post Aug 21 2012, 21:28
Post #10


Moderator


Group: Moderators
Posts: 5688
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65



QUOTE (kittmaster @ Aug 21 2012, 21:55) *
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.

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.


--------------------
Go to the top of the page
 
+Quote Post
kittmaster
post Aug 22 2012, 02:37
Post #11


Member


Group: Full Members
Posts: 81
Joined: 14-September 10
From: Providence RI
Member No.: 12931
Mp3tag Version: 2.52



QUOTE (dano @ Aug 21 2012, 16:28) *
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.


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


Thanks!

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th October 2014 - 07:58