I have a directory with thousands of csv files, each with 64 columns and 700+ lines. I would like to combine for importing into database tables.
Using cat, combining the files is no problem. However, each file represents a separate event, so when querying the database I would like to be able to extract just the lines from an individual file.
Is there a way to add an incrementing integer to each file before combing them?
for example:
log_file1
- a, b, c, d,...
- a, b, c, d,...
- a, b, c, d,...
log_file2
- a, b, c, d,...
- a, b, c, d,...
- a, b, c, d,...
to
log_file1
- 1, a, b, c, d...
- 1, a, b, c, d...
- 1, a, b, c, d...
log_file2
- 2, a, b, c, d...
- 2, a, b, c, d...
- 2, a, b, c, d...
Thanks