I have a data file with a fixed record length. There are no carriage returns or line feeds delimiting the records. How can I insert a carriage return linefeed pair at every X characters using Notepad++(where X is the record length)?
Answer: Using /n will be interpreted as a Carriage Return/Line Feed (CR/LF) when importing records. Using /n/n will separate paragraphs with a blank line in between.
CR and LF are control characters or bytecode that can be used to mark a line break in a text file. CR = Carriage Return ( \r , 0x0D in hexadecimal, 13 in decimal) — moves the cursor to the beginning of the line without advancing to the next line.
Carriage Return (CR): Also know as Cartridge return, It is a control character used to reset the position of the cursor to the beginning of the next line of a text file. Line Feed (LF): Also known as Newline Character or End Of Line Character (EOF) or line break.
I appreciate that it's not ideal, but I'm surprised no one offered this as a pure N++ solution
In a regular expression find/replace
Find:
(.{750})
Replace:
$1\r\n
Roughly translated as...
Find:
750 instances of any character and remember the characters.
Replace:
The 750 characters we just remembered followed by a new line.
Although, to be honest, I'd stick to the powershell approach for anything more than a one-off run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With