如何在同一文件中将 10 行以上的代码重复合并为 1 行

如何在同一文件中将 10 行以上的代码重复合并为 1 行

我有如下所述的 .txt 文件,

39063960    
Li D/C11 r..31/181,,-350505 Stra.ugh    
I.
Collins 
29052 Humi Street Center I Hillsdale Dr 
Mineral Point 53565 Tuesday, 07/13/1965
Cynthi 1 umfOrd Pi rk.ski (Sgm) 
Non ri nng
Atttached Si ngle -unii t   
95279148100-0805    
Debt
con. di a, on MAI Ad.enes 11440300  
347 3.62
107413.54   
Secured Laon 1353410.568 4E11388.6

LANCASTER POLLARD MORTGAGE COM rimbi rt 
fames
zi ngeser   
U T. R. No.ARSWf34/7U1-49899
N. I . N.La_351 g0b84-Dvb67- 281985 Articled Clerk -  
Legai Assistarrt Yes MISSOURI HOUSING DEV COMM Bank  
Of America Good 
39063965    
L iD/C11 r ._31#81_14-113096 muhlbauer
0..11 ina (Sma  
31299 Tiaani 91 iy Pry Rd. Grosvenor
Place   
Naval Supply Center 92132 Tuesday. 07/221975
631 ly fi el d  
j. car Ishaf fi r Moor rni n    
Attached
Mul t i - unit 95279148100-0828 
Debt consolidation FHLE
Advacen 
4400000 
420 4.48 42240 Secured
Loan 532224 1971200 
OPPENHEIMER MULTIFAMILY HAG
o bani on   
bruce foreman
ii.T.R . No AvsTb3 n74/3msds6,- 57817
M. I. No it La_35ig01,84-Dvb67- 307478 Graft Mosaic Yes  
CENTENNIAL MORTGAGE IN APPLGATE Master Card Goon
39063961    
L iD/CTI r  
351117 yvi nStead
it tyi davis (mcpo 818 03th St W 3, 1 Tg St I Pi 6.di 1 1 y  
Court Grand Rapids 49508 Thursdajy, 01/22/1959
pesternak   
b. n black  
Evnini ng   
SEMI
DETACHED    
95279148100-0812    
Debt consol i da i . n
Fanni ie Mae Mortgage   
13567000    
216 
4.49
253815.96   
Secured Loan 3198081.075 6091583
MBANK NATINONAL ASSOCIATE*  
Passaro 
Neese
D Enright   
U.T.R.No.REXfun02/hg53_213hR- 67973
N I . No4La_3Si g0b84 -D.67-284256 Ca re Ass) 93606 ,  
Home Care Assi sta. ,Home Care Organiser Yes GRADABRIDGE  
REAL ESTATE CAPITA Master Card Good 
39063966    
OD/C-11r ._31.81,-117080 LADBETTER
BOUDRY 29052 8 Hunri Street Center Ki 1 ton High Way, Apt  
wi 11 au ra estates 95945 Tuesday. 07/20/1943
liti chevsky Costello (csm) 
Afttnernnon
Manable dwellings 95279148100-0030  
Debt
consoli dation Fenn i e Mea Mortagege   
1643400 
476
3.88 12056.2    
Secured boon 151308 . 1624.
637639.2    
PRI4t.iDENTAL HD01003 PAIGE ASSOC
Ter.ce  
Raymond Bossem
U. T. R .No kbYcKni F73_wv57,11414 N.I.NORLA,Sdfd F- 
y7-61.293   
Dorec tor   
Yes 
NEW MEXICO t41G FIN
AUTHORITY   
Bank Of America 
Good

我希望这些单独的行合并为一行,如下所示,

39063960        Li D/C11 r..31/181,,-350505 Stra.ugh        I.  Collins     29052 Humi Street Center I Hillsdale Dr     Mineral Point 53565 Tuesday, 07/13/1965 Cynthi 1 umfOrd Pi rk.ski (Sgm)     Non ri nng  Atttached Si ngle -unii t       95279148100-0805        Debt    con. di a, on MAI Ad.enes 11440300      347 3.62    107413.54       Secured Laon 1353410.568 4E11388.6          LANCASTER POLLARD MORTGAGE COM rimbi rt     fames   zi ngeser       U T. R. No.ARSWf34/7U1-49899    N. I . N.La_351 g0b84-Dvb67- 281985 Articled Clerk -    Legai Assistarrt Yes MISSOURI HOUSING DEV COMM Bank     Of America Good     

39063965        L iD/C11 r ._31#81_14-113096 muhlbauer  0..11 ina (Sma      31299 Tiaani 91 iy Pry Rd. Grosvenor    Place       Naval Supply Center 92132 Tuesday. 07/221975    631 ly fi el d      j. car Ishaf fi r Moor rni n        Attached    Mul t i - unit 95279148100-0828     Debt consolidation FHLE Advacen     4400000     420 4.48 42240 Secured  Loan 532224 1971200     OPPENHEIMER MULTIFAMILY HAG o bani on       bruce foreman   ii.T.R . No AvsTb3 n74/3msds6,- 57817   M. I. No it La_35ig01,84-Dvb67- 307478 Graft Mosaic Yes     CENTENNIAL MORTGAGE IN APPLGATE Master Card Goon    

39063961        L iD/CTI r      351117 yvi nStead   it tyi davis (mcpo 818 03th St W 3, 1 Tg St I Pi 6.di 1 1 y     Court Grand Rapids 49508 Thursdajy, 01/22/1959  pesternak       b. n black      Evnini ng       SEMI    DETACHED        95279148100-0812        Debt consol i da i . n  Fanni ie Mae Mortgage       13567000        216     4.49    253815.96       Secured Loan 3198081.075 6091583    MBANK NATINONAL ASSOCIATE*      Passaro     Neese   D Enright       U.T.R.No.REXfun02/hg53_213hR- 67973 N I . No4La_3Si g0b84 -D.67-284256 Ca re Ass) 93606 ,   Home Care Assi sta. ,Home Care Organiser Yes GRADABRIDGE    REAL ESTATE CAPITA Master Card Good     

39063966        OD/C-11r ._31.81,-117080 LADBETTER  BOUDRY 29052 8 Hunri Street Center Ki 1 ton High Way, Apt   wi 11 au ra estates 95945 Tuesday. 07/20/1943   liti chevsky Costello (csm)     Afttnernnon Manable dwellings 95279148100-0030      Debt    consoli dation Fenn i e Mea Mortagege       1643400     476 3.88 12056.2        Secured boon 151308 . 1624. 637639.2        PRI4t.iDENTAL HD01003 PAIGE ASSOC   Ter.ce      Raymond Bossem  U. T. R .No kbYcKni F73_wv57,11414 N.I.NORLA,Sdfd F-    y7-61.293       Dorec tor       Yes     NEW MEXICO t41G FIN AUTHORITY       Bank Of America     Good

答案1

  1. 在 Notepad++ 中打开文件
  2. 按 Ctrl+H 或菜单项“搜索/替换”
  3. 在左下角的“搜索模式”中勾选“扩展”
  4. 在“查找内容”中输入\r并将“替换为”留空
  5. 点击“全部替换”

这样就行了。请注意,步骤 4\r适用于 Windows。如果您遇到任何问题,请尝试各种\r和组合,\n例如\r\n。只需输入两个字符\和- 在这种情况r\r,这不是任何特殊的组合键。

这样做的目的是用空字符替换“行尾”字符,以形成一条大行。

不同的操作系统有不同的行尾,尽管现在真正流行的只有 Windows 和 Linux。

如果有效,请告诉我们,因为它会在将来为其他人提供帮助。

答案2

  • Ctrl+H
  • 找什么:\R(?!390\d{5}\h*$)
  • 替换为:\t # 或您想要的任何空格
  • 检查环绕
  • 检查正则表达式
  • Replace all

解释:

\R          # any kind of linebreak (ie. \r, \n, \r\n)
(?!         # start negative lookahead, zero length assertion that make sure we haven't after
    390     # 390
    \d{5}   # 5 digits
    \h*     # 0 or more horizontal spaces
    $       # end of line
)           # end lookahead

替代品:

\t          # a tabulation, you may replace with what you want

给定示例的结果:

39063960        Li D/C11 r..31/181,,-350505 Stra.ugh        I.  Collins     29052 Humi Street Center I Hillsdale Dr     Mineral Point 53565 Tuesday, 07/13/1965 Cynthi 1 umfOrd Pi rk.ski (Sgm)     Non ri nng  Atttached Si ngle -unii t       95279148100-0805        Debt    con. di a, on MAI Ad.enes 11440300      347 3.62    107413.54       Secured Laon 1353410.568 4E11388.6      LANCASTER POLLARD MORTGAGE COM rimbi rt     fames   zi ngeser       U T. R. No.ARSWf34/7U1-49899    N. I . N.La_351 g0b84-Dvb67- 281985 Articled Clerk -    Legai Assistarrt Yes MISSOURI HOUSING DEV COMM Bank     Of America Good 
39063965        L iD/C11 r ._31#81_14-113096 muhlbauer  0..11 ina (Sma      31299 Tiaani 91 iy Pry Rd. Grosvenor    Place       Naval Supply Center 92132 Tuesday. 07/221975    631 ly fi el d      j. car Ishaf fi r Moor rni n        Attached    Mul t i - unit 95279148100-0828     Debt consolidation FHLE Advacen     4400000     420 4.48 42240 Secured  Loan 532224 1971200     OPPENHEIMER MULTIFAMILY HAG o bani on       bruce foreman   ii.T.R . No AvsTb3 n74/3msds6,- 57817   M. I. No it La_35ig01,84-Dvb67- 307478 Graft Mosaic Yes     CENTENNIAL MORTGAGE IN APPLGATE Master Card Goon
39063961        L iD/CTI r      351117 yvi nStead   it tyi davis (mcpo 818 03th St W 3, 1 Tg St I Pi 6.di 1 1 y     Court Grand Rapids 49508 Thursdajy, 01/22/1959  pesternak       b. n black      Evnini ng       SEMI    DETACHED        95279148100-0812        Debt consol i da i . n  Fanni ie Mae Mortgage       13567000        216     4.49    253815.96       Secured Loan 3198081.075 6091583    MBANK NATINONAL ASSOCIATE*      Passaro     Neese   D Enright       U.T.R.No.REXfun02/hg53_213hR- 67973 N I . No4La_3Si g0b84 -D.67-284256 Ca re Ass) 93606 ,   Home Care Assi sta. ,Home Care Organiser Yes GRADABRIDGE    REAL ESTATE CAPITA Master Card Good 
39063966        OD/C-11r ._31.81,-117080 LADBETTER  BOUDRY 29052 8 Hunri Street Center Ki 1 ton High Way, Apt   wi 11 au ra estates 95945 Tuesday. 07/20/1943   liti chevsky Costello (csm)     Afttnernnon Manable dwellings 95279148100-0030      Debt    consoli dation Fenn i e Mea Mortagege       1643400     476 3.88 12056.2        Secured boon 151308 . 1624. 637639.2        PRI4t.iDENTAL HD01003 PAIGE ASSOC   Ter.ce      Raymond Bossem  U. T. R .No kbYcKni F73_wv57,11414 N.I.NORLA,Sdfd F-    y7-61.293       Dorec tor       Yes     NEW MEXICO t41G FIN AUTHORITY       Bank Of America     Good

相关内容