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

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.
  • Comment on Re^4: part - split up files according to column value

Replies are listed 'Best First'.
Re^5: part - split up files according to column value
by Anonymous Monk on Feb 08, 2011 at 12:27 UTC

    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.

        Great - thanks for fixing so quickly