[ILUGC] 1D1C - csplit

  • From: Dhanasekar <tkdhanasekar@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx, kanchilug@xxxxxxxxxxxxx
  • Date: Tue, 7 Jun 2022 06:00:00 +0530

csplit - split a file into sections determined by context lines
$ cat file.txt
one
two
three
four
five
six

To split file.txt into two parts (second part from 4 th line)
$ csplit file.txt 4
two files named xx00 and xx01 created

To prefix in abc in place of â€˜xx’ in output
$ csplit -f abc file.txt 4



regards,
T.Dhanasekar

---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on libera.chat

Other related posts:

  • » [ILUGC] 1D1C - csplit - Dhanasekar