Skip to content
Advertisement

How to manipulate text lines and Create two separate files for odd and even

How to manipulate text lines and Create two separate files for odd and even ?

file 1:

JavaScript

file 2:

JavaScript

Advertisement

Answer

I’d say

JavaScript

This will print lines in inputfile that end with 1, 3, 5, 7, or 9 to file1 and all others to file2.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement