Editing a specific liine of text file - C++


 
Thread Tools Search this Thread
Top Forums Programming Editing a specific liine of text file - C++
Prev   Next
# 1  
Old 08-31-2010
Question Editing a specific liine of text file - C++

Is there any way to erase all the contents of a specific line of a text file and then write something on it?
e.g.
test.txt.old:

qwert
asdfg
zxcbv=0


test.txt.new

qwerty
asdfg
hello=0

is this possible with C++ ?Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Editing long text file

Good morning all, I have a machine running IRIX and I need to edit a text file on the terminal that is literally thousands of lines. Does anyone know the most efficient way to edit portions of files like these? Obviously simply using the vi command isn't going to work since I get a too many lines... (1 Reply)
Discussion started by: James C
1 Replies

2. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies

3. Shell Programming and Scripting

Help needed editing text file using the terminal

Hi, I have text file with the header like this tracking_id condition replicate FPKM XLOC_000001 alpha 1 10.3199 XLOC_000001 alpha 0 10.3686 XLOC_000001 alpha 2 15.5619 ... With the first column being genes, the second being the condition, the third... (5 Replies)
Discussion started by: 4galaxy7
5 Replies

4. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies

5. Shell Programming and Scripting

editing line in text file adding number to value in file

I have a text file that has data like: Data "12345#22" Fred ID 12345 Age 45 Wilma Dino Data "123#22" Tarzan ID 123 Age 33 Jane I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes: Data "1012345#22" Fred ID... (16 Replies)
Discussion started by: say170
16 Replies

6. Shell Programming and Scripting

Assigning a specific format to a specific column in a text file using awk and printf

Hi, I have the following text file: 8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm 9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm 10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm 11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies

7. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

8. Shell Programming and Scripting

Adding specific text and spaces to each line in a text file

Hi, I wanted to add specific text to each row in a text file containing three rows. Example: 0 8 7 6 5 5 7 8 9 0 7 9 7 8 9 0 1 2 And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this: 21 0 8 7 6 5 5 7 8... (4 Replies)
Discussion started by: hertingm
4 Replies

9. Shell Programming and Scripting

text file editing

Hi, I need some help in text manipulation. I have an input file like this: 7629 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER, " W35AW - Various Shopping Pgms W41CF - TBN W47CV - TBN WLLS-LP 49 - AM1 WATCH WPXI 11 N & WPIX 11 CW 1234 "WPCW 19 - CW/AM1,... (26 Replies)
Discussion started by: injeti
26 Replies
Login or Register to Ask a Question
tooltip(3tk)							Tooltip management						      tooltip(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
tooltip - Tooltip management SYNOPSIS
package require Tcl 8.4 package require msgcat 1.3 package require tooltip ?1.4.4? ::tooltip::tooltip command ?options? ::tooltip::tooltip pathName ?option arg? message _________________________________________________________________ DESCRIPTION
This package provides tooltips, small text messages that can be displayed when the mouse hovers over a widget, menu item, canvas item, listbox item or text widget tag. COMMANDS
::tooltip::tooltip command ?options? Manage the tooltip package using the following subcommands. clear index Prevents the specified widgets from showing tooltips. pattern is a glob pattern and defaults to matching all widgets. delay ?millisecs? Query or set the hover delay. This is the interval that the pointer must remain over the widget before the tooltip is dis- played. The delay is specified in milliseconds and must be greater than 50ms. With no argument the current delay is returned. fade ?boolean? Enable or disable fading of the tooltip. The is enabled by default on Win32 and Aqua. The tooltip will fade away on Leave events instead disappearing. disable off Disable all tooltips enable on Enables tooltips for defined widgets. ::tooltip::tooltip pathName ?option arg? message This command arranges for widget pathName to display a tooltip with message message. The tooltip uses a late-binding msgcat call on the passed in message to allow for on-the-fly language changes in an application. If the widget specified is a menu, canvas or text widget then additional options are used to tie the tooltip to specific menu entries, canvas items or text tags. -index index This option is used to set a tooltip on a menu item. The index may be either the entry index or the entry label. The widget must be a menu widget but the entries do not have to exists when the tooltip is set. -items name This option is used to set a tooltip for canvas widget or listbox items. For the canvas widget, the item must already be present in the canvas widget and will be found with a find withtag lookup. For listbox widgets the item(s) may be created later but the programmer is responsible for managing the link between the listbox item index and the corresponding tooltip. If the listbox items are re-ordered, the tooltips will need amending. If the widget is not a canvas or listbox then an error is raised. -tag name The -tag option can be used to set a tooltip for a text widget tag. The tag should already be present when this command is called or an error will be returned. The widget must also be a text widget. EXAMPLE
# Demonstrate widget tooltip package require tooltip pack [label .l -text "label"] tooltip::tooltip .l "This is a label widget" # Demonstrate menu tooltip package require tooltip . configure -menu [menu .menu] .menu add cascade -label Test -menu [menu .menu.test -tearoff 0] .menu.test add command -label Tooltip tooltip::tooltip .menu.test -index 0 "This is a menu tooltip" # Demonstrate canvas item tooltip package require tooltip pack [canvas .c] set item [.c create rectangle 10 10 80 80] tooltip::tooltip .c -item $item "Canvas item tooltip" # Demonstrate listbox item tooltip package require tooltip pack [listbox .lb] .lb insert 0 "item one" tooltip::tooltip .lb -item 0 "Listbox item tooltip" # Demonstrate text tag tooltip package require tooltip pack [text .txt] .txt tag configure TIP-1 -underline 1 tooltip::tooltip .txt -tag TIP-1 "tooltip one text" .txt insert end "An example of a " {} "tooltip" TIP-1 " tag. " {} KEYWORDS
balloon, help, hover, tooltip COPYRIGHT
Copyright (c) 1996-2008, Jeffrey Hobbs tooltip 1.4.4 tooltip(3tk)