I have a huge sized text file and I would like to split it based on:
- size (2GB each file; Last file could be less than 2GB)
- new line (files should split at the end of the new line)
- have new files as a text file
- and add
this is first line
at the beginning of each files
For example: for a file like this-
textdata1
textdata2
textdata3
textdata4
textdata5
textdata6
I would like to have output as: textfile_1.txt
this is first line
textdata1
textdata2
and may be- textfile_2.txt
this is first line
textdata3
textdata4
textdata5
textdata6
I tried with -b <size>
command but it splits right in the middle of the line.