Page 1 of 1

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

Posted: Tue Oct 31, 2006 7:07 pm
by Heike
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

Posted: Tue Oct 31, 2006 11:49 pm
by Abacre
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.

Posted: Wed Nov 01, 2006 12:06 pm
by Heike
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

Posted: Wed Nov 01, 2006 12:28 pm
by Abacre
Probably your text has some trailing spaces. Please send a sample
file to support@abacre.com

Posted: Tue Nov 21, 2006 4:44 pm
by Abacre
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