BBedit separate lines?

Hi,
I have a file with about 800,000 lines, is it possible to create a new file for every 50,000 lines? if so how?
e.g. data is exported every 50,000 lines to a separate file on BBedit. So I should end up with 16 more files containing 50,000 lines each.

Many thanks.

Use the shell split command

split -l 50000 input.txt outputfilename
1 Like

Hi,
Thank you for this, is this an action in KM? I am not sure how to execute it.

You can run it from Terminal. Just start Terminal, and type in (or paste in) the above command, with your file names.

If the paths to your input or output file contain spaces, then enclose them in quotes.

1 Like

split: outputfilenameaa: Permission denied

Show the exact text you typed in (you can use the mouse to select it, then do Cmd+C).

I sent you a private message because of the location of the file is on the there…

I don’t think the location is an issue, security-wise, but that’s cool.

Here’s an edited version:

split -l 50000 /Users/whatever/wherever/Data/"ALL PURCHASED NUMBERS.txt" outputfilename

Try something like this:

split -l 50000 "/Users/whatever/wherever/Data/ALL PURCHASED NUMBERS.txt" "/Users/whatever/wherever/Data/SPLIT PURCHASED NUMBERS"

See how that works.

1 Like

AMAZING, many thanks.

How would I get it as a .txt?

I’m not sure. Perhaps someone else can chime in.

Rename the files afterwards.