Inspired by what I'm doing at work right now.
Your program should take one parameter, the path to the file
It should convert all the windows style newlines (\r\n) to unix style (\n) and write the result back to the file
Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It only takes a minute to sign up.
Sign up to join this communityInspired by what I'm doing at work right now.
Your program should take one parameter, the path to the file
It should convert all the windows style newlines (\r\n) to unix style (\n) and write the result back to the file
Anonymous tacit prefix function.
10@3∘⎕NGET⎕NPUT{⍵1}
⎕NGET
get content,encoding,line-ending from argument file
10@3∘
replace the third element (line ending) with 10, meaning \n
⎕NPUT
put that into…
{⍵1}
the file name followed by an overwrite flag