Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
remove-lines
- Page 1
Remove Lines Containg Specific Text
Programming
Software Development
13 Years Ago
by vb2learn
… want to
remove
the
lines
that contain specific text. (Whole Line) Eg: Textbox1.Text = [code]learn
lines
dani knows everything web knows
lines
lines
knows… daniweb everything dani everything
lines
[/code] So textbox1.text will become and
remove
whole line that contains…
Re: Remove Lines Containg Specific Text
Programming
Software Development
13 Years Ago
by codeorder
See if this helps to
remove
certain
lines
from a TextBox. [CODE]Public Class Form1…arTemp() As String = Nothing '// used to get all
lines
from TextBox. Private sTemp As String = Nothing '// used… selectedTextBox As TextBox) As String arTemp = selectedTextBox.
Lines
'// set all
lines
from TextBox into a String Array. sTemp = …
Re: Remove Lines Containg Specific Text
Programming
Software Development
13 Years Ago
by debasisdas
1. find the position of the word that you are looking for. 2. find the position of the previous and next new line character. 3. delete /
remove
everything in between. 4. go to step 1
remove lines
Programming
Software Development
8 Years Ago
by Pavol
Hi, I have text file where I have these
lines
with numbers: e, 1, 2 e, 1, 3 e, 2, 1 e, 3, 4 etc. I need
remove
similar
lines
, in this case line e, 2, 1. Is it possible?
Re: remove lines
Programming
Software Development
8 Years Ago
by Pavol
… e, 2, 1 e, 2, 3 etc. I need
remove
similar
lines
with the same numbers, but no matter on order this…
Python - Remove current and following 3 lines when two specified words in t
Programming
Software Development
11 Years Ago
by bintony.ma_1
…: http://www.daniweb.com/software-development/python/threads/436159/python-
remove
-
lines
-when-two-specified-words-in-the-same-line I am…. my task is to do the following Python
Remove
current and following 3
lines
when two specified words in the same line…
Re: Python - Remove current and following 3 lines when two specified words in t
Programming
Software Development
11 Years Ago
by bintony.ma_1
hi experts, I have a new quesiton following what I asked before: http://www.daniweb.com/software-development/python/threads/436159/python-
remove
-
lines
-when-two-specified-words-in-the-same-line
Re: Remove Lines Containg Specific Text
Programming
Software Development
13 Years Ago
by vb2learn
Thank You debasisdas But the example by codeorder worked. Thank You Codeorder. Marked As Resolved.
Re: remove lines
Programming
Software Development
8 Years Ago
by woooee
Please post the code you have tried so far, to be used as a starting point. The question can not be answered until we know how "e, 2, 1" is similar
Re: remove lines
Programming
Software Development
8 Years Ago
by David W
This may get you started ... # removeSimilarItems.py # # 2015-08-29 # lst = [ ['e', 1, 2], ['e', 2, 1], ['e', 1, 2], ['e', 2, 3] ] lst2 = [] for item in lst: if item in lst2 or [item[0], item[2], item[1]] in lst2: pass else: lst2.append( item ) print( lst ) print( lst2 )
Re: remove lines
Programming
Software Development
8 Years Ago
by Gribouillis
@David W This is also a universal problem with a known solution >>> lst = [ ['e', 1, 2], ['e', 2, 1], ['e', 1, 2], ['e', 2, 3] ] >>> lst2 = list(unique_everseen(lst, key=lambda x: tuple(sorted(x[1:3])))) >>> lst2 [['e', 1, 2], ['e', 2, 3]] unique_everseen is in the itertools module's documentation […
Re: remove lines
Programming
Software Development
8 Years Ago
by David W
@Gribouillis ... Thank you for the more Pythonic example code ... (and ref.) I suspected that might be the case in Python :)
removing lines from a file
Programming
Web Development
12 Years Ago
by bibiki
…write a simple script that lets me
remove
lines
from a file. I have an elementet…a drop down list, I would effectively
remove
a line from my file. But that…the element to be removed is selected $
lines
= file("elementet.txt");//I read…fopen($file, 'w');//open the file for writing foreach($
lines
as $num => $l){ //if the line…
Python - Remove lines when two specified words in the same line
Programming
Software Development
11 Years Ago
by bintony.ma
…0.00000000E+00 That i want to do is
remove
the line and the line after this line (if…= open("file_08.txt", "w")
lines
=f.readlines() f.close() count=-1 for line in…
lines
: count=count+1 if not line.strip(): continue else…
Re: Python - Remove lines when two specified words in the same line
Programming
Software Development
11 Years Ago
by bintony.ma_1
hi vegaseat, my purpose is to
remove
the line and the line after this line (…_file = open("file_08.txt", "w")
lines
=f.readlines() f.close() count=-1 for line in…
lines
: count=count+1 if not line.strip(): continue else:…
Re: Python - Remove lines when two specified words in the same line
Programming
Software Development
11 Years Ago
by TrustyTony
… to test details. Also you must add logic to join
lines
which belong to same data block as I notice your…
Hire/remove lines from gridview
Programming
Software Development
15 Years Ago
by nandoliveira
… like i need...ok, if isn't i want to
remove
/hide that line of the grid view... Is possible to…
Chart docking and remove lines
Programming
Software Development
9 Years Ago
by naz1234
…/3/ca00538d0c8223d401e1e81bfdf00d7d.PNG "align-center") and how to
remove
all this line in chart ? ![21.PNG](/attachments/large/3…
Re: Remove elements from an Array
Programming
Software Development
12 Years Ago
by JamesCherrill
Lines
17,18 are executed regardless of whether you have found the account to delete or not - they are outside the if test.
Re: Delete drawn lines
Programming
Software Development
15 Years Ago
by ahoest
…).ptSegDist(p) == 0.0) { System.out.println("clicked");
lines
.
remove
(i); //
lines
.
remove
(
lines
.get(i)); } } repaint(); } [/code] the thing is that it…
Re: How to keep the Lines drawn in Graphics g after repaint()
Programming
Software Development
12 Years Ago
by NormR1
Those are the choices I know of: save the
lines
in a list - this would allow you to
remove
lines
draw the
lines
on an image - this would not allow
lines
to be removed (they could be drawn over with background color)
Re: Help in shell Script(REmove lines from file)
Programming
Software Development
14 Years Ago
by issue9
… for testing! You're totally right, I oversaw the empty
lines
in the input file[s]. May you try this one…
Remove specific whitespace from a text &Compare 4 files and output result
Programming
Software Development
12 Years Ago
by erezz
… that contain the text below. I need to
Remove
specific whitespace from the text and to find if…"Cannot open file ".$file." for read"; @
lines
=<IN>; open (OUT, ">", $file… file ".$file." for write"; foreach $line (@
lines
) { $line =~ s/\s\d{2}\s | \s\…
Remove Duplicate Lines from a File
Programming
Software Development
17 Years Ago
by KevinADC
A bare-bones code snippet to
remove
duplicate
lines
from a file. There are a number of ways to …, but files with a few thousand
lines
or even a few tens of thousands of
lines
should be OK. The bigger the…
Re: Remove Duplicate while importing csv to mysql using php
Programming
Web Development
12 Years Ago
by ddymacek
…array since you used $data I'll use $
lines
as ardav suggested $
lines
= array(); while(!feof($handle)) { // …to only have unique values in your array $
lines
= array_unique($
lines
); echo "
lines
have been uniqued, new line count = &…is such a great way to work with arrays. foreach($
lines
as $line) { // eplode each line on the…
Re: Remove Duplicate Lines from a File
Programming
Software Development
15 Years Ago
by hindlem
… even easier in Haskell! [CODE=syntax] Set<String>
lines
= new HashSet<String>(); BufferedWriter bw = new BufferedWriter(new…[0].toString())); while(br.ready()) { String line = br.readLine(); if (
lines
.contains(line)) { bw.write(line); bw.newLine(); } else…
Re: Remove Item From richtextbox and Place Elsewhere
Programming
Software Development
13 Years Ago
by codeorder
…RichTextBox1 For Each rtbLine As String In .
Lines
'// loop thru all rtb1
lines
. If Not arlNamesToFind.Contains(rtbLine) Then…arlRtbLines.Add(rtbLine) '// add line to ArrayList for writing
lines
back. Else With RichTextBox2 If Not .Text = "…
Re: Remove Duplicate Lines from a File
Programming
Software Development
15 Years Ago
by hindlem
Shocking mistake there. :-) It should read... [code=java] if (!
lines
.contains(line)) { bw.write(line); bw.newLine();
lines
.add(line); } [/code]
Re: Remove Item From richtextbox and Place Elsewhere
Programming
Software Development
13 Years Ago
by codeorder
…. With RichTextBox1 For Each rtbLine As String In .
Lines
'// loop thru all rtb1
lines
. If Not rtbLine.Contains(sStringToFind) Then '// check first… Next .Clear() '// clear rtb1 for new input to write the
lines
back. For Each itm As String In arlRtbLines If Not…
Re: Remove Duplicate while importing csv to mysql using php
Programming
Web Development
12 Years Ago
by diafol
… the first row (header info??) $unique = array_unique($
lines
);//rename $
lines
to $entries if used the commented line above foreach…)"); [/CODE] This could be done with fewer
lines
by reusing variables perhaps or combining functions, but I … this would be clearer. The array_unique strips duplicate
lines
within the file. It has the advantage of …
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC