Results 1 to 2 of 2
  1. #1
    Full Member
    Join Date
    January 18th, 2005
    Posts
    480
    Here is a little perl script I use to help "clean" my datafeed. If you have a merchant you do not like, but takes a lot of space up in your datafeed, you can use this snippet of perl code to get rid of it.

    You name the file "cutter.pl" and put the code you see below in it. Where it says "ecampus", you can replace that with the domain name of a merchant you do not like. You must name your datafeed text file "cj.txt" and the script will make a file called "cj.small" for you, with the merchant removed. In the case below, I removed ecampus because their datafeed is over 250 megabytes and is useless. This script works without having to open the cj file in notepad (or vi) to do a search and replace.



    #!/usr/bin/perl -w


    open(FILE, ">cj.small") || die "I can't open the output file file!\n";

    open(FILE1, "cj.txt") || die "I can't open cj.txt\n";
    while(<FILE1&gt {
    unless (/ecampus/){
    print FILE;}

    }
    close(FILE1);

    close(FILE);

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Posts
    480
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Witness:
    Here is a little perl script I use to help "clean" my datafeed. If you have a merchant you do not like, but takes a lot of space up in your datafeed, you can use this snippet of perl code to get rid of it.

    You name the file "cutter.pl" and put the code you see below in it. Where it says "ecampus", you can replace that with the domain name of a merchant you do not like. You must name your datafeed text file "cj.txt" and the script will make a file called "cj.small" for you, with the merchant removed. In the case below, I removed ecampus because their datafeed is over 250 megabytes and is useless. This script works without having to open the cj file in notepad (or vi) to do a search and replace.



    #!/usr/bin/perl -w


    open(FILE, "&gt;cj.small") || die "I can't open the output file file!\n";

    open(FILE1, "cj.txt") || die "I can't open cj.txt\n";
    while(&lt;FILE1&gt; ){
    unless (/ecampus/){
    print FILE;}

    }
    close(FILE1);

    close(FILE);<HR></BLOCKQUOTE>

  3. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: July 29th, 2010, 11:38 AM
  2. FreeStuff: Unique website script to import datafeeds
    By onlinehelp321 in forum Midnight Cafe'
    Replies: 2
    Last Post: July 16th, 2009, 01:03 AM
  3. Visual Basic script: import ShareASale datafeeds to SQL Server
    By markwelch in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: March 11th, 2007, 03:53 PM
  4. FTP Script for Linkshare Datafeeds
    By ehorse01 in forum Rakuten LinkShare - LS
    Replies: 3
    Last Post: August 21st, 2006, 06:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •