We help IT Professionals succeed at work.
Get Started

Parsing CSV file

mishradba
mishradba asked
on
246 Views
Last Modified: 2012-05-12
I have a csv file which has records in the format:
"000000106"," 1"
"001382548"," 7"
"001959169"," 1"
"001959649"," 7"
"001963682"," 8"
"001964227"," 7"
"001965621"," 7"
"001985581"," 7"
"001968444"," 1"
"001968456"," 7"
"001968468"," 8"
"001968829"," 7"

I created a external table to read this as
CREATE TABLE SNS_IMPORT_EXTERNAL
(
 EMPLOYEE_ID  varchar2(100),
 ELIGIBILITY_STATUS varchar(5)
)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER DEFAULT DIRECTORY "INTERFACES"
ACCESS PARAMETERS
( records delimited BY newline
badfile 'SNS_IMPORT_EXTernal.bad'
logfile 'SNS_import_external.log'
fields terminated BY ',' optionally enclosed by '"'
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
)
LOCATION ( 'Eligsav.csv' )
)
REJECT LIMIT UNLIMITED;

When I give select employee_id from sns_import_external, it gives this output as
"000000106"," 1"
But I want first filed to go in employee_id and second after comma to go in elligibility_ status.
Please help
Comment
Watch Question
Sr. System Analyst
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE