ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Delete lines starting with a string in a txt file predefined

<< < (4/5) > >>

Contro:
Yes. But seems don't delete the entire line that contains the string, or mantain if is the case.
 :-*
-Contro (January 27, 2014, 06:52 AM)
--- End quote ---
can you post a screenshot of these lines? maybe that could give a clue as to why they are not being deleted.
-lanux128 (January 27, 2014, 06:59 AM)
--- End quote ---
forgive me lanux128. I haven't tried. It just a thought the line will not be removed. The line contains the string, but you said that only the string will be removed in the copied file.
 :-[

lanux128:
forgive me lanux128. I haven't tried. It just a thought the line will not be removed. The line contains the string, but you said that only the string will be removed in the copied file.
 :-[
-Contro (January 27, 2014, 07:10 AM)
--- End quote ---
go ahead and try the method i have outlined. the beauty of this solution is that it wouldn't touch the original file so you can do a diff and see if the lines that you wanted gone are truly gone.

Contro:
 :-*
I am here again.
I have made exhaustive proofs because I don't was very convinced of the problem to solve.
But really PSPAD, under the conditions expressed by Lanux128 delete the entire line.
Consider this example :
dermatitis es la enfermedad
dermatitis es una enfermedad
la dermatitis es una enfermedad
la enfermedad conocida como dermatitis
una enfermedad conocida como dermatitis produce sufrimiento por la picazón

I want to delete all the lines that begins with "dermatitis" without quotes.
But the effect is that all the lines are deleted.....

But the point or interesting effect of this experiment is the PSpad interpretation of delete the entire line because we can't initially supposed that pspad will delete the entire line is simple encounter the string inside that line in any position.

I remember my wonderful dBASE III and the commands trim() ,left trim() , right trim() , substring() and so on. (Please I don't remember exactly, but I think was something similar). With those functions i can manipulate strings.

 :P

Contro:
So the conclusion is :

The above example is useful to delete all the lines that contains a predefined String
 :-*

skwire:
I want to delete all the lines that begins with "dermatitis" without quotes.
But the effect is that all the lines are deleted.....-Contro (January 27, 2014, 05:54 PM)
--- End quote ---

Follow lanux128's steps but check the "Regular Expressions" box and use this as a search string: ^dermatitis

Delete lines starting with a string in a txt file predefined

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version