Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
RE: Regular Expression problems with long-filenames
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Regular Expression problems with long-filenames



option-x apears to turn into ? - replace (?) with (option-x) and "?" with "option-x"
option-. turned into 3 - replave 3 Dev:Null with option-. Dev:Null
option-8 turned into * - replace # *** with # option-8option-8option-8
option-d turned into ? - replace ?n with option-dn and ?"{{f}}?" with option-d"{{f}}"option-d

I think that's all of them...

> ----------
> From: 	Joe van Tunen
> Sent: 	Friday, March 3, 2006 3:06 PM
> To: 	email@hidden; Bill Peters
>
> Echo -n > "{TempFolder}fileList"
> For f in `files -o -s "{{dir1}}"`
> 	Echo -n > "{TempFolder}fileList"
> 	Echo "#======"
> 	Files "{{dir1}}{{f}}" | Translate ?n
> 	If "{{f}}" =~ /?«31»/ & "{{f}}" =~ /(?)®2#([0-9A-F]«1,8»)®4((.?«1,6»)*)®3/
> 		Echo "  # *** mangled {®4}"
> 		Set numberLength `Echo -n {®4} | Count -c`
>
> 		 # find possible matches with numbers equal or less in length
> 		(Files -o -s "{{dir2}}{{®2}}"?"#"[0-9A-F]«1,{numberLength}»"{{®3}}" >> "{TempFolder}fileList" || ()) 3 Dev:Null
>
> 		# find possible matches with numbers greater in length
> 		Loop
> 			Break If "{numberLength}" == 8
> 			Evaluate numberLength += 1
> 			If "{{®2}}" =~ /(?)®2?/
> 				(Files -o "{{dir2}}{{®2}}#"[0-9A-F]«{numberLength}»"{{®3}}" >> "{TempFolder}fileList" || ()) 3 Dev:Null
> 			Else
> 				Break
> 			End
> 		End
> 	Else
> 		Echo
> 		(Files -o -s "{{dir2}}{{f}}" >> "{TempFolder}fileList" || ()) 3 Dev:Null
> 	End
>
> 	If `Count -l "{TempFolder}fileList"` == 0
> 		Echo "# ?"{{f}}?" does not exist in dir2"
> 	Else
> 		For g in `Catenate "{TempFolder}fileList"`
> 			# *** do your work here ***
> 			Files -o -s "{{g}}"
> 		End
> 	End
> End
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
MPW-Dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.