How to replace ^M with a new line in perl

后端 未结 5 1623
时光说笑
时光说笑 2021-01-13 19:21

My test file has \"n\" number of lines and between each line there is a ^M, which in turn makes it one big string. The code I am working with opens said file and should par

5条回答
  •  旧时难觅i
    2021-01-13 20:04

    Did this file originate on a windows system? If so, try running the dos2unix command on the file before reading it. You can do this before invoking the perl script or inside the script before you read it.

提交回复
热议问题