post #1 of 1
Thread Starter 
Probably not the right place to put this, i didn't see anywhere better though...

I'm looking to sort out ebay item numbers, 12 digit numbers from a text file, to make a csv for my auction sniping software. i'm trying to automate this as much as possible, with me just dumping a bunch of links into a text file and with it ideally spitting out a document with only the item numbers in each line. i'm using sed for windows.
:: sort out only the ebay links
findstr "............?pt" links.txt > 1.txt
:: sort out the doubles
sed "$!N; /^\(.*\)\n\1$/!P; D" 1.txt > 2.txt
:: change the -/ preceeding and ?pt after the item number to spaces
sed "s/?pt/ /g"  2.txt >3.txt
sed "s@-/@ @g"  3.txt >4.txt

with this solution i dump all my links into links.txt and it spits out a file with spaces before and after the auction number, so openoffice sees it as a space seperated csv and i just delete the first and third column leaving me with only item numbers. i've been trying to find a way to sort out the numbers easier, and then add my bid into them, but i haven't been able to get sed to spit out just the number. I think the regex of my numbers is
but i haven't been able to get sed to spit out just that part of the line. it would be very appreciated if someone had some insight as to a better way to sort out the numbers(and possibly add some csv values after the number)