2016-01-30 44 views
1

我的字的文件包含了一些數據,這些數據如下如何刪除從Microsoft Word多行

product/productId: 0784010927 
review/userId: A19V0VJMKKRMC8 
review/profileName: jj "Justin" 
review/helpfulness: 1/1 
review/score: 5.0 
review/time: 1031961600 
review/summary: one of my all tyime faves 
review/text: i am from this genration which makes me different because i like movies from the 80s. well this is a must see. 

product/productId: 0784010927 
review/userId: A3OZU2EMJQ5FIC 
review/profileName: danielle levin 
review/helpfulness: 1/1 
review/score: 5.0 
review/time: 1022025600 
review/summary: The Best in the world 
review/text: This movie has touched me so much it's great. The movie is about a a young girl who is a little daddy girl and does everything she is told until she met her love Johnny (Patrick Swayze). Baby (Jennifer Grey) learns not only how to dance 

但我想刪除它與每一個段落的評論\文本開始行的一部分。我的輸出應該是這樣的

product/productId: 0784010927 
review/userId: A3OZU2EMJQ5FIC 
review/profileName: danielle levin 
review/helpfulness: 1/1 
review/score: 5.0 
review/time: 1022025600 
review/summary: The Best in the world 

任何一個可以幫助我,請與使用Microsoft Word或任何其他解決方案的宏觀任何想法。

+0

您可以使用[POI Word](https://poi.apache.org/document/)。這是一個操縱word文件的Java API。 –

回答

0

嘗試

Sub Demo() 
     With Selection.Find 
     While .Execute(FindText:="review/text", Forward:=True) 
      If .Found = True Then 
      Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend 
      Selection.TypeBackspace 
      End If 
     Wend 
     End With 
End Sub 

一定要保持你的光標在文檔的起始位置。

+0

非常感謝...它正在工作.... –

+0

@MohammadHasan:考慮接受答案,以便社區可以知道這是工作解決方案。 – Rahul

+1

它工作正常 –