wildblue 4 #1 February 9, 2007 We've got enough geeks on here, I thought I'd ask - I have a text file with a series of dates: date1 date2 date3 date4 and I want to turn it into date1,date2,date3,date4 (need to insert the ',' as well) I was thinking a "for /F" statement might do what I want. It might even get rid of the leading and trailing spaces on each line (using sed to do that now) Ideas?it's like incest - you're substituting convenience for quality Quote Share this post Link to post Share on other sites
unformed 0 #2 February 9, 2007 download a free c++ compiler and it'll be really really simple .... cin >> date1 >> date2 >> date 3 >> date4; cout <in some kind of while loopThis ad space for sale. Quote Share this post Link to post Share on other sites
seekfun 0 #3 February 9, 2007 Or, make it profoundly simple. Copy and paste your list into Microsoft Word. Then, use the Find->Replace feature to seek out every carriage return (or paragraph character) and replace it with ", ". I just tried this in Word and it worked just fine. Misbehave! ~ topher"...there is a there out there..." - Tom Robbins Quote Share this post Link to post Share on other sites
wildblue 4 #4 February 9, 2007 QuoteOr, make it profoundly simple. Copy and paste your list into Microsoft Word. Then, use the Find->Replace feature to seek out every carriage return (or paragraph character) and replace it with ", ". If you can automate that with a batch file, I'd be hella impressed. unformed - it's already part of a larger batch file, I could do it with perl or something pretty easily too, I'm just trying to use what's already there.it's like incest - you're substituting convenience for quality Quote Share this post Link to post Share on other sites
seekfun 0 #5 February 9, 2007 So, there are multiple files, each with multiple rows of dates?"...there is a there out there..." - Tom Robbins Quote Share this post Link to post Share on other sites
wildblue 4 #6 February 9, 2007 QuoteSo, there are multiple files, each with multiple rows of dates? No, but it needs to be done at 4am everyday, and I'd rather not wake up to do it.it's like incest - you're substituting convenience for quality Quote Share this post Link to post Share on other sites
PhreeZone 15 #7 February 9, 2007 They pay you enough that you should be willing to wake up and do it by hand. What language is the original batch in?Yesterday is history And tomorrow is a mystery Parachutemanuals.com Quote Share this post Link to post Share on other sites
seekfun 0 #8 February 9, 2007 http://www.roumazeilles.net/ygrep/ygrep.php If you can't convince your significant other to wake up at 4AM to do this for you, then mash on the link above and do some digging. This is a program that can be installed and run from the command line. It allows you to perform search/replace functions from the command line (and therefore from batch files). This will require you to tinker with regular expressions a little bit, but the functionality you're working towards is not on the rocket-science end of the regular expression spectrum (which is good because regexs get confusing quickly). Good luck, topher"...there is a there out there..." - Tom Robbins Quote Share this post Link to post Share on other sites
wildblue 4 #9 February 9, 2007 QuoteThey pay you enough that you should be willing to wake up and do it by hand. What language is the original batch in? The fuck they do. English. Anyway, the db guy finally figured out how to get the dates out as date,date,date - so I don't have to do it anymore. I just have to s/^[ ]*//;s/[ ]*$// and life should be good it's like incest - you're substituting convenience for quality Quote Share this post Link to post Share on other sites