Search Results

Search found 36970 results on 1479 pages for 'copying text'.

Page 17/1479 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Reading a text file in c++

    - by Yavuz Karacabey
    string numbers; string fileName = "text.txt"; ifstream inputFile; inputFile.open(fileName.c_str(),ios_base::in); inputFile >> numbers; inputFile.close(); cout << numbers; And my text.txt file is: 1 2 3 4 5 basically a set of integers separated by tabs. The problem is the program only reads the first integer in the text.txt file and ignores the rest for some reason. If I remove the tabs between the integers it works fine, but with tabs between them, it won't work. What causes this? As far as I know it should ignore any white space characters or am I mistaken? If so is there a better way to get each of these numbers from the text file?

    Read the article

  • Text wrap in a <canvas> element

    - by Gwood
    I am trying to add text on an image using the <canvas> element. First the image is drawn and on the image the text is drawn. So far so good. But where I am facing a problem is that if the text is too long, it gets cut off in the start and end by the canvas. I don't plan to resize the canvas, but I was wondering how to wrap the long text into multiple lines so that all of it gets displayed. Can anyone point me at the right direction?

    Read the article

  • Conditionaly strip the last line from a text file

    - by fraXis
    Hello, I posted this yesterday on SO, and I received an answer that works great, but I need to change it around and I don't know how. Here is my original message: I need to strip the last line from a text file. I know how to open and save text files in C#, but how would I strip the last line of the text file? The text file will always be different sizes (some have 80 lines, some have 20). Can someone please show me how to do this? Here is the code that someone gave me to do this (which works fine) //Delete the last line from the file. This line could be 8174, 10000, or anything. This is from SO string tempfile = @"C:\junk_temp.txt"; using (StreamReader reader2 = new StreamReader(newfilename)) { using (StreamWriter writer2 = new StreamWriter(tempfile)) { string line = reader2.ReadLine(); while (!reader2.EndOfStream) { writer2.WriteLine(line); line = reader2.ReadLine(); } // by reading ahead, will not write last line to file } } File.Delete(newfilename); File.Move(tempfile, newfilename); File.Delete(tempfile); How would I change this to only delete the last line of the text file if it is a 4 or 5 digit string (such as 8001 or 99999). If it is anything other than that, such as a %, then I don't want to delete the last line. Can someone please modify the above code to do this for me? Thanks so much.

    Read the article

  • Justify Text in a HTML/XHTML TextArea

    - by Matt
    I am currently trying to justify text in a textarea, unfortunately the CSS: text-align: justify; Doesn't work on the text like center, left and right do. I've tried this in both Firefox 3 and IE 7 with no luck. Is there any way around this?

    Read the article

  • MS SQL Server Text Datatype Maxlength = 65,535?

    - by craigmj
    Software I'm working with uses a text field to store XML. From my searches online, the text datatype is supposed to hold 2^31 - 1 characters. Currently SQL Server is truncating the XML at 65,535 characters every time. I know this is caused by sqlserver, because if I add a 65,536th character to the field directly in Management Studio, it states that it will not update because characters will be truncated. Is the Maxlength really 65,535 or could this be because the database was designed in an earlier version of MS SQL Server (2000) and it's using the legacy text datatype instead of 2005's? If this is the case, will Altering the datatype to Text in sql server 2005 fix this issue?

    Read the article

  • How to convert Xml files to Text Files

    - by John
    Hi all, I have around 8000 xml files that needs to be converted into text files. The text file must contain title, description and keywords of the xml file without the tags and removing other elements and attributes as well. In other words, i need to create 8000 text files containing the title,description and keywords of the xml file. I need codings for this to be done systematically. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • How to justify text on a TextView made easy- Android

    - by Juan
    I'm looking for a simple way to forget that I'm using a WebView to have justified text in my TextView. Has someone made a custom view for this? I'm well aware that I can do something like this: WebView view = new WebView(this); view.loadData("my html with text justification","text/html","utf-8"); But it gets ugly when you want to set the size, the color or other common properties of the TextView, there must be a more convenient way of doing it.

    Read the article

  • loading Data in VBA from a text file

    - by omegayen
    I am not very familiar with VBA but need to use it for a new software program I am using (not Microsoft related) I have a text file that has columns of data I would like to read into VBA. Specifically the text file has 4 entries per row. Thus I would like to load in the column vectors (N by 1). The text file is separated by a space between each entry. So for example I want to load in column one and save it as array A, then column two and save as array B, then column three and save as array C, and then column four and save as array D. This code snippet found below from http://www.tek-tips.com/faqs.cfm?fid=482 is something I found that can load in text to an array, but I need to adapt it to be able to save the columns as different arrays as specified above... Open "MyFile.txt" For Input As #1 ReDim Txt$(0) Do While Not EOF(1) ReDim Preserve Txt$(UBound(Txt$) + 1) Input #1, Txt$(UBound(Txt$)) Loop Close #1

    Read the article

  • predict location of single-line text from a UITextView

    - by William Jockusch
    Is this possible? Specifically, I have a UITextView, and the text is short enough that it will fit on a single line. I want to predict where it will appear, so that (for example) if I wanted to, I could set up a UILabel that rendered the text in exactly the same location. Once I get that figured out, what I really want to do is pick contentInset and/or contentOffset so that the text of the UITextView and the left-justified UILabel will render in the same location. But I figure the above will let me do that. EDIT: In response to a comment, the fundamental problem I am trying to get around is that UITextField does not let you set the location of the cursor. It appears a lot of people have tried to get around this without success. I need to be able to move the cursor -- inserting/deleting text there is not enough. Control cursor position in UITextField Insert string at cursor position of UITextField Moving the cursor to the beginning of UITextField iOS -- dealing with the inability to set the cursor position in a UITextField

    Read the article

  • Replacement Text Syntax for JavaScript’s String.replace()

    - by Jan Goyvaerts
    A RegexBuddy user told me that he couldn’t easily find a detailed explanation of the replacement text syntax supported by the String.replace() function in JavaScript. I had to admin that my own web page about JavaScript’s regular expression support was also lacking. I’ve now added a new Replacement Syntax section that has all the details. I’ll summarize it here: $1: Text matched by the first capturing group or the literal text $1 if the regex has no capturing groups. $99: Text matched by the 99th capturing group if the regex has 99 or more groups. Text matched by the 9th capturing group followed by a literal 9 if the regex has 9 or more but less than 99 groups. The literal text $99 if the regex has fewer than 9 groups. $+: Text matched by the highest-numbered capturing group. Replaced with nothing if the highest-numbered group didn’t participate in the match. $&: Text matched by the entire regex. You cannot use $0 for this. $` (backtick): Text to the left of the regex match. $' (single quote): Text to the right of the regex match. $_: The entire subject string.

    Read the article

  • WYSIWYG editor for structured text (suitable for SVN versioning)

    - by chris_l
    I'm looking for an open source cross platform WYSIWYG editor that I can use to write documentation. I'm not looking for a web based solution - i.e. it should work without a web server, and I want to save my files directly to disk. The result could be any structured format, like Wiki markup, ReStructuredText, DocBook, or a small subset of HTML, ... But it's important, that Subversion diff can be used to see differences between the versions easily (this wouldn't work with .odt or .rtf files for example) I'm currently thinking about using Open Office, and saving the files as HTML, but is there a better solution?

    Read the article

  • Good text editors or viewers for large log files

    - by Kristopher Johnson
    Log files and other textual data files are often tens or hundreds of megabytes in size, and some editors choke when you try to open something so large. What are some good applications for viewing large files? Bonus points for apps that can open compressed files, search for things with regular expressions, parse output lines, etc.

    Read the article

  • Using CTAS & Exchange Partition Replace IAS for Copying Partition on Exadata

    - by Bandari Huang
    Usage Scenario: Copy data&index from one partition to another partition in a partitioned table. Solution: Create a partition definition Copy data from one partition to another partiton by 'Insert as select (IAS)' Create a nonpartitioned table by 'Create table as select (CTAS)' Convert a nonpartitioned table into a partition of partitoned table by exchangng their data segments. Rebuild unusable index Exchange Partition Convertion Mutual convertion between a partition (or subpartition) and a nonpartitioned table Mutual convertion between a hash-partitioned table and a partition of a composite *-hash partitioned table Mutual convertiton a [range | list]-partitioned table into a partition of a composite *-[range | list] partitioned table. Exchange Partition Usage Scenario High-speed data loading of new, incremental data into an existing partitioned table in DW environment Exchanging old data partitions out of a partitioned table, the data is purged from the partitioned table without actually being deleted and can be archived separately Exchange Partition Syntax ALTER TABLE schema.table EXCHANGE [PARTITION|SUBPARTITION] [partition|subprtition] WITH TABLE schema.table [INCLUDE|EXCLUDING] INDEX [WITH|WITHOUT] VALIDATION UPDATE [INDEXES|GLOBAL INDEXES] INCLUDING | EXCLUDING INDEXES Specify INCLUDING INDEXES if you want local index partitions or subpartitions to be exchanged with the corresponding table index (for a nonpartitioned table) or local indexes (for a hash-partitioned table). Specify EXCLUDING INDEXES if you want all index partitions or subpartitions corresponding to the partition and all the regular indexes and index partitions on the exchanged table to be marked UNUSABLE. If you omit this clause, then the default is EXCLUDING INDEXES. WITH | WITHOUT VALIDATION Specify WITH VALIDATION if you want Oracle Database to return an error if any rows in the exchanged table do not map into partitions or subpartitions being exchanged. Specify WITHOUT VALIDATION if you do not want Oracle Database to check the proper mapping of rows in the exchanged table. If you omit this clause, then the default is WITH VALIDATION.  UPADATE INDEX|GLOBAL INDEX Unless you specify UPDATE INDEXES, the database marks UNUSABLE the global indexes or all global index partitions on the table whose partition is being exchanged. Global indexes or global index partitions on the table being exchanged remain invalidated. (You cannot use UPDATE INDEXES for index-organized tables. Use UPDATE GLOBAL INDEXES instead.) Exchanging Partitions&Subpartitions Notes Both tables involved in the exchange must have the same primary key, and no validated foreign keys can be referencing either of the tables unless the referenced table is empty.  When exchanging partitioned index-organized tables: – The source and target table or partition must have their primary key set on the same columns, in the same order. – If key compression is enabled, then it must be enabled for both the source and the target, and with the same prefix length. – Both the source and target must be index organized. – Both the source and target must have overflow segments, or neither can have overflow segments. Also, both the source and target must have mapping tables, or neither can have a mapping table. – Both the source and target must have identical storage attributes for any LOB columns. 

    Read the article

  • Looking for Linux text editor

    - by Daniel
    I'm looking for VIM replacement. My key points are: Extensible in sane language (such as Python, Ruby, or even Lua, after vimscript everything will do). Also GUI part should be extensible too, so no SublimeText2. GUI. Preferrably GTK+. Lightweight. I don't understand IDEs like Eclipse/NetBeans consuming up to 1G of RAM. File browser panel. Splits, tabs and windows. There should be ability to split views tabs infinite number of times (or while they fit to screen). VCS support (optional: especially Git) Snippets & autocompletion (not mandatory, but I would very love to have those) Any ideas?

    Read the article

  • MSSQL: Copying data from one database to another

    - by DigiMortal
    I have database that has data imported from another server using import and export wizard of SQL Server Management Studio. There is also empty database with same tables but it also has primary keys, foreign keys and indexes. How to get data from first database to another? Here is the description of my crusade. And believe me – it is not nice one. Bugs in import and export wizard There is some awful bugs in import and export wizard that makes data imports and exports possible only on very limited manner: wizard is not able to analyze foreign keys, wizard wants to create tables always, whatever you say in settings. The result is faulty and useless package. Now let’s go step by step and make things work in our scenario. Database There are two databases. Let’s name them like this: PLAIN – contains data imported from remote server (no indexes, no keys, no nothing, just plain dumb data) CORRECT – empty database with same structure as remote database (indexes, keys and everything else but no data) Our goal is to get data from PLAIN to CORRECT. 1. Create import and export package In this point we will create faulty SSIS package using SQL Server Management Studio. Run import and export wizard and let it create SSIS package that reads data from CORRECT and writes it to, let’s say, CORRECT-2. Make sure you enable identity insert. Make sure there are no views selected. Make sure you don’t let package to create tables (you can miss this step because it wants to create tables anyway). Save package to SSIS. 2. Modify import and export package Now let’s clean up the package and remove all faulty crap. Connect SQL Server Management Studio to SSIS instance. Select the package you just saved and export it to your hard disc. Run Business Intelligence Studio. Create new SSIS project (DON’T MISS THIS STEP). Add package from disc as existing item to project and open it. Move to Control Flow page do one of following: Remove all preparation SQL-tasks and connect Data Flow tasks. Modify all preparation SQL-tasks so the existence of tables is checked before table is created (yes, you have to do it manually). Add new Execute-SQL task as first task in control flow: Open task properties. Assign destination connection as connection to use. Insert the following SQL as command:   EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' GO   EXEC sp_MSForEachTable 'DELETE FROM ?' GO   Save task. Add new Execute-SQL task as last task in control flow: Open task properties. Assign destination connection as connection to use. Insert the following SQL as command:   EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' GO   Save task Now connect first Execute-SQL task with first Data Flow task and last Data Flow task with second Execute-SQL task. Now move to Package Explorer tab and change connections under Connection Managers folder. Make source connection to use database PLAIN. Make destination connection to use database CORRECT. Save package and rebuilt the project. Update package using SQL Server Management Studio. Some hints: Make sure you take the package from solution folder because it is saved there now. Don’t overwrite existing package. Use numeric suffix and let Management Studio to create a new version of package. Now you are done with your package. Run it to test it and clean out all the errors you find. TRUNCATE vs DELETE You can see that I used DELETE FROM instead of TRUNCATE. Why? Because TRUNCATE has some nasty limits (taken from MSDN): “You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint; instead, use DELETE statement without a WHERE clause. Because TRUNCATE TABLE is not logged, it cannot activate a trigger. TRUNCATE TABLE may not be used on tables participating in an indexed view.” As I am not sure what tables you have and how they are used I provided here the solution that should work for all scenarios. If you need better performance then in some cases you can use TRUNCATE table instead of DELETE. Conclusion My conclusion is bitter this time although I am very positive guy. It is A.D. 2010 and still we have to write stupid hacks for simple things. Simple tools that existed before are long gone and we have to live mysterious bloatware that is our only choice when using default tools. If you take a look at the length of this posting and the count of steps I had to do for one easy thing you should treat it as a signal that something has went wrong in last years. Although I got my job done I would be still more happy if out of box tools are more intelligent one day. References T-SQL Trick for Deleting All Data in Your Database (Mauro Cardarelli) TRUNCATE TABLE (MSDN Library) Error Handling in SQL 2000 – a Background (Erland Sommarskog) Disable/Enable Foreign Key and Check constraints in SQL Server (Decipher)

    Read the article

  • Copying files to Truecrypt file container hangs

    - by Wagner Maestrelli
    I have a dual boot installation with Windows 7 Ultimate (32-bits, NTFS file sytem) and Ubuntu 10.10 (32-bits, ext4 file system). I have installed the version 7.0a of Truecrypt in both Operating Systems. Located in the Windows 7 HDD I have a 150 GB encrypted file container. It is a standard and dynamic file container, which means it's not hidden and uses a sparse file. This file was created using the Windows version of the Truecrypt program. When I logon in Windows the container is mounted as the drive E: and everything works fine! In Ubuntu the Windows's NTFS file system is automaticaly mounted after I logon. I've configured that using the ntfs-config package. In my ~/.profile I have this line to mount the truecrypt's file container: truecrypt /media/7EDEBCFADEBCABB1/Users/Wagner/hd/hd.tc /media/truecrypt1 The file container is mounted after the logon without any problem. I can access it, copy files to/from it, etc. But when I try do copy relatively large amounts of data (~50 MB) to it via nautilus or cp -R, it starts the copy, copies some data until certain point and then it just hangs! The progress bar does not move anymore and nothing happens. There is no error, it just hangs and that's it. I have to kill the process myself. This problem does not happen in Windows: I can copy very large amounts of data to the container and it works great. But in Ubuntu the problem always happens! I mean, whenever I try to copy a bunch of files together the copy process hangs. Does anyone ever faced this problem? Can anyone help? Thanks!

    Read the article

  • Copying logins to another server

    - by DavidWimbush
    I'm busy setting up a new server to replace our main live server and part of that is to get the logins copied over. The database users will come over when I restore the databases but I wanted to get the logins they relate to, with the same SIDs, passwords and other properties as they have on the current server. In fact I don't even know the passwords for the logins created by our Sage accounting package - apparently they are generated by the setup using a number of ingredients unique to each installation. I did some Googling and fount this KB article: http://support.microsoft.com/kb/918992/, which more or less did the trick. It produces a set of CREATE LOGIN statements with the SIDs and hashed passwords. But it didn't include the default language, which can subtly or dramatically alter the behaviour of date-related SQL. So I added that bit and you can help yourself here.

    Read the article

  • Modify Sublime Text 2 whitespace representation?

    - by Mike Grace
    Is there a way to modify the whitespace representation characters so I can change it from dots and dashes to something else? Because I currently have whitespace characters being drawn always, it looks like this. I don't need it turned off, just interested in changing how it's represented. I like how TextMate shows invisible characters but I would be ok with just being able to change the spaces to show a blank space instead of a dot.

    Read the article

  • Preventing Users From Copying Text From and Pasting It Into TextBoxes

    Many websites that support user accounts require users to enter an email address as part of the registration process. This email address is then used as the primary communication channel with the user. For instance, if the user forgets her password a new one can be generated and emailed to the address on file. But what if, when registering, a user enters an incorrect email address? Perhaps the user meant to enter <code>[email protected]</code>, but accidentally transposed the first two letters, entering <code>[email protected]</code>. How can such typos be prevented?The only foolproof way to ensure that the user's entered email address is valid is to send them a validation email upon registering that includes a link that, when visited, activates their account. (This

    Read the article

  • Recovering text files in terminal using grep on Mac OS X Snow Leopard

    - by littlejim84
    I foolishly removed some source code from my Mac OS X Snow Leopard machine with rm -rf when doing something with buildout. I want to try and recover these files again. I haven't touched the system since to try and seek an answer. I found this article and it seems like the grep method is the way to go, but when running it on my machine I'm getting 'Resource busy' when trying to run it on the disk. I'm using this command: sudo grep -a -B1000 -A1000 'video_output' /dev/disk0s2 > file.txt Where 'dev/disk0s2' is what came up when I ran df. I get this when running: grep: /dev/disk0s2: Resource busy I'm not an expert with this stuff, I'm trying my best. Please can anyone help me further? I'm on the verge of losing two days of source code work! Thank you

    Read the article

  • Copying kernel and initrd problem while setting up a server

    - by user3452627
    I'm trying to set up a server using PXE and following this (clickable) instruction. But I have a problem in part Creating your NFS installation Right here: Copy kernel and initrd to tftp root. Run these commands ON THE SERVER sudo cp ~/vmlinuz-`uname -r` /tftpboot/ sudo cp ~/initrd.img-`uname -r` /tftpboot/ Actually, I don't know which kernel (server's or client's) should be copied. There isn't any files like those in my home folder on server. Can anybody tell me how to fix it?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >