开发者

emulate ENTER in .txt

Can someone please help in adding a command for enter in a .txt file to emulate enter.

Example:

12345enter548793enter.....

where an entry will be a number followe开发者_如何转开发d by enter to next field where the next number will be inserted etc.. so it will look like this:

12345
548793
etc...


There is a difference between an enter and a return (-- old skool typewriter stuff - check Wikipedia on that).

One is a carriage return and one is a line feed; the ASCII codes for those are 10 and 13, I'd say test and find out which one (if not both) you'll need.

Normally (in like C++,C#,etc) you'd post \r\n --> 10 13


Just add newlines in the file?

12345
548793
etc...


The script that is reading in your txt file should already recognize whichever EOL character the text editor used. Many scripting languages automatically understand the various EOLs when reading from a filehandle. If yours doesn't, you may have to compose a regex that looks for the most common ones.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