At 00:39 -0600 8/17/10, LuKreme wrote:
>               <dict>
>                       <key>Archive File Name</key>
>                       <string>FaceBlock-1.safariextz</string>
>                       <key>Bundle Directory Name</key>
>                       <string>FaceBlock-1.safariextension</string>
>                       <key>Enabled</key>
>                       <true/>
>               </dict>
>               <dict>
>                       <key>Archive File Name</key>
>                       <string>Validate.safariextz</string>
>                       <key>Bundle Directory Name</key>
>                       <string>Validate.safariextension</string>
>                       <key>Enabled</key>
>                       <true/>
>               </dict>
>               <dict>
>                       <key>Archive File Name</key>
>                       <string>AdBlock-1.safariextz</string>
>                       <key>Bundle Directory Name</key>
>                       <string>AdBlock-1.safariextension</string>
>                       <key>Enabled</key>
>                       <true/>
>               </dict>

Just for the hell of it I pasted that into a Microsoft Excel spreadsheet 
starting at A2

I put a 0 in A1 and a 1 in B2. Those columns would have nothing in them because 
of the tabs in the source. BBEdit doesn't handle tabs the way spreadsheets do.

in A2, I put the formula  =IF(C2="<dict>",A1+1,A1) , 
=IF(C2="<dict>",A1+1000,A1+1) might be better.
In B2, I put the formula  =IF(C2="<dict>",D4,B1)

Then fill down starting at A2:B2 as far as you want to go.

Copy all of the filled down cells and paste-special, values into the same area. 

Now sort all of the data rows first by column B and then by column A.

3       <string>AdBlock-1.safariextz</string>   <dict>  
3       <string>AdBlock-1.safariextz</string>           <key>Archive File 
Name</key>
3       <string>AdBlock-1.safariextz</string>           
<string>AdBlock-1.safariextz</string>
3       <string>AdBlock-1.safariextz</string>           <key>Bundle Directory 
Name</key>
3       <string>AdBlock-1.safariextz</string>           
<string>AdBlock-1.safariextension</string>
3       <string>AdBlock-1.safariextz</string>           <key>Enabled</key>
3       <string>AdBlock-1.safariextz</string>           <true/>
3       <string>AdBlock-1.safariextz</string>   </dict> 
1       <string>FaceBlock-1.safariextz</string> <dict>  
1       <string>FaceBlock-1.safariextz</string>         <key>Archive File 
Name</key>
1       <string>FaceBlock-1.safariextz</string>         
<string>FaceBlock-1.safariextz</string>
1       <string>FaceBlock-1.safariextz</string>         <key>Bundle Directory 
Name</key>
1       <string>FaceBlock-1.safariextz</string>         
<string>FaceBlock-1.safariextension</string>
1       <string>FaceBlock-1.safariextz</string>         <key>Enabled</key>
1       <string>FaceBlock-1.safariextz</string>         <true/>
1       <string>FaceBlock-1.safariextz</string> </dict> 
2       <string>Validate.safariextz</string>    <dict>  
2       <string>Validate.safariextz</string>            <key>Archive File 
Name</key>
2       <string>Validate.safariextz</string>            
<string>Validate.safariextz</string>
2       <string>Validate.safariextz</string>            <key>Bundle Directory 
Name</key>
2       <string>Validate.safariextz</string>            
<string>Validate.safariextension</string>
2       <string>Validate.safariextz</string>            <key>Enabled</key>
2       <string>Validate.safariextz</string>            <true/>
2       <string>Validate.safariextz</string>    </dict> 

Blank out columns A and B then copy and paste back into BBEdit.

You might want to use  =IF(C2="<dict>",A1+100,A1+1)  of some other changes to 
fit the actual data.

And the really good way is to become an expert with hashes of arrays in perl 
but that takes some learning time.
-- 

--> In Christianity, man can have only one wife. This is known as monotony. <--

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.

Reply via email to