Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
TonyP #1
Trim problem
Hi, i have another complex problem i cannot figure out. I have a string called
#file_name#. The string's value is a filepath and file name of a file. Like
this. <cfset file_name = 'e:\www\root\files\fileone.zip'> What im trying to do
is remove the path and leave the file name from the string. So i could use
another string that would only consist of the file name. (fileone.zip) The
reason why i need this to be auto is because i will never know what the path or
filename will be. Thanks for your help. Tony Paolillo
TonyP Guest
-
trim function
Hi there, does any know how i can do a 'trim on canvas' sort of function. If my canvas is bigger than my draw/animation etc, then how do i shrink... -
problem with the trim() function
I am working on a german website and I have a username called "zartbitters??". When I use the #trim(username)# it removes the german letter ?. The... -
Need to Trim value in a List
I have a list that retrieves documents in a directory. <!--- Pack Directory ---> <cfdirectory action='list' directory='C:\TNS_Docs\EXCEL_PACKS'... -
Problem Printing Trim marks on Epson 777i
Interesting. Used the trim marks and they did print. I was on a printer called "Canon 860" I think and the printer stopped working so I switched over... -
trim string
How do i cut the last 4 characters in a string? I know how to cut the 4 first, but i need to cut the last! I have a image name like testimage.gif... -
jgould #2
Re: Trim problem
This works: <cfset file_name = 'e:\www\root\files\fileone.zip'> <cfoutput>
<cfset iPos = find('\', '#file_name#')> <cfloop condition = 'iPos is not 0'>
<cfset file_name = #Right( file_name , Len( file_name ) - iPos )#>
<cfset iPos = find('\', '#file_name#')> </cfloop> </cfoutput>
jgould Guest
-
TonyP #3
Re: Trim problem
Thanks Jeff. That seemed to work, execpt it took off teh .zip from the file. Any ideas how to get that back?
Thanks
TonyP Guest
-
jgould #4
Re: Trim problem
The code I posted didn't take the '.zip' off. Are you sure you had the .zip in your original file_name variable?
jgould Guest
-
TonyP #5
Re: Trim problem
My bad, your right. I had a typo. It works perfect!
Thanks for your help.
Tony
TonyP Guest
-
Adam Cameron #6
Re: Trim problem
> This works: <cfset file_name = 'e:\www\root\files\fileone.zip'> <cfoutput>
Chr*st on a stick, why on earth would you do all that?> <cfset iPos = find('\', '#file_name#')> <cfloop condition = 'iPos is not 0'>
> <cfset file_name = #Right( file_name , Len( file_name ) - iPos )#>
> <cfset iPos = find('\', '#file_name#')> </cfloop> </cfoutput>
And what are the <cfoutput> tags doing in there? You're not outputting
anything.
getFileFromPath().
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functi95.htm#wp1104998[/url]
--
Adam
Adam Cameron Guest
-
jgould #7
Re: Trim problem
Cool. I didn't know about that. You are obviously much smarter than me and a MUCH bigger sh*thead too.
jgould Guest
-
Adam Cameron #8
Re: Trim problem
> Cool. I didn't know about that. You are obviously much smarter than me and a MUCH bigger sh*thead too.
I'd quite like to know why I'm a sh*thead simply because I pulled you up on
giving someone some *really bad* advice as to how to solve an issue?
--
Adam
Adam Cameron Guest
-
jgould #9
Re: Trim problem
Simply because your attitude sucks. My way worked, Your way was better. But
the way you decided to point that out makes me wary of ever attempting to help
someone again. Carry on. I'm on to other things.
jgould Guest
-
TonyP #10
Re: Trim problem
im with you jgould, I took how Adam said that a bad way also. I do appreciate
your advice and im still using it. Dont stop helping others, we need people
like you that know what we dont and want to help. (Chr*st on a stick) lol
Tony
TonyP Guest



Reply With Quote

