At 02:40 PM 1/18/00 -0800, Gate wrote:
>I need to do the following two things (separately):
>
>First.. I have a file with comma delineated fields. The data in each field
>is enclosed in double quotes ("). However, some data fields have a quote
>within the quotes, and I need to remove that. What is my best choice for
>this?

Perl had a module or two (e.g., Text::ParseWords) that will handle CSV
data.  The format is deceptively tricky for the reason you give. I don't
know what you mean by "remove [the quote with the quotes]" but using this
module, you can parse the data in Perl and manipulate/write it as you like.
 If you want more detail, you can email me off-line.  I'll just tell you
what's on pp. 31-32 of the Perl Cookbook by O'Reilly.

>Second.. A text file that contains data within brackets in this format:
>useless text here[first/last]and useless text here
>
>I need to just take the data "first" and "last" and output it into another
>file like this:
>first:last

If "useless text" does not contain '[' or ']' and 'first; and ;last' do not
contain '/' then you can do two splits to get 'first/last' and then a final
one to seperate them.  Then you can write them as you like.  I don't have
time to work out the code right now but it should be simple.

-Alan
---
Alan D. Mead  /  Research Scientist  /  [EMAIL PROTECTED]
Institute for Personality and Ability Testing
1801 Woodfield Dr  /  Savoy IL 61874 USA
217-352-4739 (v)  /  217-352-9674 (f)


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to