How to separate Text Code

Asked

Viewed 581 times

0

Hi person good afternoon all right?

I have a question I’d like to know if you can assist me, please:

I have a file . txt , which contains more than 1000 lines, I need to separate the code from the text.... I explain myself better with the example :

CO123456= texto1      (Primeira Linha )
CO123457= texto2      (Segunda Linha )    
CO123458= texto3      (Terceira Linha )

need to eliminate ( CO123456=, CO123457= and CO123458=) that is to stay texto1, texto2 and texto3 .... being like this :

texto1      (Primeira Linha )
texto2      (Segunda Linha )    
texto3      (Terceira Linha )

I tried to do this with " Replace " mode in Excel only I could not... because I had some lines that had many equal signs (=) so I eliminated the whole sentence.

Any suggestions?

  • 1

    I think with regex all right, I don’t know if Notepad supports replace with regex, but I believe it solves: CO[0-9]{6}= ? This assuming all codes start with CO followed by 6 numbers

  • If your question is about using Notepad++, I am sorry to inform you that this site is not the right place to post it. If, on the other hand, you wrote a code in VBA (or even use some functions in Excel) to do this, the question is already within the scope. Although you already have a potentially useful answer (for use in Excel), I voted to close as out of scope because I think your question is more in the first sense. Edit and improve by removing the reference to Notepad++ if you really want to use Excel.

  • You can open your txt by Excel and set the column delimiters of several different types, such as tab (tab), spaces, equal sign or even a fixed delimiter. Sounds like the best option. Take a look at this link here that illustrates what I said above: http://www.dhlebilling.com.br/ebilling/do/LinkExterno/importTxtExel

1 answer

2

If you have a default for the code, where you will always have to remove the code composed of 9 characters, an equality symbol and a space, you can use the following code

=RIGHT(A1; LEN(A1)-10)

Explaining:

A1 - Cell in which the rule will be applied.

LEN(A1)-10 - Find the cell size (in case A1), and subtract an x number of characters (in case 10).

Now just apply this formula to all your cells. I believe this will be the least of the problems.

inserir a descrição da imagem aqui

  • Leonardo, good afternoon ! I’m trying to accomplish in Excel.... the following formula and error: =right (A1; LEN(A1)-10) ....

  • Could post a piece of the file for me to perform some tests?

  • CO000060690=%d of %d correspondence CO000060691=%d of %d matches CO000060692=%s "%d" not recognised.

  • And you need to get just the %d of %d correspondence ?

  • I need it! All text that comes after = ( equal sign) serves .

  • @Rodrigohackzexploitz added an image, that would be the expected result?

  • Yes, exactly would that be.... perfect...more like you did???

  • I used this code there that I had posted. Try to write it instead of copying even the spaces. Maybe it works.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.