Skip to main content
added 728 characters in body
Source Link
ptrcao
  • 6k
  • 12
  • 38
  • 46

enter image description here

+------------+--------------+
| Category I | Sub-Category |
+------------+--------------+
|       1144 |          128 |
|       1144 |          128 |
|       1000 |          100 |
|       1001 |          100 |
|       1002 |          100 |
|       1002 |          100 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
+------------+--------------+

enter image description here

+-------------+--------------+-----------------------+
| Category ID | Sub-Category | Arbitrary New Heading |
+-------------+--------------+-----------------------+
|        1144 |          128 |               1144128 |
|        1144 |          128 |               1144128 |
|        1000 |          100 |               1000100 |
|        1001 |          100 |               1001100 |
|        1002 |          100 |               1002100 |
|        1002 |          100 |               1002100 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
+-------------+--------------+-----------------------+

enter image description here

enter image description here

+------------+--------------+
| Category I | Sub-Category |
+------------+--------------+
|       1144 |          128 |
|       1144 |          128 |
|       1000 |          100 |
|       1001 |          100 |
|       1002 |          100 |
|       1002 |          100 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1011 |          102 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
|       1013 |          103 |
+------------+--------------+
+-------------+--------------+-----------------------+
| Category ID | Sub-Category | Arbitrary New Heading |
+-------------+--------------+-----------------------+
|        1144 |          128 |               1144128 |
|        1144 |          128 |               1144128 |
|        1000 |          100 |               1000100 |
|        1001 |          100 |               1001100 |
|        1002 |          100 |               1002100 |
|        1002 |          100 |               1002100 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1011 |          102 |               1011102 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
|        1013 |          103 |               1013103 |
+-------------+--------------+-----------------------+
added 188 characters in body
Source Link
ptrcao
  • 6k
  • 12
  • 38
  • 46

What I have is a CSV file to this effect:

enter image description here

I wish to concatenate the first and second columns above to form a third, new column with a new arbitrary heading, to this effect:

enter image description here

My usual go-to utility, csvkit does not have the means to achieve this, afaik - see https://github.com/wireservice/csvkit/issues/930.

What is a simple solution not requiring advanced programming knowledge, which can achieve this?

I'm vaguely aware of awk and sed as potential solutions, but I don't want to limit the enquiry to those just in case there is a better (i.e. simpler) solution.

The solution must be efficient for very large files, i.e containing 120,000+ lines.

Edit: I have included the sample data for the convenience of those wanting to take a crack at it; download here: https://www.dropbox.com/s/achtyxg7qi1629k/category-subcat-test.csv?dl=0

What I have is a CSV file to this effect:

enter image description here

I wish to concatenate the first and second columns above to form a third, new column with a new arbitrary heading, to this effect:

enter image description here

My usual go-to utility, csvkit does not have the means to achieve this, afaik - see https://github.com/wireservice/csvkit/issues/930.

What is a simple solution not requiring advanced programming knowledge, which can achieve this?

I'm vaguely aware of awk and sed as potential solutions, but I don't want to limit the enquiry to those just in case there is a better (i.e. simpler) solution.

The solution must be efficient for very large files, i.e containing 120,000+ lines.

What I have is a CSV file to this effect:

enter image description here

I wish to concatenate the first and second columns above to form a third, new column with a new arbitrary heading, to this effect:

enter image description here

My usual go-to utility, csvkit does not have the means to achieve this, afaik - see https://github.com/wireservice/csvkit/issues/930.

What is a simple solution not requiring advanced programming knowledge, which can achieve this?

I'm vaguely aware of awk and sed as potential solutions, but I don't want to limit the enquiry to those just in case there is a better (i.e. simpler) solution.

The solution must be efficient for very large files, i.e containing 120,000+ lines.

Edit: I have included the sample data for the convenience of those wanting to take a crack at it; download here: https://www.dropbox.com/s/achtyxg7qi1629k/category-subcat-test.csv?dl=0

added 87 characters in body
Source Link
ptrcao
  • 6k
  • 12
  • 38
  • 46

What I have is a CSV file to this effect:

enter image description here

I wish to concatenate the first and second columns above to form a third, new column with a new arbitrary heading, to this effect:

enter image description here

My usual go-to utility, csvkit does not have the means to achieve this, afaik - see https://github.com/wireservice/csvkit/issues/930.

What is a simple solution not requiring advanced programming knowledge, which can achieve this?

I'm vaguely aware of awk and sed as potential solutions, but I don't want to limit the enquiry to those just in case there is a better (i.e. simpler) solution.

The solution must be efficient for very large files, i.e containing 120,000+ lines.

What I have is a CSV file to this effect:

enter image description here

I wish to concatenate the first and second columns above to form a third, new column with a new arbitrary heading, to this effect:

enter image description here

My usual go-to utility, csvkit does not have the means to achieve this, afaik - see https://github.com/wireservice/csvkit/issues/930.

What is a simple solution not requiring advanced programming knowledge, which can achieve this?

I'm vaguely aware of awk and sed as potential solutions, but I don't want to limit the enquiry to those just in case there is a better (i.e. simpler) solution.

What I have is a CSV file to this effect:

enter image description here

I wish to concatenate the first and second columns above to form a third, new column with a new arbitrary heading, to this effect:

enter image description here

My usual go-to utility, csvkit does not have the means to achieve this, afaik - see https://github.com/wireservice/csvkit/issues/930.

What is a simple solution not requiring advanced programming knowledge, which can achieve this?

I'm vaguely aware of awk and sed as potential solutions, but I don't want to limit the enquiry to those just in case there is a better (i.e. simpler) solution.

The solution must be efficient for very large files, i.e containing 120,000+ lines.

Source Link
ptrcao
  • 6k
  • 12
  • 38
  • 46
Loading