homepage Welcome to WebmasterWorld Guest from 54.196.203.41
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
Forum Library, Charter, Moderators: travelin cat

The Macintosh Webmaster Forum

    
Grep pattern help with BBEdit
mrblond




msg:4375034
 1:36 am on Oct 16, 2011 (gmt 0)

I've been struggling with Grep and BBEdit all day long.... I'm working with a tab-delimited file.

I'm trying to edit the 12th column "Categories>SubCategoryOne>SubCategoryTwo", leaving only the last "SubCategory#*$!" which could be the 4th or 5th SubCategory. (I'll need to replace what's left with the official Google categories later)

The lines in the CSV file look like this:

ProductLinkURL TAB ImageFileURL TAB MinimumQuantity TAB BrandName TAB IDNum TAB NEW TAB ExpDate TAB DealerName TAB PartSKU TAB ProductName TAB ProductDesc TAB MainCategory>SubCategoryOne>SubCategoryTwo>SubCategoryThree TAB ResellPrice TAB WholesalePrice TAB ShipPrice TAB TaxPrice TAB MfrPartID

I've mangled this pattern together, which finds from the beginning of each line to the 11th tab, which starts the column I need to edit:

(^(.+?\t){10})((.+?\t){1})

This pattern selects from the beginning of the line to the last > character:

(^(.+?\t){10})((.+?\t){1})(.*).>+

What I ultimately need is to select from the 10th tab character to the last > character, and delete that.

Any assistance is appreciated.

 

mrblond




msg:4375253
 11:28 pm on Oct 16, 2011 (gmt 0)

I was getting hung up on how to search with Grep - I simply had to put

/1

in the replace part of the find dialog. and the pattern worked

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved