You are here:  » Sharesale csv feeds. How to replace 'YOURUSERID'

Support Forum



Sharesale csv feeds. How to replace 'YOURUSERID'

Submitted by redspan on Mon, 2008-02-25 08:25 in

Hello,

The feeds from Sharesale are csv files containing affiliate links with the format userID=YOURUSERID, and it's necessary to replace all instances with my unique user ID, so I googled for a script that will open the file and replace all instances of YOURUSERID with my ID. Here's what I found:

find . -name 'Products.txt' |xargs perl -pi -e 's/REPLACETHISID/WITHTHISID/g'

So you can add the command after each of the decompress commands, or you can add just one command to replace all instances in all files:

find . -name '*.txt' |xargs perl -pi -e 's/REPLACETHISID/WITHTHISID/g'

But I think the individual one is neater as it's more scalable.

Regards,
Ben

Submitted by support on Mon, 2008-02-25 09:46

Hello Ben,

Thanks for your tip.

This is in fact what the Search & Replace filter was originally intended for; so anybody using shareasale.com feeds that is not able to modify the feed directly can (after registering the feed but BEFORE importing) add a new "Search and Replace" to the Buy URL field, enter "YOURUSERID" in the search box (without the quotes) and your shareasale.com user ID in the replace box. That will fix up all the URLs during import.

Cheers,
David.