1

In Notepad++, how can I merge two lines in the stuation below?

RAW DATA    
26/11/15 26/11/15 1314  NEFT : CMS364134568 - CRE 
                        DIT CARD OPERATIONS       
26/11/15 26/11/15 1314  Cash Deposit              
27/11/15 27/11/15 1314  NEFT : CMS364860637 - CRE 
                        DIT CARD OPERATIONS       
27/11/15 27/11/15 1314  Cash Deposit              
30/11/15 30/11/15 1314  NEFT : CMS365476895 - CRE 
                        DIT CARD OPERATIONS       
30/11/15 30/11/15 1314  NEFT : CMS365573866 - CRE 
                        DIT CARD OPERATIONS       
30/11/15 30/11/15 1314  NEFT : CMS365623059 - CRE 
                        DIT CARD OPERATIONS

MERGED DATA                         
26/11/15 26/11/15 1314  NEFT : CMS364134568 - CREDIT CARD OPERATIONS       
26/11/15 26/11/15 1314  Cash Deposit              
27/11/15 27/11/15 1314  NEFT : CMS364860637 - CREDIT CARD OPERATIONS       
27/11/15 27/11/15 1314  Cash Deposit              
30/11/15 30/11/15 1314  NEFT : CMS365476895 - CREDIT CARD OPERATIONS       
30/11/15 30/11/15 1314  NEFT : CMS365573866 - CREDIT CARD OPERATIONS       
30/11/15 30/11/15 1314  NEFT : CMS365623059 - CREDIT CARD OPERATIONS

I tried several ways using Extended Mode and Regular Expressions , but cannot figure how to do the backspace part (get the DIT CARD OPERATIONS to Merge with CRE)

1

If I recognize the pattern well, you have:
space at the end of the line, then 24 spaces at the beginning of the next one, you need to remove them:

  • open find and replace dialog
  • check "regular expression"
  • find what: \n {24}
  • replace to: (nothing)
  • replace all

you can check it here


cannot figure how to do the backspace part

with regular expressions you don't insert backspace, just replace unnecessarily part to nothing.

Update:

Working with Windows text files, you need to use \r\n instead of \n

  • Whats happening is, it's moving ` DIT CARD OPERATIONS` to the beginning of the same line it's on, but not merging it with CRE – Norman Nov 24 '16 at 9:54
  • please see my edit – Máté Juhász Nov 24 '16 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.