Sign in to follow this  
Followers 0
Alodar

_FileReadToArray but Escaped

1 post in this topic

#1 ·  Posted

I have a bunch of files that I'm working with, but I keep running into files wherein they have escaped strings.  The files are delimited with different things - commas, bars, tabs, etc - and _FileReadToArray has been my easiest method of working with them.  However, lately they've started to 'escape' strings in the files, but not consistently.  For instance, one time a line will read like:

1, 2, "Third item, is here", 4, "fifth detail", """Another Line here is "OK""""

and another will read as:

1, 2, 'Third item, is here', 4, 'fifth detail', "Sometimes there's a sixth"

etc

I haven't come across anything where they're trying to escape the lines as weird things like @ symbols or the like (yet), but I could see it, since the people creating the files are allowed to choose their own escape characters (WHY?!).

I've currently been manually creating the 2D arrays with some StringRegExp arrays, but I'd love to find a way to add update or bastardize the _FileReadToArray function with an option for an escape character so that it's dynamic and I don't have to keep recreating this stuff by hand.  Anyone got an idea for me?

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0