Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5628 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a simple file with about 10 fields. The data contained needs to be exported into a .txt file.

The issue I am having is that upon export the data has quotes like this:

"manufacturer","masrp","keywords",

is there a way to get rid of those so that it would look like:

manufacturer masrp keywords

I can achieve the latter by exporting as .tab however then the end user needs to manually rename the file to .txt (that is the extension that the export file has to have) which is what I am trying to avoid.

Any pointers are welcome.

Thanks.,

Posted

Awesome, works without any problems.

Thanks a lot

Btw - can field names be exported as well?

Posted

Not directly. The merge format includes field names, but the data is comma-separated. The way to do this is by exporting as XML and using a custom stylesheet - see:

http://fmforums.com/forum/showtopic.php?tid/183442/

for something very similar.

Posted

Ok, implemented everything and all works as intended. I have however run into a small issue.

The export with the style sheet works as it needs to however I do have a description field in my table. When users enter the the text description they use enter if the description is long...

What would I need to add to the style sheet in order to filter out enter from all fields during the export?

Example: If no enter is used when inputting data the export comes out in one line as needed.

IE. This is a test export. Nicely done.

If they use enter when inputting data the export comes out like this:

IE. This is a test export.

Nicely done

Basically I do not know what to add to the style sheet in order to filter carriage returns out

The style sheet I am using is this, from the link provided by Comment, I believe it was posted by Fenton:

<?xml version='1.0' encoding='utf-8'?>



exclude-result-prefixes="fmp" version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">



	

	

	seller-id gtin isbn mfg-name mfg-part-number asin seller-sku title description main-image additional-images weight features listing-price msrp keywords product-set-id store-code category-id



		

		

			

			

			

					

					

						

							

						

						

							



						

						

						

					

								

		

		

	

Posted (edited)

You can use functions in your stylesheet to process the data. To "substitute" carriage returns with spaces, use the translate function, e.g.

You'd probably want to "trim" the result by using the normalize-space function so:

NOTE:

Replace [color:red]CR and [color:red]space with the corresponding character codes, or the actual characters.

Edited by Guest
Posted

Thank you kindly.,

It works without an issue now.

Posted (edited)

Yep, I hit an issue again. The file itself is working ok and all looks in order. However when I upload the exported file to the server, I get an error. It is basically telling me that the file failed due to the number of columns not being correct.

They require the file for the upload to be UTF-8, tab delimited.

Is there a difference between xsl and tab delimited exports?

When I export via xsl I get the error as described above. If I export via tab delimited file and manually type in the column headers I do not get the error.

I hard coded column names in xsl, I separated the columns via actual tab, I also tried

	

between columns and it still gave me the same error.

Any suggestions as to what might be wrong?

I can post exported files so they can be compared if needed.

Thanks.

Edited by Guest
Forgot to enclose the tab char in code.

This topic is 5628 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.