Sponsored Content
Full Discussion: Vi copying text
Top Forums UNIX for Advanced & Expert Users Vi copying text Post 302490854 by cokedude on Tuesday 25th of January 2011 11:20:51 PM
Old 01-26-2011
Vi copying text

Is there a trick for copying from something like a powerpoint into vi? Every time I try to copy text from something like a powerpoint to vi my spacing gets messed up. I think it has something to do with my .vimrc file. When I renamed it was able to copy it in just fine so can someone please tell me what in my .vimrc is messing it up. Here is my .vimrc so you can take a look at it. Below it is what I am trying to copy into vi.

Code:
set nocompatible
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
set virtualedit=all
set number
set cmdheight=2
"This command uses unix mode
set ff=unix

"This command uses dos mode
"set ff=dos

Code:
#include <iostream>

int main( void )                                          
{   
   int a;
   int b;
   std::cout << "Enter two integers to compute their sum:" << std::endl;

   std::cin >> a;
   std::cin >> b;

   std::cout << "The sum of " << a << " and " << b  << " is ";
   std::cout << a + b << std::endl;

   return 0;
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying Text between two unique text patterns

Dear Colleagues: I have .rtf files of a collection of newspaper articles. Each newspaper article starts with a variation of the phrase "Document * of 20" and is separated from the next article with the character string "===================" I would like to be able to take the text composing... (3 Replies)
Discussion started by: spindoctor
3 Replies

2. Shell Programming and Scripting

Need help with searching and copying in a text file

Hi, I need help searching through a large text file. I need to find a certain string within the text, and copy each line until another string appears. The file looks like this: >scf15164843 ATTAAAGGNNNGGAATTTCCCCAA ATTACCGGCTTTAAANNNTTACCC >scf15154847 CCGGGNNNTTTAAACCCGNGNGCC... (2 Replies)
Discussion started by: repiv
2 Replies

3. UNIX for Dummies Questions & Answers

Copying and Pasting columns from one text file to another

I have a tab delimited text file that I want to cut columns 3,4,5 from. Then I want to paste these columns into a space delimited text file between columns 2 and 3. I still want to keep the space delimited format in the final text file. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

4. UNIX for Dummies Questions & Answers

Copying text from Windows to AIX - missing text?

Hi All, I'm hoping this is an easy question, but I'm having a weird problem trying to simply copy and paste text from MS Windows (XP) Notepad and then pasting into vi or vim in AIX. When I type "oslevel" I get "5.3.0.0". The problem is that once the text is pasted, there are sections of text... (2 Replies)
Discussion started by: PlainInverted
2 Replies

5. Shell Programming and Scripting

copying text from between a pattern and *

Hej all, I have a LS-DYNA keyword file which I want to extract the node coordinates from it to another file for processing and then returning the result coordinates to the same place, the structure of the file is like: Keyword file: 5010497 -266.6623535 -446.2596130 ... (3 Replies)
Discussion started by: Johanni
3 Replies

6. Shell Programming and Scripting

Inserting text in file names while copying them.

I'm trying to find a Bourne shell script that will copy files from one directory using a wild card for the file name (*) and add some more characters in the middle of the file name as it is copied. As an example: /u01/tmp-file1.xml => /u02/tmp-file1-20130620.xml /u01/tmp-file2.xml => ... (6 Replies)
Discussion started by: Tony Keller
6 Replies

7. Shell Programming and Scripting

Shell Script for copying text file to Excel Sheet

Hi, I want to write a program to copy a log file to Excel sheet. Excel sheet has four columns MethodName , Code , Description, Details and Time. I want to pick these info from text file and put it in excel sheet. here is how the text file looks - 04.17.2014 08:06:12,697... (1 Reply)
Discussion started by: hershey
1 Replies

8. Shell Programming and Scripting

Copying a file to multiple other files using a text file as input

Hello, I have a file called COMPLIST as follows that contains 4 digit numbers.0002 0003 0010 0013 0015 0016 0022 0023 0024 0025 0027 0030 0031 0032 0033 0035 0038 0041 (3 Replies)
Discussion started by: sph90457
3 Replies

9. Shell Programming and Scripting

Extracting and copying text from one file to another

Helooo, So I have a .fasta file (a text file with sequence data) which looks like this, with just over 3 million lines of data. >TCONS_00000001 gene=XLOC_000001 AATTGTGGTGAAATGACTTCTGTTAACGGAGACATCGATGATTGTTGTTACTATTTGTTCTCAGGATTCA... (8 Replies)
Discussion started by: 4galaxy7
8 Replies

10. Shell Programming and Scripting

Copying a text file from my Ubuntu Windows Sub System to a remote instance through SSH

*Following questions involves use of YAML, BASH, SSH and Software called Ansible* I am trying to learn how to use a Linux environment (in my case a Ubuntu Windows Sub System) to copy a text file from my files to a remote instance (in this case Amazon Web Services) by connecting via SSH. I... (8 Replies)
Discussion started by: Suhaba
8 Replies
FBB::OFilterStreambuf(3bobcat)					 ostream filtering				    FBB::OFilterStreambuf(3bobcat)

NAME
FBB::OFilterStreambuf - Base class for std::ostream filtering SYNOPSIS
#include <bobcat/ofilterstreambuf> Linking option: -lbobcat DESCRIPTION
The FBB::OFilterStreambuf class is a specialization of the std::streambuf class and can be used as a base class for classes implementing ostream-filtering. Ostream filtering is defined here as the process by which inserted characters are subject to processing before they are passed on to another (filtered) ostream object (or they may be rejected). The filtering may also result in inserting additional information into the filtered ostream. Chaining of filters is also possible: the filtered ostream may itself use an OFilterStreambuf to filter its received information before passing it on to yet another ostream. As OFilterStreambuf inherits from std::streambuf an OFilterStreambuf object can be used to provide an ostream object with a std::streambuf. Information inserted into such a stream travels the following route: o The information is converted to characters using the standard conversion facilities implemented by std::ostream objects. E.g., when inserting the value 123 this value is converted to the characters '1', '2' and '3', respectively. o Each of the characters is then offered (in turn) to the std::streambuf that is associated with the ostream object. In particular, the std::streambuf's overflow() member is called. o OFstreamBuf's default overflow() function ignores characters, but specializations can override overflow() to process the received characters ad lib. o A overriding overflow() function has access to the member OFstreambuf::out() which is a reference to the std::ostream receiving the filtered information. To implement a simple copy-filter (i.e., all characters are accepted as-is) a class must be derived from OFilterStreambuf providing an overriding implementation of overflow(), e.g., as follows: int DerivedClass::overflow(int ch) { out().put(ch); } Next this std::streambuf specialization can be associated with an ostream into which information to be `copy filtered' can be inserted (cf. the EXAMPLE section below). NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
std::streambuf CONSTRUCTORS
o OFilterStreambuf(): This constructor creates a OFilterStreambuf object without associating it with a destination (filtered) ostream. o OFilterStreambuf(char const *fname, openmode mode = std::ios::out): This constructor creates a OFilterStreambuf object and opens a private std::ofstream object whose filename is provided and that should receive the filtered information. o OFilterStreambuf(std::ostream &out): This constructor creates a OFilterStreambuf object and will insert any filtered information into the provided ostream object. The class's destructor closes the destination (filtered) stream (cf. the description of close() below). MEMBER FUNCTIONS
All members of std::ostreambuf are available, as FBB::OFilterStreambuf inherits from that class. In particular, derived classes should pro- vide their own implementation of int underflow(int ch) to implement any non-trivial filtering. o void close(): This member calls the streambuf::sync() member to flush any pending information to the destination (filtered) stream and then closes the destination stream. Note that the default sync() member performs no special actions but it can be overridden by derived classes to flush the destination stream just prior to its closing. o void open(char const *fname, openmode mode = std::ios::out): This member closes the current destination (filtered) std::ostream object and associates the OFilterStreambuf object with a private std::ofstream object whose filename is provided and that should receive subsequently filtered information. o void open(std::ostream &out): This member closes the current destination (filtered) std::ostream object and associates the OFilterStreambuf object with the pro- vided ostream object. PROTECTED MEMBER FUNCTION
o std::ostream &out() const: This member is available to derived classes to insert information into the destination (filtered) stream. EXAMPLE
#include <iostream> #include <cctype> #include <bobcat/ofilterstreambuf> class NoDigits: public FBB::OFilterStreambuf { public: int overflow(int ch) { if (not isdigit(ch)) out().put(ch); return ch; } int sync() { out() << flush; return 0; } }; using namespace FBB; using namespace std; int main() { NoDigits nod(cout); // no digits to cout ostream out(&nod); out << in.rdbuf(); // rm digits from cin return 0; } FILES
bobcat/ofilterstreambuf - defines the class interface SEE ALSO
bobcat(7) BUGS
None Reported. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::OFilterStreambuf(3bobcat)
All times are GMT -4. The time now is 03:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy