in reply to Re^2: part - split up files according to column value
in thread part - split up files according to column value

jdporter's program has no option for headers. Did you mean to reply to my program?

If so, please do consider telling me how you invoke the program, and what the layout of the first few rows of your input file is and what you get for output, so that I can reproduce the problem.

  • Comment on Re^3: part - split up files according to column value

Replies are listed 'Best First'.
Re^4: part - split up files according to column value
by Anonymous Monk on Feb 08, 2011 at 12:25 UTC
    Yes - sorry I was referring to your program Corion. I invoke it using the following: part.pl filename -header-line=1 -column=3 The first line of the file contains the header. The output files are all correct, except for the lack of header. Here is sample input field1 field2 field3 split zweiradlinss 89803607 330525685618 3 zweiradlinss 89803607 310286767428 77 I am splitting on the last column. It generates two files. One for line 2 and another for line 3. Neither has the header row.

      Sorry terrible formatting. Input file is

      field1 field2 field3 split

      zweiradlinss 89803607 330525685618 3

      zweiradlinss 89803607 310286767428 77

        There is a bug in the program that makes it

        • handle the last column badly as key column if it has newlines at the end
        • not print the header at all

        I've tested the file against this data:

        field1,field2,field3,split zweiradlinss,89803607,330525685618,3 zweiradlinss,89803607,310286767428,77

        with this command line:

        perl -w part.pl part.csv --header-line=1 --column=3 "--separator=,"

        Thanks for the report! I've fixed the top version and updated it to v0.06.