Re: Column insert on uneven lines
At 13:31 -0600 6/6/10, LuKreme wrote, and I snipped a bit: Something I do quite a bit is take a file like this: file1.txt file2.txt file3.txt and a file likes this: Fred George Alex and convert it to mv file1.txt a long filename - 1 - Fred.txt mv file3.txt a long filename - 2 - George.txt mv file3.txt a long filename - 3 - Alex.txt I do this by running one search replace, and then doing a column insert right before the .txt of the list of names. This works great and I have no problems with it, unless the filenames are of differing lengths: fileone.txt filethree.txt filefourteennintytwo.txt and I end up with mv fileone.txt fileone - .txt mv filethree.txt filethree - .txt mv filefourteennintytwo.txt filefourteennintytwo - .txt and I can no long insert the lines from the second file into the appropriate place in this file. Where I need to insert the names may change depending on what I am working with, and it could be in the middle of a long file name like mv 2010-05-27 AM.txt 2010 Annual Meetings Notes - George - 20100527.txt mv IT meeting 2010 04 17 2010 IT Meeting Note - Alex - 20100417.txt I have had problems like that since I first started with BBedit. That was when I could no longer use MPW on OS neXt. The answer to my request for tab stops like a typewriter has always generated the response If you need a WORD processor, use one. All I want is the equivalent of an 026 card punch. I typically use an Excel spreadsheet as a text editor for what you're talking about. It does understand the ASCII tab character. Another option is Nisus 5.1 or earlier for OS 9 and below. Yet another option is to become fluent with perl. After the learning curve what you're doing will seem simple and it can do the mv command without worrying about a bbedit worksheet or a separate terminal session. -- -- Halloween == Oct 31 == Dec 25 == Christmas -- -- You received this message because you are subscribed to the BBEdit Talk discussion group on Google Groups. To post to this group, send email to bbedit@googlegroups.com To unsubscribe from this group, send email to bbedit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/bbedit?hl=en If you have a feature request or would like to report a problem, please email supp...@barebones.com rather than posting to the group.
Re: Column insert on uneven lines
Well, for 15 chars from end of line you could use regexp (grep in the find/replace dialog). Here's a crude example ([\w\W]{15})$ Then replace what's found with: newstuff\1 The \1 is what is captured in the regexp. -Kendall On Jun 6, 3:31 pm, LuKreme krem...@kreme.com wrote: Something I do quite a bit is take a file like this: file1.txt file2.txt file3.txt and a file likes this: Fred George Alex and convert it to mv file1.txt a long filename - 1 - Fred.txt mv file3.txt a long filename - 2 - George.txt mv file3.txt a long filename - 3 - Alex.txt I do this by running one search replace, and then doing a column insert right before the .txt of the list of names. This works great and I have no problems with it, unless the filenames are of differing lengths: fileone.txt filethree.txt filefourteennintytwo.txt and I end up with mv fileone.txt fileone - .txt mv filethree.txt filethree - .txt mv filefourteennintytwo.txt filefourteennintytwo - .txt and I can no long insert the lines from the second file into the appropriate place in this file. Where I need to insert the names may change depending on what I am working with, and it could be in the middle of a long file name like mv 2010-05-27 AM.txt 2010 Annual Meetings Notes - George - 20100527.txt mv IT meeting 2010 04 17 2010 IT Meeting Note - Alex - 20100417.txt getting the files to the point where I can then insert the names is not a problem I have processes and searches to do all that, the only issue is not being able to do the column paste because the lines don't line up. Since I am moving to a standard filenaming convention, the RIGHT side (the target name) is always going to be the same length (up until I paste in the names) so if there was some way to right justify all the lines quickly or to do a column insert at '15 characters from end of line that would sort me out. Or is there something else I am missing? (SOMETIMES I can use prefix/postfix lines, but often that is not so easy) -- I hope someday you know the indescribable joy of having children, and of paying someone else to raise them. -- You received this message because you are subscribed to the BBEdit Talk discussion group on Google Groups. To post to this group, send email to bbedit@googlegroups.com To unsubscribe from this group, send email to bbedit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/bbedit?hl=en If you have a feature request or would like to report a problem, please email supp...@barebones.com rather than posting to the group.
Re: Column insert on uneven lines
On 6-Jun-2010, at 20:11, Kendall Conrad wrote: Well, for 15 chars from end of line you could use regexp (grep in the find/replace dialog). Here's a crude example ([\w\W]{15})$ Then replace what's found with: newstuff\1 Oh, well, now I feel stupid. Why didn't I think of that? -- I leave symbols to the symbol-minded - George Carlin -- You received this message because you are subscribed to the BBEdit Talk discussion group on Google Groups. To post to this group, send email to bbedit@googlegroups.com To unsubscribe from this group, send email to bbedit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/bbedit?hl=en If you have a feature request or would like to report a problem, please email supp...@barebones.com rather than posting to the group.