How to avoid spaces in csv file at the time of spooling

Hi all,
I am spooling 30 query results into one CSV file ,I am getting two empty rows for each query.
Can any one suggest me how to avoid these spaces.
Thanks & Regards,
P Prakash
this is the script i am using to generate csv file .
SET linesize 12000
SET pagesize 10000
SET pause off
SET termout off
SET feed off
SET head off
SPOOL c:\tes111.csv replace
SELECT 'ISA01,ISA02,ISA03,ISA04,ISA05,ISA06,ISA07,ISA08,ISA09,ISA11,ISA12,ISA13,ISA14,ISA15,ISA16,GS01,GS02,GS03,GS04,GS05,GS06,GS07,GS08,ST01,ST02,ST03,BHT01,BHT02,BHT03,BHT04,BHT06,trnsctn_segment_count,included_trnsctn_sets_count,included_fnctnl_groups_count,input_acknwldgmnt_sid'
FROM DUAL;
SELECT ptr.athrztn_infrmtn_qlfr
|| ','
|| ptr.athrztn_infrmtn
|| ','
|| ptr.scrty_infrmtn_qlfr
|| ','
|| ptr.scrty_infrmtn
|| ','
|| ptr.intrchng_sndr_idntfr_qlfr
|| ','
|| ptr.intrchng_sndr_idntfr
|| ','
|| ptr.intrchng_rcvr_idntfr_qlfr
|| ','
|| ptr.intrchng_rcvr_idntfr
|| ','
|| ptr.intrchng_date
|| ','
|| ptr.intrchng_cntrl_stndrds_idntfr
|| ','
|| ptr.intrchng_cntrl_vrsn_nmbr
|| ','
|| ptr.intrchng_cntrl_nmbr
|| ','
|| ptr.acknwldgmnt_rqstd_indctr
|| ','
|| ptr.usg_indctr
|| ','
|| ptr.cmpnt_elmnt_sprtr
|| ','
|| ptr.fnctnl_idntfr_code
|| ','
|| ptr.aplctn_sndr_code
|| ','
|| ptr.applctn_rcvr_code
|| ','
|| ptr.fnctnl_grp_crtn_date
|| ','
|| ptr.fnctnl_grp_crtn_date
|| ','
|| ptr.grp_cntrl_nmbr
|| ','
|| ptr.rspnsbl_agncy_code
|| ','
|| ptr.vrsn_rls_indstry_idntfr_code
|| ','
|| ptr.trnsctn_set_idntfr_code
|| ','
|| ptr.trnsctn_set_cntrl_nmbr
|| ','
|| ptr.implementation_guide_vrsn_name
|| ','
|| ptr.hierarchical_structure_code
|| ','
|| ptr.trnsctn_set_purpose_lkpcd
|| ','
|| ptr.sbmtr_trnsctn_idntfr
|| ','
|| ptr.trnsctn_set_creation_date
|| ','
|| ptr.trnsctn_type_code
|| ','
|| ptr.trnsctn_segment_count
|| ','
|| ptr.included_trnsctn_sets_count
|| ','
|| ptr.included_fnctnl_groups_count
|| ','
|| ia.input_acknwldgmnt_sid
|| ','
FROM pa_transaction_request ptr, input_acknwldgmnt ia, input_batch_file ibf
WHERE ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
SELECT 'pa_rqst_sid,NM01,NM02,NM108,NM109'
FROM DUAL;
SELECT pr.pa_rqst_sid
|| ','
|| pr.entity_idntfr_lkpcd
|| ','
|| pr.entity_type_qlfr
|| ','
|| pr.payer_idntfctn_code_qlfr
|| ','
|| pr.payer_idntfctn_code
|| ','
FROM pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
SELECT 'meta_data_cid,data_value,iteration_number,Created_by,modified_by'
FROM DUAL;
SELECT prs.meta_data_cid
|| ','
|| prs.data_value
|| ','
|| prs.iteration_number
|| ','
|| prs.created_by
|| ','
|| prs.modified_by
|| ','
FROM pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_situational prs
WHERE pr.pa_rqst_sid = prs.pa_rqst_sid
AND prs.stnl_target_table_cid = 100
AND prs.target_table_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
SELECT 'NM101 ,NM103,NM104,NM105,NM108,NM109,PER02,PER04,PER05,PER06,PER07 ,PER08'
FROM DUAL;
SELECT pr.pa_rqst_sid
|| ','
|| prpl.pa_rqst_x_prvdr_lctn_sid
|| ','
|| prpl.rqstr_entity_idntfr_lkpcd
|| ','
|| prpl.last_name
|| ','
|| prpl.first_name
|| ','
|| prpl.middle_name
|| ','
|| prpl.idntfr_type_cid
|| ','
|| prpl.prvdr_lctn_iid
|| ','
|| prpl.rqstr_contact_name
|| ','
|| prpl.cmnctn_nmbr_1
|| ','
|| prpl.cmnctn_nmbr_2
|| ','
|| prpl.cmnctn_nmbr_type_lkpcd_1
|| ','
|| prpl.cmnctn_nmbr_type_lkpcd_2
|| ','
|| prpl.cmnctn_nmbr_type_lkpcd_3
FROM pa_request_x_provider_location prpl,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prpl.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat'
AND prpl.pa_prvdr_type_lkpcd = 'RR';
SELECT 'meta_data_cid,data_value,iteration_number,Created_by,modified_by'
FROM DUAL;
SELECT prs.meta_data_cid
|| ','
|| prs.data_value
|| ','
|| prs.iteration_number
|| ','
|| prs.created_by
|| ','
|| prs.modified_by
|| ','
FROM pa_request_x_provider_location prpl,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_situational prs
WHERE prpl.pa_rqst_sid = prs.pa_rqst_sid
AND prs.stnl_target_table_cid = 102
AND prs.target_table_sid = prpl.pa_rqst_x_prvdr_lctn_sid
AND prpl.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat'
AND prpl.pa_prvdr_type_lkpcd = 'RR';
-- 4. Subscriber
NM103 Name Last or Organization Name
NM104 Name First
NM108 Identification Code Qualifier
NM109 Identification Code
DMG02 Date Time Period birth date
DMG03 Gender Code
SELECT ' NM103,NM104,NM108,NM109,DMG02,DMG03'
FROM DUAL;
SELECT prxm.last_name
|| ','
|| prxm.first_name
|| ','
|| prxm.idntfr_type_cid
|| ','
|| prxm.mbr_idntfr
|| ','
|| prxm.birth_date
|| ','
|| prxm.gender_lkpcd
|| ','
FROM pa_request_x_member prxm,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prxm.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- 5. Subscriber Situational Info
NM102 Entity Type Qualifier
NM105 Name Middle
NM107 Name Suffix
REF01 Reference Identification Qualifier
REF02 Reference Identification
N301 Address Information
N302 Address Information
N401 City Name
N402 State or Province Code
N403 Postal Code
N407 Country Subdivision Code
SELECT 'meta_data_cid,data_value,iteration_number,Created_by,modified_by'
FROM DUAL;
SELECT prs.meta_data_cid
|| ','
|| prs.data_value
|| ','
|| prs.iteration_number
|| ','
|| prs.created_by
|| ','
|| prs.modified_by
|| ','
FROM pa_request_x_member prxm,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_situational prs
WHERE prxm.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND prs.stnl_target_table_cid = 101
AND prs.target_table_sid = prxm.pa_rqst_x_mbr_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- 6. Patient Event Level
TRN02 Reference Identification
TRN03 Originating Company Identifier
TRN04 Reference Identification
UM01 Request Category Code
UM02 Certification Type Code
UM03 Service Type Code
UM04-1 Facility Code Value
UM04-2 Facility Code Qualifier
UM06 Level of Service Code
UM07 Current Health Condition Code
UM08 Prognosis Code
UM09 Release of Information Code
UM10 Delay Reason Code
SELECT 'TRN02,TRN03,TRN04,UMO1,UMO2,UM04_1,UM04_2,UM06,UM07,UM08,UM09,UM10,'
FROM DUAL;
SELECT prd.patient_event_tracking_number
|| ','
|| prd.orginating_company_identifier
|| ','
|| prd.trace_assigning_entity_idntfr
|| ','
|| prs.rqst_ctgry_lkpcd
|| ','
|| prs.rqst_crtfctn_type_lkpcd
|| ','
|| prs.x12_pa_srvc_type_code
|| ','
|| prs.facility_type_code
|| ','
|| prs.unfrm_blng_facility_type_code
|| ','
|| prs.srvc_rqd_lkpcd
|| ','
|| prs.current_health_cndtn_lkpcd
|| ','
|| prs.prognosis_lkpcd
|| ','
|| prs.rls_of_info_lkpcd
|| ','
|| prs.delay_reason_lkpcd
|| ','
FROM pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_detail prd
WHERE prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND pr.pa_rqst_sid = prd.pa_rqst_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
--Patient Event Level situational information
SELECT 'meta_data_cid,data_value,iteration_number,Created_by,modified_by'
FROM DUAL;
SELECT prs.meta_data_cid
|| ','
|| prs.data_value
|| ','
|| prs.iteration_number
|| ','
|| prs.created_by
|| ','
|| prs.modified_by
|| ','
FROM pa_request_service prsv,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_situational prs
WHERE prsv.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND prs.stnl_target_table_cid = 103
AND prs.target_table_sid = prsv.pa_rqst_srvc_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
---Diagnosis
HI01 Health Care Code Information
HI01-1 Code List Qualifier Code
HI01-2 Industry Code
HI01-3 Date Time Period Format Qualifier
HI01-4 Date Time Period
SELECT 'HI01_1,HI01_2,HI01_3'
FROM DUAL;
SELECT prd.pa_diagnosis_type_lkpcd
|| ','
|| prd.diagnosis_iid
|| ','
|| prd.from_date
|| ','
FROM pa_request_x_diagnosis prd,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prd.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- Request detail
TRN02 Reference Identification
TRN03 Originating Company Identifier
TRN04 Reference Identification
SELECT 'TRN02,TRN03,TRN04'
FROM DUAL;
SELECT prd.patient_event_tracking_number
|| ','
|| prd.orginating_company_identifier
|| ','
|| prd.trace_assigning_entity_idntfr
|| ','
FROM pa_request_detail prd,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prd.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- ambulance Transaportation
CR101 Unit or Basis for Measurement Code
CR102 Weight
CR103 Ambulance Transport Code
CR104 Ambulance Transport Reason Code
CR105 Unit or Basis for Measurement Code
CR106 Quantity
CR109 Description
CR110 Description
SELECT 'CR101,CR102,CR103,CR104,CR105,CR106,CR109,CR110'
FROM DUAL;
SELECT pat.weight_uom_code
|| ','
|| pat.patient_weight
|| ','
|| pat.amblnc_transport_type_lkpcd
|| ','
|| pat.amblnc_transport_rsn_lkpcd
|| ','
|| pat.distance_uom_code
|| ','
|| pat.trnsprtn_distance
|| ','
|| pat.round_trip_purpose_desc
|| ','
|| pat.stretcher_purpose_desc
|| ','
FROM pa_request_ambulance_transport pat,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE pat.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- 2000F SV1
SV101-1 Product/Service ID Qualifier Change values
SV101-2 Product/Service ID Need to change label to Procedure Code.
SV101-3 Procedure Modifier No change required to PA screen
SV101-4 Procedure Modifier No change required to PA screen
SV101-5 Procedure Modifier No change required to PA screen
SV101-6 Procedure Modifier No change required to PA screen
SV101-7 Description No change required to PA screen. Will map to the Remarks field on the Screen
SV102 Monetary Amount
SV103 Unit or Basis for Measurement Code
SV104 Quantity
SV107 Composite Diagnosis Code Pointer
SV107-1 Diagnosis Code Pointer
SV107-2 Diagnosis Code Pointer
SV107-3 Diagnosis Code Pointer
SV107-4 Diagnosis Code Pointer
SV111 Yes/No Condition or Response Code
SV120 Level of Care Code
SELECT 'TRN_Reference_Identif,TRN_Originating_CMP_Identif,TRN_Reference_IdentiReference Identiff,Reference_Identif,Reference_Identification,Reference_Identif,Product/Service_ID_Qualifier,Product/Service_ID,Procedure_Modifier,Procedure_Modifier,Procedure_Modifier,Procedure_Modifier,Description'
FROM DUAL;
SELECT prp.srvc_trace_nmbr_1
|| ','
|| prp.trace_asgn_enty_adtnl_idntfr_1
|| ','
|| prp.trace_asgn_enty_adtnl_idntfr_1
|| ','
|| prp.trace_asgn_enty_adtnl_idntfr_2
|| ','
|| prp.prvs_rvw_athrztn_nmbr
|| ','
|| prp.prvs_administrative_rfrnc_nmbr
|| ','
|| prp.x12_code_list_qlfr_lkpcd
|| ','
|| prp.procedure_iid
|| ','
|| prp.mdfr_code
|| ','
|| prp.mdfr2_code
|| ','
|| prp.mdfr3_code
|| ','
|| prp.mdfr4_code
|| ','
|| prp.drug_desc
|| ','
FROM pa_request_procedure prp,
pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prp.pa_rqst_srvc_sid = prs.pa_rqst_srvc_sid
AND prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HHIPAA.165760000.20110518I001.278_GC04-3.dat';
SV2 SV201 Product/Service ID
SV2 SV202 Composite Medical Procedure Identifier
SV2 SV202-1 Product/Service ID Qualifier
SV2 SV202-2 Product/Service ID
SV2 SV202-3 Procedure Modifier
SV2 202-4 Procedure Modifier
SV2 SV202-5 Procedure Modifier
SV2 SV202-6 Procedure Modifier
SV2 SV202-7 Description
SV2 SV202-8 Product/Service ID
SV2 SV203 Monetary Amount
SV2 SV204 Unit or Basis for Measurement Code
SV2 SV205 Quantity
SV2 SV206 Unit Rate
SV2 SV209 Nursing Home Residential Status Code
SELECT 'Product/Service ID,Product/Service ID Qual,Product/Service ID,Product Modifier,Product Modifier,Product Modifier,Product Modifier,Description,Unit Rate,'
FROM DUAL;
SELECT prp.revenue_iid ||','||
prp.x12_code_list_qlfr_lkpcd ||','||
prp.procedure_iid ||','||
prp.mdfr_code ||','||
prp.mdfr2_code ||','||
prp.mdfr3_code ||','||
prp.mdfr4_code ||','|| prp.drug_desc ||','||
prp.srvc_line_rate ||','
FROM pa_request_procedure prp,
pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prp.pa_rqst_srvc_sid = prs.pa_rqst_srvc_sid
AND prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- 2000F SV3
SV301 Composite Medical Procedure Identifier
SV301-1 Product/Service ID Qualifier
SV301-2 Product/Service ID
SV301-3 Procedure Modifier
SV301-4 Procedure Modifier
SV301-5 Procedure Modifier
SV301-6 Procedure Modifier
SV301-7 Description
SV301-8 Product/Service ID
SV302 Monetary Amount
SV304 Oral Cavity Designation
SV304-1 Oral Cavity Designation Code
SV304-2 Oral Cavity Designation Code
SV304-3 Oral Cavity Designation Code
SV304-4 Oral Cavity Designation Code
SV304-5 Oral Cavity Designation Code
SV305 Prosthesis, Crown or Inlay Code
SV306 Quantity
SV307 Description
select 'Product/Service ID Qual,Product/Service ID,Procedure Modifier,Procedure Modifier,Procedure Modifier,Procedure Modifier,Description,Oral Cavity Designation Code,Oral Cavity Designation Code,Oral Cavity Designation Code,Oral Cavity Designation Code,ProsthesisCrown Inlay Code,Description' from dual;
SELECT prp.x12_code_list_qlfr_lkpcd
|| ','
|| prp.procedure_iid
|| ','
|| prp.mdfr_code
|| ','
|| prp.mdfr2_code
|| ','
|| prp.mdfr3_code
|| ','
|| prp.mdfr4_code
|| ','
|| prp.drug_desc
|| ','
|| prp.oral_cavity_dsgntn2_cid
|| ','
|| prp.oral_cavity_dsgntn3_cid
|| ','
|| prp.oral_cavity_dsgntn4_cid
|| ','
|| prp.oral_cavity_dsgntn5_cid
|| ','
|| prp.prosthesis_crown_inlay_code
|| ','
|| prp.remark
|| ','
FROM pa_request_procedure prp,
pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prp.pa_rqst_srvc_sid = prs.pa_rqst_srvc_sid
AND prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- 2000F TOO pending Prakash to Write
--Tooth Information
SELECT 'Industry Code,Tooth Surface,TOO03-1_Tooth Surface Code,TOO03-2_Tooth Surface Code,TOO03-3_Tooth Surface Code,TOO03-4_Tooth Surface Code,'
FROM DUAL;
SELECT prp.tooth_number_cid
|| ','
|| prp.tooth_surface_cid
|| ','
|| prp.tooth_surface2_cid
|| ','
|| prp.tooth_surface3_cid
|| ','
|| prp.tooth_surface4_cid
|| ','
|| prp.tooth_surface5_cid
|| ','
FROM pa_request_procedure prp,
pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prp.pa_rqst_srvc_sid = prs.pa_rqst_srvc_sid
AND prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
--tooth SItuational  Information
select 'Monetary Amount,Quantity' from dual;
SELECT prpt.rqst_prcdr_amt||','|| prpt.rqst_prcdr_units||','
FROM pa_rqst_prcdr_transaction prpt,
pa_request_procedure prp,
pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prpt.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
AND prp.pa_rqst_srvc_sid = prs.pa_rqst_srvc_sid
AND prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- pa_rqst_prcdr_x_prvdr_lctn
select 'pa_rqst_prcdr_sid,pa_rqst_x_prvdr_lctn_sid' from dual;
SELECT prppl.pa_rqst_prcdr_sid||','|| prppl.pa_rqst_x_prvdr_lctn_sid||','
FROM pa_rqst_prcdr_x_prvdr_lctn prppl,
pa_request_procedure prp,
pa_request_service prs,
pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf
WHERE prppl.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
AND prp.pa_rqst_srvc_sid = prs.pa_rqst_srvc_sid
AND prs.pa_rqst_sid = pr.pa_rqst_sid
AND pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
-- error Details
--Header level error details
SELECT 'pa_rqst_sid,pa_error_nmbr,pa_error_sid,reject_reason_lkpcd,follow_up_action_lkpcd,aaa_segment_loop_nmbr,run_nmbr,'
FROM DUAL;
SELECT prre.pa_rqst_sid
|| ','
|| pe.pa_error_nmbr
|| ','
|| pe.pa_error_sid
|| ','
|| ped.reject_reason_lkpcd
|| ','
|| ped.follow_up_action_lkpcd
|| ','
|| ped.aaa_segment_loop_nmbr
|| ','
|| prre.run_nmbr
|| ','
FROM pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_run_error prre,
pa_error pe,
pa_error_detail ped
WHERE pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND pr.pa_rqst_sid = prre.pa_rqst_sid
AND prre.pa_error_sid = pe.pa_error_sid
AND pe.pa_error_sid = ped.pa_error_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
---Line Level Error Details
SELECT 'pa_rqst_sid,pa_error_nmbr,pa_error_sid,reject_reason_lkpcd,follow_up_action_lkpcd,aaa_segment_loop_nmbr'
FROM DUAL;
SELECT pr.pa_rqst_sid
|| ','
|| pe.pa_error_nmbr
|| ','
|| pe.pa_error_sid
|| ','
|| ped.reject_reason_lkpcd
|| ','
|| ped.follow_up_action_lkpcd
|| ','
|| ped.aaa_segment_loop_nmbr
|| ','
FROM pa_request pr,
pa_transaction_request ptr,
input_acknwldgmnt ia,
input_batch_file ibf,
pa_request_service prs,
pa_request_procedure prp,
pa_request_procedure_run_error prpre,
pa_error pe,
pa_error_detail ped
WHERE pr.pa_trnsctn_rqst_sid = ptr.pa_trnsctn_rqst_sid
AND ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND pr.pa_rqst_sid = prs.pa_rqst_sid
AND prs.pa_rqst_srvc_sid = prp.pa_rqst_srvc_sid
AND prp.pa_rqst_prcdr_sid = prpre.pa_rqst_prcdr_sid
AND prpre.pa_error_sid = pe.pa_error_sid
AND pe.pa_error_sid = ped.pa_error_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
SPOOL off
SET head on
SET feed on
SET termout on
SET pause on

