Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

GIT Bash: How can I select *.txt files? How to split multiple large text into multiple text files?

hello. I want to split multiple large .txt file into multiple .txt files

 
I use this formula but isn't working with *.txt
 
split *.txt MyNewText -b 5m  (it working only one by one: "split bebe.txt MyNewText -b 5m" )
 
The *.txt should be replace in another syntax. Can you please help me?
3 Replies
Commander Lvl 2
Message 2 of 4

Re: GIT Bash: How can I select *.txt files? How to split multiple large text into multiple text file

First, split is a Linux command, not Git. So you can do man split to get more information.

 

The split command operates only on a single file. So you need to use Linux' looping capability.

 

You can google more for both, but from here is a possible answer:

for f in *.txt; do split $f -b 5m; done

[I don't have linux running right now so I cannot confirm.]

 

Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!

Copilot Lvl 2
Message 3 of 4

Re: GIT Bash: How can I select *.txt files? How to split multiple large text into multiple text file

:)                                               

Copilot Lvl 2
Message 4 of 4

Re: GIT Bash: How can I select *.txt files? How to split multiple large text into multiple text file

for f in *.txt; do split $f -b 5m; done

@fire-eggs Not working so good, your command selects only one file (random), not multiple files. Don't know why..