0

I have a comma-delimited text file containing 4 header rows, the first of which has metadata that I'm trying to capture. However, it has only 8 columns while the rest of the file has significantly more columns. (83 in this case).

I've tried using a Row Sampling Transform to import only the first row. However, the Flat File connection manager for this file defines only the 8 columns, with all the delimiters being Comma (,), except the 8th column, which is delimited by [CR][LF].

This pattern is violated in the second row, where the 8th column is delimited by a Comma (,).

I have a separate Data Flow Task (using a different Connection Manager) that imports the rest of the file, so, for this Task, the rest of the file is trash, so to speak. Is there some way to ignore the rest of the file when I just want the first line?

4
  • This isn't a well formed CSV file. A CSV file should contain the same amount of columns per row, and should contain <=1 header row. If you have many header rows then you have a malformed CSV file. I would consider fixing the process that creates the file to create 4 files, instead. Commented Apr 16 at 19:31
  • I'm quite aware it's poorly formed. I have no control over the format. I'm just trying to make it work. Commented Apr 16 at 19:54
  • 1
    Youll need to build a bespoke solution then. You can't consume the file as a well-formed CSV; it's not one. Consider using a script component. Commented Apr 16 at 19:56
  • Well, you just confirmed my suspicion. Commented Apr 16 at 20:03

1 Answer 1

0

Apparently, the poorly formed CSV file precludes me using Row Sampling to peel off the first row only.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.