Results 1 to 14 of 14
  1. #1
    Ms Dumb Ass ... but, *NOT* Today! westgroup's Avatar
    Join Date
    January 18th, 2005
    Location
    State of Perpetual Confusion
    Posts
    471
    Changing Pipe delimited to CSV or tab
    The program that I work data feeds with does not work with pipe delimited feeds, only csv or tab delimited.

    I have no problems changing some of the feeds over but there are some that I just can't crack.

    Is there a consistant way (or program) that will allow me to change any pipe to a tab?

    Thanks!!

  2. #2
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    The simple way, open the feed (Notepad, Wordpad, etc) and find and replace.

    The program I live and die by to do my search and replacing, though, is Actual Search and Replace. The only aggravating thing, with tabs, is you can't just hit the Tab key in the replace field. You'd have to make a tab in something that recognizes it (like Notepad) copy that tabbed area and paste it in.

    But as simple as that program makes my life, I can overlook that.

    Or, write (or find) a PHP script that will read the file, do a search/replace, and spit the results out to the screen or back to a file.

    There's a variety of options...Not sure what exactly you're looking for.

    Shawn Kerr (.com) | Disney World | SEC Football

  3. #3
    I like traffic lights
    Join Date
    January 18th, 2005
    Location
    Southern hemisphere - away from Fukushima
    Posts
    2,936
    s/|/\t/g

  4. #4
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I found this free program CSVed very good for doing just that.
    http://home.hccnet.nl/s.j.francke/software/software.htm
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  5. #5
    Ms Dumb Ass ... but, *NOT* Today! westgroup's Avatar
    Join Date
    January 18th, 2005
    Location
    State of Perpetual Confusion
    Posts
    471
    Gordon,

    I currently use CSVed but still have a hard time with a few of the (Shareasale)feeds.
    Have you had any problems with any of them or am I just a dunce?

  6. #6
    Member ripe's Avatar
    Join Date
    January 18th, 2005
    Posts
    141
    Perl module Text::CSV_XS should solve your problem.

  7. #7
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Heh Drewbert, I doubt many people will understand your suggestion.
    Hatred stirs up strife, But love covers all transgressions.

  8. #8
    Not Verif-Lidated infoTim's Avatar
    Join Date
    January 18th, 2005
    Location
    Sunny Florida
    Posts
    1,021
    Made perfect sense to me.
    Tim
    consultant by day, affiliate by night

  9. #9
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    Grab a copy of OpenOffice.org - it will parse any sane csv file, allowing you to choose the delimiters to use either from a list of top choices or by inputting your own, then allow you to save (export) it using a different delimiter format.

  10. #10
    Ms Dumb Ass ... but, *NOT* Today! westgroup's Avatar
    Join Date
    January 18th, 2005
    Location
    State of Perpetual Confusion
    Posts
    471
    Thanks!!

  11. #11
    Newbie
    Join Date
    May 13th, 2005
    Location
    UK
    Posts
    11
    Hi,

    A simple script would be something like;

    Code:
    #!/usr/bin/perl
    
    use strict;
    
    my $file = '/full/path/to/file.pipe.file';
    open(READIT,$file) || die "Cant read $file. Reason: $!";
    open(WRITEIT,">$file.new") || die "Cant read $file. Reason: $!";
     while (<READIT>) {
        s/\|/\t/sig;
        print WRITEIT $_;
     }
    close(WRITE)
    close(READIT);
    
    print "DONE!!!";
    Hope that helps.

    Cheers

    Andy

  12. #12
    Member
    Join Date
    January 18th, 2005
    Posts
    56
    I'm with drewbert on this one... definitely the way to go.

  13. #13
    Crazy like a fox suzigeek's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,096
    I always change the .csv to .txt on my shareasale feeds and then open them in excel to tweak them to fit my db structures. I've had problems with some of the feeds in their native format but for some reason they work as a .txt file.(I then resave them as .csv)

    Someday I'll get to the point of automating things.
    Suz~~GearGirl~~

  14. #14
    Newbie
    Join Date
    January 18th, 2005
    Location
    Chandigarh, India
    Posts
    20
    Yes, import them into excel and save them as CSV, and you have a tab delimited file

  15. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Pipe Delimited to Comma Separated
    By knight01 in forum Programming / Datafeeds / Tools
    Replies: 12
    Last Post: March 30th, 2014, 01:57 AM
  2. Pipe delimited Datafeed To MySQL
    By nick_mayhem in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: September 18th, 2006, 09:56 AM
  3. Which datafeed format results in the fewest errors: Tab, CSV, or Pipe?
    By Kadence in forum Commission Junction - CJ
    Replies: 9
    Last Post: April 30th, 2005, 04:17 AM
  4. Pipe delimited to tab
    By bbb in forum Programming / Datafeeds / Tools
    Replies: 10
    Last Post: August 30th, 2004, 06:03 AM
  5. tab or pipe delimited format in a .csv
    By hershey in forum Programming / Datafeeds / Tools
    Replies: 2
    Last Post: July 17th, 2002, 08:52 AM

Posting Permissions

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