Solved

Use Delete Key as Delimiter

Posted on 2011-03-03
3
395 Views
Last Modified: 2012-05-11
I am trying to upload and parse a csv file.  I am told it is delimited by the DELETE key.

Each field is delimited by character 127, the delete character. Hold alt then type 0,1,2,7 in sequence will type the delete character or use "x7F" in most programming languages.

I have tried some of this and it isn't working.  Anyone have any suggestions on how to use the delete character as a delimiter?
0
Comment
Question by:theideabulb
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 35031284
What have you tried? If it's ascii character 127, you should be able to use it as your loop delimiter

<cfloop list="#yourCSVContent#" delimiter="#chr(127)#" index="line">
    ....
</cfloop>
0
 
LVL 52

Expert Comment

by:_agx_
ID: 35031314
More specifically, break it into lines as usual ie chr(10) / chr(13). Then break it into columns on the delete character ie chr(127)

<cfloop list="#theCSVContent#" delimiter="#chr(10)##chr(13)#" index="line">
    <!--- preserve missing fields --->
    <cfset columns = listToArray(line, chr(127), true)>
    ...
</cfloop>
0
 

Author Closing Comment

by:theideabulb
ID: 35031371
i wasn't trying this #chr(127)#, i was just doing 127 or chr(127) and it kept giving errors.  Thanks for the easy solution.  I am a dummy :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question