0

I am looking for a way to replace variable text in large text file in TextWrangler.

Here is an example of text that I am starting with:

144:           FTLF8529P3BCV-CS  
22492:         TRS2200SN-000C  
24524:         SFBR-5780APZ-CS2  
26538:         FTLF1428P2BNV-CS  
30916:         TRS7250SN-S103  

And I want to replace it into following:

FTLF8529P3BCV-CS  
TRS2200SN-000C  
SFBR-5780APZ-CS2  
FTLF1428P2BNV-CS  
TRS7250SN-S103  

Is there a find and replace option that will allow me to do this?

I tried inbuilt grep function, but it does not seem to be working correctly for me. The original text that I am trying to modify is slightly different then above.

It looks like this:

untitled text 16:144:Vendor PN FTLF8529P3BCV-CS
untitled text 16:22492: Vendor PN TRS2200SN-000C
untitled text 16:24524: Vendor PN SFBR-5780APZ-CS2
untitled text 16:26538: Vendor PN FTLF1428P2BNV-CS
untitled text 16:30916: Vendor PN TRS7250SN-S103

So I tried grep find on "untitled text 16**Vendor PN " but that did not work. I got syntax error.

Here is the full error message:

The search cannot proceed, because of a syntax error in the Grep pattern: nothing to repeat (application error code: 12209).

I tried this, and it works:

untitled text 16:[0-9]*: Vendor PN [ ]*\

Thanks!

Himanshu
  • 1
  • 2
  • please share what you have done so far to try and resolve this problem – TommySM Oct 13 '15 at 20:46
  • Welcome to Stack Overflow. I have marked up your text data by adding 4 spaces to it. This has the side-effect of preserving your spaces so that it looks aligned. Please edit you post and list anything you have tried so far. – Rohit Gupta Oct 13 '15 at 22:42

1 Answers1

0

Go to text wrangler and under the search tab, choose Multi File Search. You will notice that a checkbox called Grep is probably checked. Uncheck that box and it should work.