Sunday, May 5, 2024
24
rated 0 times [  24] [ 0]  / answers: 1 / hits: 39871  / 2 Years ago, wed, march 23, 2022, 4:46:21

The situation:



I have a text file which is about 1.5GB containing about 4000000 lines.



I want to import this to Libreoffice calc and as u know you can't import this huge file with large number of lines(i think maximum is 65000 line).



Anyway what i need is a simple command that can split this file into smaller files with number of lines in each file < 65000 line.


More From » command-line

 Answers
1

You can use the split command:



split -l N /path-to-file


Where N is the maximum number of lines that could be in a file.



This command will split the file into smaller files each with N number of lines.



Use man split for more info.


[#27252] Friday, March 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
earxcept

Total Points: 310
Total Questions: 115
Total Answers: 111

Location: Japan
Member since Sat, Oct 2, 2021
3 Years ago
;