833560 wrote:
Hi all,
I am spooling 30 query results into one CSV file ,I am getting two empty rows for each query.
Can any one suggest me how to avoid these spaces.
Thanks & Regards,
P Prakash
this is the script i am using to generate csv file .
SET linesize 12000
SET pagesize 10000
SET pause off
SET termout off
SET feed off
SET head off
SPOOL c:\tes111.csv replace
SELECT 'ISA01,ISA02,ISA03,ISA04,ISA05,ISA06,ISA07,ISA08,ISA09,ISA11,ISA12,ISA13,ISA14,ISA15,ISA16,GS01,GS02,GS03,GS04,GS05,GS06,GS07,GS08,ST01,ST02,ST03,BHT01,BHT02,BHT03,BHT04,BHT06,trnsctn_segment_count,included_trnsctn_sets_count,included_fnctnl_groups_count,input_acknwldgmnt_sid'
FROM DUAL;
SELECT ptr.athrztn_infrmtn_qlfr
|| ','
|| ptr.athrztn_infrmtn
|| ','
|| ptr.scrty_infrmtn_qlfr
|| ','
|| ptr.scrty_infrmtn
|| ','
|| ptr.intrchng_sndr_idntfr_qlfr
|| ','
|| ptr.intrchng_sndr_idntfr
|| ','
|| ptr.intrchng_rcvr_idntfr_qlfr
|| ','
|| ptr.intrchng_rcvr_idntfr
|| ','
|| ptr.intrchng_date
|| ','
|| ptr.intrchng_cntrl_stndrds_idntfr
|| ','
|| ptr.intrchng_cntrl_vrsn_nmbr
|| ','
|| ptr.intrchng_cntrl_nmbr
|| ','
|| ptr.acknwldgmnt_rqstd_indctr
|| ','
|| ptr.usg_indctr
|| ','
|| ptr.cmpnt_elmnt_sprtr
|| ','
|| ptr.fnctnl_idntfr_code
|| ','
|| ptr.aplctn_sndr_code
|| ','
|| ptr.applctn_rcvr_code
|| ','
|| ptr.fnctnl_grp_crtn_date
|| ','
|| ptr.fnctnl_grp_crtn_date
|| ','
|| ptr.grp_cntrl_nmbr
|| ','
|| ptr.rspnsbl_agncy_code
|| ','
|| ptr.vrsn_rls_indstry_idntfr_code
|| ','
|| ptr.trnsctn_set_idntfr_code
|| ','
|| ptr.trnsctn_set_cntrl_nmbr
|| ','
|| ptr.implementation_guide_vrsn_name
|| ','
|| ptr.hierarchical_structure_code
|| ','
|| ptr.trnsctn_set_purpose_lkpcd
|| ','
|| ptr.sbmtr_trnsctn_idntfr
|| ','
|| ptr.trnsctn_set_creation_date
|| ','
|| ptr.trnsctn_type_code
|| ','
|| ptr.trnsctn_segment_count
|| ','
|| ptr.included_trnsctn_sets_count
|| ','
|| ptr.included_fnctnl_groups_count
|| ','
|| ia.input_acknwldgmnt_sid
|| ','
FROM pa_transaction_request ptr, input_acknwldgmnt ia, input_batch_file ibf
WHERE ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
AND ia.input_batch_file_sid = ibf.input_batch_file_sid
AND ibf.original_file_name =
'HIPAA.165760000.20110518I001.278_GC04-3.dat';
SELECT 'pa_rqst_sid,NM01,NM02,NM108,NM109'
FROM DUAL;
Hi ,
Save your query in a file and execute that file
SQL>@a.aqlHope this helps
Regards,
Achyut

Similar Messages

  • How to force checked out CSV Files to open in Excel and not in Notepad

    Hi,
    I'm looking for some pointers / direction.
    .CSV files on SharePoint 2010 document library opens up in notepad by default. I did the DocIcon.xml CSV entry, changed the MIME type in IIS and did the IIS reset. Also on client computer CSV file is associated with MS Excel 2013. Now clicking a CSV file
    opens it up in MS Excel.
    Now a user checks out a CSV file and the same user clicks on the CSV file, the file is opening in notepad! If other users clicks on the same checked out file (checked out by the first user) it opens up in Excel for them. I've tried the 'Edit in Microsoft
    Excel' from the pop up menu but with same result.
    How can I force a checked out CSV file to open in MS Excel?
    Thanks

    1. Highlight one of the images and press cmd+i (or right click and select "Get info")
    2. Click the dropdown menu and select Photoshop (you might have to click "Other..." to find it.
    3. Then click "Change All" button below.
    You're going to have to do this with every different TYPE of image (e.g. jpeg, tiff etc) but once you've covered all the types you won't have the problem again.
    Hope this helps!

  • How to create power shell script to upload all termset csv files into the SharePoint2013 local taxonomy ?

    Hi Everyone,
    I want to create a powershell script file
    1) Check a directory and upload all termset csv files into the SharePoint local taxonomy.
    2) Input paramaters - directory that containss termset csv files, Local Termstore to import to,
    3) Prior to updating get a backup of the existing termstore (for rollback/recovery purposes)
    4) Parameters should be passed in via XML file.
    Please let me know how to do it.
    Regards,
    Srinivas

    Hi,
    Please check this link
    http://termsetimporter.codeplex.com/
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How do I compare two csv files and not disable the user if the username is found in the 2nd file using powershell?

    Hi Guys
    I have two csv files with the following headers and I need to import both files into the script to check whether the StaffCode is present in the Creation/Renewal of Contract csv in a DisableAccount Script so I can stop any action to disable the account as
    the staff has renewed the contract with the company so the account should not be disabled.
    However my accounts are still being disabled. I am not sure now to construct the query so that it detects that the account is to be left alone if the staffcode is present in both files
    I does recognize that the $staffcodeN in the renewal file matches the $staffcode in the termination file
    but still proceeds to disable or set an expiry date to the account anyway based on the termination file. 
    How do I stop it from doing that?
    1)In the Creation/Renewal of contract file the following headers are present
         -  TranCode,StaffCode,LastName,FirstName,SocialSecurityNo,DateJoin,Grade,Dept,LastUpdateDate,EffectiveDate
    2)In the Disable of contract file the following headers are present
        - TranCode,StaffCode,LastName,FirstName,SocialSecurityno,LastDateWorked,Grade,Dept,LastUpdateDate,
    My data is not very clean , I have a-lot of special characters such as = , ' ,/ and \ characters to remove first before i can compare the data
    Thanks for the help in advance.
    Yours Sincrely
    Vicki
    The following is a short snippet of the code 
    $opencsv = import-csv "D:\scripts\Termination.csv"
    $opencsv2 = import-csv "D:\scripts\RenewContractandNewStaff.csv"
    foreach ($usertoaction in $opencsv) 
    $Trancode = $usertoactionTranCode
    $StaffCode = $usertoaction.StaffCode.replace("=","").replace('"','')
    $LastName = [string]$usertoaction.LastName.Replace("/","\/").Replace(",","\,")
    $FirstName = [string]$usertoaction.FirstName.Replace("/","\/").Replace(",","\,")
    $socialsecurityno = $usertoaction.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoin = $usertoaction.DateJoin.replace("=","").replace('"','')
    $LastDateWorked = $usertoaction.LastDateWorked.replace("=","").replace('"','')
    $Grade = [string]$usertoaction.Grade
    $Dept = [string]$usertoaction.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $AccountExpiry = [datetime]::Now.ToString($LastDateWorked)
    foreach ($usertoaction2 in $opencsv2) 
    $TrancodeN = $usertoaction2.TranCode
    $StaffCodeN = $usertoaction2.StaffCode.replace("=","").replace('"','')
    $socialsecurityNoN= $usertoaction2.SocialSecurityNo.replace("=","").replace('"','')
    $DateJoinN = $usertoaction2.DateJoin.replace("=","").replace('"','')
    $GradeN = [string]$usertoaction2.Grade
    $DeptN = $usertoaction2.Dept
    $LastUpdateDate = $usertoaction.LastUpdateDate.replace("=","").replace('"','')
    $EffectiveDate = $usertoaction.EffectiveDate.replace("=","").replace('"','')
    $LastName2 = [string]$usertoaction2.LastName.Replace(",", "").Replace("/","").trim()
    $FirstName2 = [string]$usertoaction2.FirstName.Replace("/","").trim()
    # Use DirectorySearcher to find the DN of the user from the sAMAccountName.
    $Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $Root = $Domain.GetDirectoryEntry()
    $Searcher = [System.DirectoryServices.DirectorySearcher]$Root
    $Searcher.Filter = "(sAMAccountName=$samaccountname)"
    $doesuserexist1 = $Searcher.Findall()
    if ($doesuserexist1 -eq $Null)
    {Write-Host $samaccountname "account does not exist"}
    elseif ($StaffCodeN -match $staffcode)
    write-host "user has renewed the contract, no action taken"
    else
    if(($lastupdatedate -ne $null)-or($LastDateWorked -ne $null))
                        write-host "Setting Account Expiry to"$accountexpirydate
    #$ChangeUser.AccountExpires = $accountexpirydate
               #$Changeuser.setinfo()
    if ($UserMailforwarding -ne $null)
    #Set Account expiry date to Last Date Worked
    # $ChangeUser.AccountExpires = $accountexpirydate
    # $Changeuser.setinfo()
     write-host "staff" $displayname "with staff employee no" $samaccountname "has                          
    mailforwarding" 
    Write-host "Please disable the account manually via Active Directory Users & Computers and 
    Elseif ($accountexpirydate -lt $todaysdate)
    #disable the account

    Hi Vicki,
    This Forum has an insert-codeblock function. Using it will make your script far more readable
    Your script is missing some parts, it is impossible to follow the problem.
    You are performing the same string cleaning action on $opencsv2 for each element in $opencsv, when doing it once should suffice. Why not start it all by cleaning the values and storing the cleaned values in new arrays?
    The Compare-Object function is great, why not take it out for a stroll on these lists, it might just safe you lots of unnecessarily complicated code ...
    You are creating a new $Domain, $Root and $Searcher object each iteration, when doing it once should suffice. Probably not much of a time-saver, but every little thing contributes.
    Try pinpointing the problem by doing extensive logging, not only by writing which action was taken, but writing the inidividual information (variables, mostly) before evaluation occurs. Your if/elseif/else looks sound, so if it's still not doing what you
    want, the ingoing data must be different from what you think should be there.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • How to generate a second csv file with different report columns selected?

    Hi. Everybody:
    How to generate a second csv file with different report columns selected?
    The first csv file is easy (report attributes -> report export -> enable CSV output Yes). However, our users demand 2 csv files with different report columns selected to meet their different needs.
    (The users don't want to have one csv file with all report columns included. They just want to get whatever they need directly, no extra columns)
    Thank you for any help!
    MZ

    Hello,
    I'm doing it usually. Typically example would be in the report only the column "FIRST_NAME" and "LAST_NAME" displayed whereas
    in the csv exported with the UTL_FILE the complete address (street, housenumber, additions, zip, town, state ... ) is written, these things are needed e.g. the form letters.
    You do not need another page, just an additional button named e.g. "export_to_csv" on your report page.
    The csv export itself is handled from a plsql procedure "stored procedure" ( I like to have business logic outside of apex) which is invoked by pressing the button "export_to_csv". Of course the stored procedure can handle also parameters
    An example code would be something like
    PROCEDURE srn_brief_mitglieder (
         p_start_mg_nr IN NUMBER,
         p_ende_mg_nr IN NUMBER
    AS
    export_file          UTL_FILE.FILE_TYPE;
    l_line               VARCHAR2(20000);
    l_lfd               NUMBER;
    l_dateiname          VARCHAR2(100);
    l_datum               VARCHAR2(20);
    l_hilfe               VARCHAR2(20);
    CURSOR c1 IS
    SELECT
    MG_NR
    ,TO_CHAR(MG_BEITRITT,'dd.mm.yyyy') AS MG_BEITRITT ,TO_CHAR(MG_AUFNAHME,'dd.mm.yyyy') AS MG_AUFNAHME
    ,MG_ANREDE ,MG_TITEL ,MG_NACHNAME ,MG_VORNAME
    ,MG_STRASSE ,MG_HNR ,MG_ZUSATZ ,MG_PLZ ,MG_ORT
    FROM MITGLIEDER
    WHERE MG_NR >= p_start_mg_nr
    AND MG_NR <= p_ende_mg_nr
    --WHERE ROWNUM < 10
    ORDER BY MG_NR;
    BEGIN
    SELECT TO_CHAR(SYSDATE, 'yyyy_mm_dd' ) INTO l_datum FROM DUAL;
    SELECT TO_CHAR(SYSDATE, 'hh24miss' ) INTO l_hilfe FROM DUAL;
    l_datum := l_datum||'_'||l_hilfe;
    --DBMS_OUTPUT.PUT_LINE ( l_datum);
    l_dateiname := 'SRNBRIEF_MITGLIEDER_'||l_datum||'.CSV';
    --DBMS_OUTPUT.PUT_LINE ( l_dateiname);
    export_file := UTL_FILE.FOPEN('EXPORTDIR', l_dateiname, 'W');
    l_line := '';
    --HEADER
    l_line := '"NR"|"BEITRITT"|"AUFNAHME"|"ANREDE"|"TITEL"|"NACHNAME"|"VORNAME"';
    l_line := l_line||'|"STRASSE"|"HNR"|"ZUSATZ"|"PLZ"|"ORT"';
         UTL_FILE.PUT_LINE(export_file, l_line);
    FOR rec IN c1
    LOOP
         l_line :=  '"'||rec.MG_NR||'"';     
         l_line := l_line||'|"'||rec.MG_BEITRITT||'"|"' ||rec.MG_AUFNAHME||'"';
         l_line := l_line||'|"'||rec.MG_ANREDE||'"|"'||rec.MG_TITEL||'"|"'||rec.MG_NACHNAME||'"|"'||rec.MG_VORNAME||'"';     
         l_line := l_line||'|"'||rec.MG_STRASSE||'"|"'||rec.MG_HNR||'"|"'||rec.MG_ZUSATZ||'"|"'||rec.MG_PLZ||'"|"'||rec.MG_ORT||'"';          
    --     DBMS_OUTPUT.PUT_LINE (l_line);
    -- in datei schreiben
         UTL_FILE.PUT_LINE(export_file, l_line);
    END LOOP;
    UTL_FILE.FCLOSE(export_file);
    END srn_brief_mitglieder;Edited by: wucis on Nov 6, 2011 9:09 AM

  • How to import an .csv file into the database?

    and can we code the program in JSP to import the.csv file into the database.

    It is better to use Java class to read the CSV file and store the contents in the database.
    You can use JSP to upload the CSV file to the server if you want, but don't use it to perform database operations.
    JSPs are good for displaying information on the front-end, and for displaying HTML forms, there are other technologies more suitable for the middle layer, back end and the database layer.
    So break you application into
    1) Front end - JSPs to display input html forms and to display data retrieved from the database.
    2) Middle layer - Servlets and JavaBeans to interact with JSPs. The code that reads the CSV file to parse it's contents should be a Java Class in the middle layer. It makes use of Java File I/O
    3) Database layer - Connects to the database using JDBC (Java Database Connectivity), and then writes to the database with SQL insert statements.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Keeping the above concepts in mind, first build a simple JSP and get it to work,
    then research on Google , for Java File I/O , discover how to read a file,
    Then search on how to readh a CSV file using Java.
    After researching you should be able to read the CSV file line by line and store each line inside a Collection.
    Then research on Google, on how to write to the database using JDBC
    Write a simple program that inserts something to a dummy table in the database.
    Then, read the data stored in the Collection, and write insert statements for each records in the collection.

  • Eliminate space in csv file

    Hi
    I have a script (see below) which runs and spools the information
    select
    STU_ID||','||CRSLIST||','||FIRST_NAME||','||SURNAME||','||MID_INITIAL||','||substr(rtrim(STU_ID),-1)||','||STUREF studata
    from LOC_STUEMAIL
    where STU_ACT = 'A'
    order by STU_ID
    I spool it to csv file. The STUREF is a number field.
    The script does what it is suppose to do. The issue is there are lots of space in the spool file after STUREF field which I want to eliminate. I have tried RTRIM but it is not eliminating them.
    Any help please

    Hi HM
    I tried trimspool, but it didnot help me.
    @Ramesh: TRIM didnot help me either
    This is the script
    set linesize 192
    column studata format A190
    spool &OPPATH.ADD&RUN_NO..csv
    select
    'cn'||','||'Description'||','||'givenName'||','||'sn'||','||'initials'||','||'LastDigit'||','||'Stu_ID' studata
    from dual
    select
    STU_ID||','||CRSLIST||','||FIRST_NAME||','||SURNAME||','||MID_INITIAL||','||substr(rtrim(STU_ID),-1)||','||STUREF studata
    from LOC_STUEMAIL
    where STU_ACT = 'A'
    order by STU_ID
    spool off
    All the fields are fine except the last one.
    Edited by: user12951692 on 20-Apr-2012 03:53

  • How would I merge two csv files in Powershell

    Hello,
    I have two CSV Files.  Each has a list of virtual machines in them. One CSV file has the name of the VM as well as details about the RAM, CPU, VM Details (from VMM).  The other CSV File has the name of the VM as well as the IP address.
    How would I merge these two together?  For any VM's that do not exist in either file I wouldn't want to drop these VM names either. 
    Thanks.

    Thank you mjolinor for your suggestion.  This is not quite working for me.  What I'm seeing in the csv3.csv file all the  column details from the $firstCSV, and I'm seeing the headings included from the $secondCSV but all the details
    of the headings from the $secondCSV are empty.  Here is some more information for you:
    My $firstCSV file has the following headings:
    VMName  ChargedWA  BillingWA  VMOperatingSystem  VMHost  vCPUs  MemoryGB  StorageGB 
    My $secondCSV file has the following headings:
    VMName  IPAddress  SubnetMask  Gateway  DNSServers  MACAddress  device0  Totalspce0  freespce0  device1  Totalspce1  freespce1  device2  Totalspce2  freespce2
    Each CSV input file has in common the column of VMName.  Most values in VMName are common to both input files but there are some values in VMName that are not in the other input file.  I'm looking to find the following:
    When the same VMname exists in both files, write out all columns for that record from both files into the merged file.
    When a VM name is in $firstCSV but not the second...still write out this record with the values from the $firstCSV.  The column headings from the $secondCSV would be empty for this record.
    When a VM name is in $secondCSV but not the first...still write out this record with the values from the $secondCSV.  The column headings from the $firstCSV would be empty for this record.
    It's funny how I think I've described my issue in my initial post but as I describe it more I further define the details.  I hope I've described my issue for all to understand.
    Thank you.

  • How get output generated as csv file  by reading  by buffered reader and wr

    how get output generated as csv file by reading by buffered reader and writer

    String file_location = "C\temp\csv.txt");
    try {
         URL fileURL = getClass().getResource(file_location);
         if (fileURL != null){
              BufferedReader br = new BufferedReader(new InputStreamReader(fileURL.openStream()));
              String s = br.readLine();
              while (s != null)  {
                   if (!s.equals ("")) {
                        System.out.println(s);
                   s = br.readLine();
              br.close();
         else {
              // error
    catch (IOException ex){ex.printStackTrace();}rykk
    Message was edited by: a dummy
    rykk.

  • Help Me... How to get Data from CSV File...?

    Hi Everyone..!
    This is yajiv and am working in CS3 Photoshop platform. I know about Java Script. Is it possible to get the data from CSV files. Actually our client use to send us the CSV files which contains a lot of swatch name and reference files in one particular image name.
    Actually how we work on that CSV file is, first we copy file name to search that CSV file. then get the result to paste into layer name. This process continue till the end of swatch.
    Thank in Advance
    -yajiv

    > Is it possible to get the data from CSV files.
    Have you tried searching this forum?

  • How do I import a CSV file of contacts as a new contact list?

    How do I import a csv contact file in to my Thunderbird account as a separate Contact list?

    I have done everything I can think of. I have imported CSV files in the past, but now that i've upgraded Thunderbird, there is no option to import CSV files. It says
    Import Everything
    or select the type of material to import:
    Address Books
    Mail
    Feed Subscriptions
    Settings
    Filters
    I have tried all of them and nothing allows me to import anything but Outlook Express when I choose everything. The others give me some options, but I can only import outlook CSV files. I don't have Outlook on my computer, nor do I have Eurdora nor Windows live mail, which comes up under settings. Feeds will not accept CSV files. Nothing seems to take these files any more. I put them in Openoffice spreadsheet and tried to move them from there, but that didn't work either.

  • How to upload multiple .CSV files in the same time.

    Hi Legends,
    Can anyone please help me to resolve my issue?
    This is very urgent and critical.
    Description:
    We have two users.1)edw_user_dump
    2)prd_udm.
    We need to upload the xx.csv file at the same time for these two users in oracle forms.
    we have differentiated .csv file name based on the user names.
    the main problem is in the sql loader command the xx.csv file name is created but the data is not captured in the server (kentucky) .
    Below is my code for the upload.
    -- To delete the Part_Mast.log file from the client
    DECLARE
    pid WEBUTIL_HOST.PROCESS_ID;
    v_result PLS_INTEGER;
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    BEGIN
    v_result := WEBUTIL_HOST.Get_return_Code(pid ) ;
    host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
    host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    END;
    DECLARE
    l_success boolean:=FALSE;
    l_bare_filename varchar2(100):=NULL;
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    BEGIN
    -- Delete the content of the log and bad file
    host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
    --host('cat /dev/null > /tmp/Part_Mast.bad');
    -- Upload the data file to Application Server
    l_bare_filename := v_username||'_'||substr(:FIC_SOURCE,instr(:FIC_SOURCE,'\',-1)+1);
    l_success := webutil_file_transfer.Client_To_AS_with_progress
    (clientFile => :FIC_SOURCE
    ,serverFile => '/tmp/'||l_bare_filename
    ,progressTitle => 'Upload to Application Server in progress'
    ,progressSubTitle => 'Please wait'
    ,asynchronous => false
    ,callbackTrigger => null
    IF l_success THEN
    NULL;
    ELSE
    null;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE Form_Trigger_Failure;
    END;
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    begin
    host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
    host('cat /dev/null > /tmp/EDW_CF_IO_UPLOAD.bad');
    end;
    BEGIN
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    v_password varchar2(30) := GET_APPLICATION_PROPERTY(PASSWORD);
    v_connect_string varchar2(30) := GET_APPLICATION_PROPERTY(CONNECT_STRING);
    a_host varchar2(500);
    BEGIN
    a_host :='/tmp/'||v_username||'_'||'"CF615 IO Upload.csv"';
    host('sqlldr '||v_username||'/'||v_password||'@'||v_connect_string||' '|| 'control=/home/edw_bis/ctl/GLB_CF_IO_UPLOAD.CTL'||' '|| 'DATA=a_host'||' '|| 'LOG=/tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log SKIP=1 errors=200000 DIRECT=FALSE');
    dbms_output.put_line(a_host);
    END;
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    begin
    host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    EXCEPTION
    WHEN OTHERS THEN
    RAISE Form_Trigger_Failure;
    END;
    end;
    DECLARE
    al_id3 ALERT;
    al_button Number;
    BEGIN
    edw_user_dump.SANM_PRC_MERGE_CF_IO_UPLOAD(:global.v_plsql_res,:global.v_ins_rec,:global.v_upd_rec);
    IF NVL(:global.v_plsql_res,0) = 0 and (:global.v_ins_rec !=0 OR :global.v_upd_rec != 0 ) then
    al_id3 :=FIND_ALERT('ROWINS');
    SET_ALERT_PROPERTY(al_id3,alert_message_text,' Process Completed Successfully!'||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec);
    al_button := SHOW_ALERT( al_id3 );
    ELSIF (:global.v_plsql_res IN(-1,0) or :global.v_plsql_res > 0) and (:global.v_ins_rec =0 and :global.v_upd_rec = 0 and :global.v_del_rec =0 ) then
    al_id3 :=FIND_ALERT('ROWINS');
    SET_ALERT_PROPERTY(al_id3,alert_message_text,' Process Failed. Please Download the Log File '||CHR(10)||' Rows Failed : '||:global.v_plsql_res||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec);
    al_button := SHOW_ALERT( al_id3 );
    ELSE
    al_id3 :=FIND_ALERT('ROWINS');
    SET_ALERT_PROPERTY(al_id3,alert_message_text,'Please Download the Log File '||CHR(10)||' Rows Failed : '||:global.v_plsql_res||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec );
    al_button := SHOW_ALERT( al_id3 );
    END IF;
    EXCEPTION WHEN OTHERS THEN
    RAISE Form_Trigger_Failure;
    END;
    DECLARE
    v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
    begin
    host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    host('rm -rf /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
    end;
    Thanks in advance!
    Thanks,
    Madhusudhanan

    Madhusudhanan,
    A couple of observations. First; always list your exact Forms version (eg; 10.1.2.0.2 not 10g R2). In most cases, the solution is different depending on the Forms version. Second; why must you use Forms to kick off a SQL Loader process? This is a server-side process and should be initiated by a server side process. If you absolutely must use Forms to kick off the process, again we need your Forms version in order to offer any solutions. Based on your code sample, I can asusme you are at least using Forms 9i becuase you are using WebUtil.
    Is your Database and Application Server the same physical computer? If they are not, this would explain why your HOST command isn't working because HOST runs against the Application Server not the Database server.
    Third; have you considered using and External Table (if your RDBMS version supports them) for each of the files you are attempting to upload? In this instance, it would be helpful to know your RDBMS version as well. External Tables can be a little frustrating to set up the first time, but as with any new construct you use - it gets easier the more you use it.
    Fourth; are you getting any errors in your log file(s)? If so, what are the errors? Please list the full error message if you have one.
    Finally, with respects to your statement:
    Posted: Mar 18, 2011 2:30 PM - Madhu This is very urgent and critical.>
    You have to understand that forum contributers are all volunteers - this is not our full-time job. If your issue is truely urgent I suggest you open a Service Request (SR) with Oracle Support! ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • SQL* Loader Loading specific column from CSV file to the table

    Dear All,
    Iam Loading specific column from .CSV file to the oracle table.
    Could pls help how i can load only that cols into the table
    Eg: CSV file having id, Frst_name,Last_name, Address,Phone,Insurance etc
    out of this I want to load only Frst_name,Last_name columns to oracle table say fname and lname.
    Thanks in Adv.
    Junu

    Lily,
    I made some changes to your table def but you will get the idea
    -- Table EMPLOYEE
    CREATE TABLE EMPLOYEE
      EMPID        NUMBER                           NOT NULL,
      EMPNICKNAME  VARCHAR2(10 BYTE)                    NULL,
      FNAME        VARCHAR2(20 BYTE)                NOT NULL,
      MI           VARCHAR2(20 BYTE)                    NULL,
      LNAME        VARCHAR2(20 BYTE)                NOT NULL,
      FULLNAME     VARCHAR2(20 BYTE)                NOT NULL,
      HIREDATE     DATE                             DEFAULT SYSDATE               NOT NULL
    --  data file employee.dat
    1,amy,b,amy b
    2,cindy,d,cindy d
    3,eric,f,eric f
    4,gary,h,gary
    -- Control file : Employee.ctl ( you can use truncate, replace or append , see sqlldr for more options)
    load data
    Truncate into table employee
    fields terminated by ","
    optionally enclosed by '"'
    TRAILING NULLCOLS
    empId INTEGER EXTERNAL,
    FName char(20),
    LName char(20),
    FullName char(30)
    now to load use following or you can speicify infile in control fle
    sqlldr username/passowrd control=employee.ctl  data=employee.dat log=employee.log
    {code}
    Hope this help.
    Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can open a html, pdf files from the server (c:\foldername\filename)

    Hi all,
    I am developing an application. in this app i have to implement RMI.
    My problem is this, How can a client open a files from the server.
    all the html, pdf files are stored in the server's directory like C:\audit\filename.
    There is a folder on the server's C directory which contains all the html , pdf files.
    please tell me how can a client open a file from the server using RMI.
    Please send me the solution as soon as possible.
    Thanks & Regards
    Bhavishya

    That's doing it the hard way. Why not use HTTP or FTP?

  • I've used an external drive for time machine which has important files on it. After trying to back up my computer, it suddenly needed to be "repaired" by utilities. Now it's not being "seen" at all! How do I recover my important files off the drive?

    I've used an external drive for time machine which has important files on it. After trying to back up my computer, it suddenly needed to be "repaired" by utilities. Now it's not being "seen" at all! How do I recover my important files off the drive?

    If the external drive can be seen at all in Disk Utility, follow the instructions for repair here.

Maybe you are looking for

  • HT2305 I have a new computer with Windows 8 OS.  Do I need to install drivers so that my Ipod Nano will sync with this new computer:

    My daughter gave me a new Ipod (Nano) for Christmas.  I had no problem download my songs from my old Ipod (Shuffle) to the new one.  However - since I do not buy songs on a regular basis, I did not buy a new song until 4/29/13.  Now for information..

  • XP laf not working with 1.4.2 & vista

    I'm having trouble getting the XP look and feel on Vista with Java 1.4.2_14. Buttons and toolbar buttons are the worst. They look like "classic windows" with ugly square borders. It's the same on most versions I've tried although 1.5.0_11 and 1.6 loo

  • Increase in size due to upgrade?

    i've just upgraded latest install and have genuis installed - when i want to update my 160gb ipod I was told i had insufficient memory - over 24gb to be precise! I have not imstalled any more songs, only a few podasts - can someone please explain wha

  • ITunes 8 Visualizer Issue

    Whenever i use the New Visualizer on iTunes 8, it moves very laggy, and skips alot, unless i move my mouse around....as long as it's moving it's smooth and looks awesome. This occurs if i'm in regular or fullscreen mode. Any Idea's? P.S. I have a wir

  • Unable to launch Soundtrack Pro 2.0.1 (Fresh Install)

    I've just installed Logic Studio on a clean installation of Leopard (10.5.1) on my dual 2ghz G5. For some reason Soundtrack Pro 2.0.1 immediately quits upon launch with the error *"The application Soundtrack Pro quit unexpectedly."* I've attempted to