Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Yank versus control-insert formatting differences? Post 302539746 by marshlight on Monday 18th of July 2011 02:22:04 PM
Old 07-18-2011
Yank versus control-insert formatting differences?

Hello! Graduate student thrown to the sharks of unix and fortran77 here.

My basic question is this: what exactly is the difference between yank (ie "*yG for the whole file and "*p in a new file) and control-insert / shift-insert with respect to text formatting? One is vi and one is Windows, according to wikipedia, and one can get the whole file and the other leads to monotonous copy, paste, scroll, rinse, repeat. BUT, for my purposes, the way control-insert reformats the text upon pasting is different than yank, and it's something I actually want to reproduce in bulk for the rest of the file.

Some background: I needed to pare down the grid size of a csv data file to match new inputs, so I did it in a rather tedious but effective way in MATLAB using dlmwrite(fout, [datanames],'-append', 'newline','unix') within an if-loop for my parameters. The resulting file (let's call it problemchild.csv) looks like this:
1422,52,1,24.881,-88.113,0,300,293,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
1423,53,1,24.85,-87.766,0,300,293,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
and so on.

The parent data-reading program (MEGAN) refuses to read problemchild.csv, though, insisting
>>--->> WARNING in subroutine STR2INT
No digits in "^@^@^@ã6²?7 "
even though the file I made appears to be in exactly the same format, even when looking at cat -v problemchild.csv, as the larger original. I suspect because I wrote it in dlmwrite that the file is characterized as numerical, not a string, even though it looks the same. I would rather not edit the parent program, however, because it uses STR2INT in ways I'm not sure I could reproduce if I took the commands out. So, I'd like to figure out how to copy over my problemchild text into a file that will pass STR2INT. Trying to copy and paste in a quick manner (ie cat problemchild.csv >> newfile.csv OR "*yG and "*p) reproduces the same error, but control-insert and shift-insert for each line of the file produces something the parent program will actually read. Except that the problemchild file is 1800+ lines long, and I'd really prefer not to convert it manually...

I've tried to search around but I'm still pretty new at this and I haven't found much that has been helpful. I'm using VIM - Vi IMproved 6.3 (2004 June 7, compiled Jan 11 2005 10:55:42) and it's not linked to my clipboard via xterm_clipboard, if that is useful at all. I'm kind of at the end of my rope with this so any help would be appreciated. Thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

yank

This is supposed to be simple to do but I am having a hard time trying to yank 1 line (yy) but creating from it 100 lines. I can do yy then keep hitting . to repeat but it doesn't make sense. I may want to create 1000 lines from the one liner. yy then 99 p doesn't work.... Thanks. I was... (5 Replies)
Discussion started by: giannicello
5 Replies

2. UNIX for Dummies Questions & Answers

CTRL+H versus ^? versus BACKSPACE

Hi Gurus! I recently got my shell account (HP UX v11) created by our sysadmin and am having problem deleting with the backspace key. After doing some reading, I believe I need to enter a custom "STTY..." statement in my profile. Can someone please help me with the correct "STTY" sequence... (3 Replies)
Discussion started by: alan
3 Replies

3. Shell Programming and Scripting

<LF> versus <CR>/<LF>

Hello, Can someone explain how to distinguish a LF character and a CR/LF character in a text file from a shell script. Thanks (1 Reply)
Discussion started by: jerardfjay
1 Replies

4. UNIX for Dummies Questions & Answers

annoying vi yank word + delete all question

Hello when i try to yank word only that looks like this "$$foo$" when i stand with my curser marker on the first char ($) and do in vi : "yw" (yank word) its yanks me only the "$" char when i stand white my curser on "f" its yank's me only "foo" how can i yank all word no matter what... (4 Replies)
Discussion started by: umen
4 Replies

5. UNIX for Dummies Questions & Answers

Yank a column in vi

I have a file which has data in columns. Is there a way to yank columns in vi? I tried searching in this forum. I did not find it. Please help me out. (2 Replies)
Discussion started by: stevelrf
2 Replies

6. UNIX for Advanced & Expert Users

cpio versus cp

I am copying a file system to another one. someone suggest me use find . -print |cpio -pdmv but I think cp -r should do the same thing. Am I right? In addition, by using " find . ", I got all the file names,, why do I have to use the -print option? Thanks a lot! (1 Reply)
Discussion started by: fredao
1 Replies

7. Shell Programming and Scripting

^M in yank but not in file in Vim

I am trying to visually select a section of text in vim and then substitute for it using the :%s/ sequence. First I visually select text. Then I yank using "ay. Then I type :%s/ followed by Control R and the register name, in this case a. This fills in the text I have visually selected into... (6 Replies)
Discussion started by: Enobarbus37
6 Replies

8. Shell Programming and Scripting

Differences between 2 Flat Files and process the differences

Hi Hope you are having a great weeknd !! I had a question and need your expertise for this : I have 2 files File1 & File2(of same structure) which I need to compare on some columns. I need to find the values which are there in File2 but not in File 1 and put the Differences in another file... (5 Replies)
Discussion started by: newbie_8398
5 Replies

9. Shell Programming and Scripting

insert LF and TAB for formatting

trying to insert a LF and 2 TABs for this: sed 's/<td><\/td>/<td>\n\t\t<\/td>/' infile. but, I'm not getting the syntax for inserting the LF and TABs correct (1 Reply)
Discussion started by: dba_frog
1 Replies

10. Shell Programming and Scripting

Formatting file data to another file (control character related)

I have to write a program to read data from files and then format into another file. However, I face a strange problem related to control character that I can't understand and solve. The source file is compose of many lines with such format: T_NAME|P_NAME|P_CODE|DOCUMENT_PATH|REG_DATE ... (3 Replies)
Discussion started by: hk6279
3 Replies
sediff(1)						      General Commands Manual							 sediff(1)

NAME
sediff - SELinux policy difference tool SYNOPSIS
sediff [OPTIONS] [EXPRESSION] ORIGINAL_POLICY ; MODIFIED_POLICY DESCRIPTION
sediff allows the user to inspect the semantic differences between two SELinux policies. POLICY
sediff supports loading SELinux policies in one of four formats. source A single text file containing policy source for versions 12 through 21. This file is usually named policy.conf. binary A single file containing a monolithic kernel binary policy for versions 15 through 21. This file is usually named by version - for example, policy.20. modular A list of policy packages each containing a loadable policy module. The first module listed must be a base module. policy list A single text file containing all the information needed to load a policy, usually exported by SETools graphical utilities. Policies do not need to be the same format. If not provided sediff will print an error message and exit. EXPRESSIONS
The user may specify an expression listing the policy elements to differentiate. If not provided, all supported policy elements sans nev- erallows are examined. -c, --class Find differences in permissions assigned to object classes and common permission sets. --level Find differences in categories authorized for MLS levels. --category Find differences in category definitions. -t, --type Find differences in attributes associated with types. -a, --attribute Find differences in types assigned to attributes. -r, --role Find differences in types authorized for roles. -u, --user Find differences in roles authorized for users. -b, --bool Find differences in the default values of booleans. -A, --allow Find differences in allow rules. --auditallow Find differences in auditallow rules. --dontaudit Find differences in dontaudit rules. --neverallow Find differences in neverallow rules. --type_trans Find differences in type_transition rules. --type_member Find differences in type_member rules. --type_change Find differences in type_change rules. --role_trans Find differences in role_transition rules. This includes differences in the default role. --role_allow Find differences in role allow rules. --range_trans Find differences in range_transition rules. This includes differences in the target MLS range. OPTIONS
-q, --quiet If there are no differences for elements of a given kind, suppress status output for that kind of element. --stats Print difference statistics only. -h, --help Print help information and exit. -V, --version Print version information and exit. DIFFERENCES
sediff categorizes differences in policy elements into one of three forms. added The element exists only in the modified policy. removed The element exists only in the original policy. modified The element exists in both policies but its semantic meaning has changed. For example, a class is modified if one or more permissions are added or removed. For all rules with types as their source or target, two additional forms of difference are recognized. This helps distinguish differences due to new types from differences in rules for existing types. added, new type The rule exists only in the modified policy; furthermore, one or more of the types in the rule do not exist in the original policy. removed, missing type The rule exists only in the original policy; furthermore, one or more of the types in the rule do not exist in the modified policy. NOTE
Most shells interpret the semicolon as a metacharacter, thus requiring a backslash like so: sediff original.policy ; modified.policy AUTHOR
This manual page was written by Jeremy A. Mowery <jmowery@tresys.com>. COPYRIGHT
Copyright(C) 2004-2007 Tresys Technology, LLC BUGS
Please report bugs via an email to setools-bugs@tresys.com. SEE ALSO
sediffx(1) sediff(1)
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy