0

I have a csv file having header ,data and footer. The file(ABC.csv) look like this :

 "A00",391,3456                  --- header
 "abcd",2324,"sdddd",58955
 "dfgg",3444,"fffff',14455
 "Z99",2                         ----footer

I am using UTL function to load this data to table . Can any one tell me how to avoid footer while loading this file .

Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
y2j
  • 207
  • 3
  • 5
  • 13
  • 2
    Perhaps you can show your existing code? It'll be easier to explain how to change what you have. And also mention whether the format is fixed - looks like Z99 denotes it's the footer and won't appear anywhere else, but maybe not. – Alex Poole Apr 16 '15 at 12:08
  • Yes last line is footer.Please can you provide me code for above example to avoid footer – y2j Apr 16 '15 at 12:12

1 Answers1

1

Buddy, can give you lazy instructions: here is the import funtion https://community.oracle.com/message/3250798#3250798 , you only should add your CSV line split and skip HEADER and FOOTER. Split line is here Splitting comma separated string in a PL/SQL stored proc. To skip header you should add yet another UTL_FILE.get_line, to skip footer you can look on one line ahead, to check if end is here.

Community
  • 1
  • 1
Ilia Maskov
  • 1,858
  • 16
  • 26