How to make 5 lines into one and re-sort sequence

General discussions about Advanced Find and Replace
Post Reply
Heike
Posts: 2
Joined: Tue Oct 31, 2006 6:56 pm
Location: Canada

How to make 5 lines into one and re-sort sequence

Post by Heike » Tue Oct 31, 2006 7:07 pm

Hi there,

I was looking through previous posts but could not quite find a solution for my problem.

I would like to make the following change in my files:

original:

]
[
C3
0402
100n



]
[
C4
0805
100n



]
[
C5
0603
47u



]
[
C8
0402
100n


desired result:


'0402' ! '0402' ! '100n' ; C3
'0805' ! '0805' ! '100n' ; C4
'0603' ! '0603' ! '47u' ; C5
'0402' ! '0402' ! '100n' ; C8


Thank you very much for any help.

Heike

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Tue Oct 31, 2006 11:49 pm

Go to main menu - Action - Options - Batch Replace
check "Modifier S"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
\]\s*\r\n\[\s*\r\n(.*)\s*\r\n(.*)\s*\r\n(.*)\s*$

Replace with:
'$2' ! '$2' ! '$3' ; $1

If you want to remove empty lines the second row in the batch grid
should be:
Search for:
\r\n\r\n

Replace with:
\r\n

That's all I verified it works perfectly.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Heike
Posts: 2
Joined: Tue Oct 31, 2006 6:56 pm
Location: Canada

Post by Heike » Wed Nov 01, 2006 12:06 pm

Thank you so much for your reply Roman but it did not work. There must be something wrong witht he "Search for" section because regardless of what I put in the "Replace with" section the original does not change much.

Any ideas?

Thanks,

Heike

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Wed Nov 01, 2006 12:28 pm

Probably your text has some trailing spaces. Please send a sample
file to support@abacre.com
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Tue Nov 21, 2006 4:44 pm

After studying your sample files the correct sequence should be:

Search for:
\[\r\n(.*)\r\n(.*)\r\n(.*)\r\n.*\]

Replace with:
'$2' ! '$2' ! '$3' ; $1
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests