search pattern on sed or grep

2007-05-04 Thread Nikolaos A. Patsopoulos
Hi all, I'm very sorry to bother the list with this problem but I've been searching in the web the couples hours to find an answer and still haven't find any. The problem is that I have a txt file of 3.5GB containing all the info of Human chromosome 6. I want to save into one another file

Re: search pattern on sed or grep

2007-05-04 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Hi all, I'm very sorry to bother the list with this problem but I've been searching in the web the couples hours to find an answer and still haven't find any. The problem is that I have a txt file of 3.5GB containing all the info

Re: search pattern on sed or grep

2007-05-04 Thread Nikolaos A. Patsopoulos
Tim Chase wrote: grep 'rs10946498' chr6.txt | grep -v 'rs10946498.*rs10946498' out.txt Sed might allow it in one pass with something like sed -e '/rs10946398/!d' -e '/rs10946398.*rs10946398/d' chr6.txt out.txt Still try to migrate from Windows to linux, but hopefully will done it

Re: vim | delete consecutive occurrences of a pattern

2007-04-27 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Tim Chase wrote: I have a text that has many occurrences of a pattern . I want to delete every consecutive occurrence, e.g. Pattern Pattern other text Pattern Pattern Pattern Pattern other text Pattern Pattern Pattern should look like

Re: vim | delete consecutive occurrences of a pattern

2007-04-27 Thread Nikolaos A. Patsopoulos
Jόrgen Krδmer wrote: Hi, Nikolaos A. Patsopoulos wrote: Tim Chase wrote: I have a text that has many occurrences of a pattern . I want to delete every consecutive occurrence, e.g. Pattern Pattern other text Pattern Pattern Pattern Pattern other text Pattern Pattern Pattern should

join all lines inside pattern that occurs more than once

2007-04-26 Thread Nikolaos A. Patsopoulos
Hi, I want to join all lines that are inside a given pattern and occurs more than once in the text, ie: PatternStart text1 text2 ...text3 ..text4 PatternEnd ... ... PatternStart text1 text2 ...text3 ..text4 ... ...textn PatternEnd ... PatternStart

Re: delete all but first occurence of a pattern

2007-04-02 Thread Nikolaos A. Patsopoulos
Tobia wrote: I don't think Vim's regular expressions are the best tool for this job. I mean, XML manipulation is much easier done in XSLT: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=article xsl:copy

delete all but first occurence of a pattern

2007-03-31 Thread Nikolaos A. Patsopoulos
Hi all, I've got xml files that each have 500 entries marked as article /article .in each entry there are fields author/author. Some articles have non author fields and some have more than one. What I want to do is every article to have only one such field, e.g. if an article has 3

grouping problem

2007-01-11 Thread Nikolaos A. Patsopoulos
Ηι, I'm want to group a text that has the following text pattern (values and number of lines vary across instances): PMID16893921/PMID Volume164/Volume Issue7/Issue Year2006/Year ISOAbbreviationAm. J. Epidemiol./ISOAbbreviation ArticleTitleImplications of small effect sizes of individual

vim | deleting end of lines inside a pattern

2007-01-11 Thread Nikolaos A. Patsopoulos
Hi, I would like to delete all end of lines (\n) inside a given pattern that runs through a text. The pattern is like this: PubmedArticle text1 \n text2 \n text3 \n text4 \n text5 \n text6 \n ... \n PubmedArticle Any help? Thanks

vim | editing pdf files with vim

2006-10-10 Thread Nikolaos A. Patsopoulos
Hi all, is there a way to edit pdf files with vim? If not pdf as is, then eps or postscript? I tried with either format but the text kept been converted to sthl ike ASCII code. Thanks, Nikos

Re: vim | editing pdf files with vim

2006-10-10 Thread Nikolaos A. Patsopoulos
Mike Williams wrote: Nikolaos A. Patsopoulos did utter on 10/10/2006 14:58: Hi all, is there a way to edit pdf files with vim? If not pdf as is, then eps or postscript? I tried with either format but the text kept been converted to sthl ike ASCII code. In general trying to edit PDF

vim | replacement question

2006-09-20 Thread Nikolaos A. Patsopoulos
Hi all! Another replacement question: how can I replace all occurrence of a pattern except a given one, e.g. the first or third? the code for all occurrences I use is: :%s/a.\{-}//g Thanks in advance, Nikos

Re: vim | replacement question

2006-09-20 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/20/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Hi all! Another replacement question: how can I replace all occurrence of a pattern except a given one, e.g. the first or third? the code for all occurrences I use is: :%s/a.\{-}//g /pattern/+1,$s///g Yakov

Re: vim | replacement question

2006-09-15 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Hi, another two questions: 1. I want to delete all text that has a specific pattern. I use the following code with s command but I want to keep the \a character in the beginning: :%s

vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Hi, I have a series of questions: 1. I want to edit multiple files from command line so I created a vim script with all the commands (20). I use a batch file in WinXP: |@echo off vim -s script file.txt exit however I need to run this script on multiple files. In vim's help there is this

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: 2.Can I delete after a pattern search? Sth like this: :/^html\_.{-}body: /-3d and how can I repeat this globally? :g/^html\_.{-}body: /.-3d Yakov I get an E16: invalid range error -- Nikolaos

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: 2.Can I delete after a pattern search? Sth

Re: vim | multiple files editing and delete question (bash script)

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: 3. This is not Vim related but I wonder if anyone knows sth. I have the following structure of folders and files: .. folder1

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Steve Hall wrote: On Thu, 2006-09-14 at 13:01 +0300, Nikolaos A. Patsopoulos wrote: 1. I want to edit multiple files from command line so I created a vim script with all the commands (20). I use a batch file in WinXP: |@echo off vim -s script file.txt exit however I need to run

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
(actually it's just one instruction, so u don't even need to have a batch file for it) Regards, Sibin -Original Message- From: Nikolaos A. Patsopoulos [mailto:[EMAIL PROTECTED] Sent: Thursday, September 14, 2006 3:31 PM To: vim@vim.org Subject: vim | multiple files editing and delete question

vim | replacement question

2006-09-14 Thread Nikolaos A. Patsopoulos
Hi, another two questions: 1. I want to delete all text that has a specific pattern. I use the following code with s command but I want to keep the \a character in the beginning: :%s/\a,\_.\{-}\/td\/tr/ 2. how can I join lines that have non-numerical characters? e.g. 153 Purdue Canc Ct 1256

Re: vim | replacement question

2006-09-14 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Hi, another two questions: 1. I want to delete all text that has a specific pattern. I use the following code with s command but I want to keep the \a character in the beginning: :%s/\a,\_.\{-}\/td\/tr/ To delete everything that matches

vim | insert filename into file

2006-09-14 Thread Nikolaos A. Patsopoulos
Hi, how can anyone add the filename in the file in ex-mode? C-R% and %p works only in normal mode Thanks, Nikos

Re: vim | insert filename into file

2006-09-14 Thread Nikolaos A. Patsopoulos
Jürgen Krämer wrote: Hi, Nikolaos A. Patsopoulos wrote: how can anyone add the filename in the file in ex-mode? C-R% and %p works only in normal mode :put % Regards, Jürgen That seems to insert the filename in random place. What if I want to place it e.g. in the beginning

Re: vim | insert filename into file

2006-09-14 Thread Nikolaos A. Patsopoulos
Tim Chase wrote: :put % That seems to insert the filename in random place. What if I want to place it e.g. in the beginning of each line? It inserts it on the line below where the cursor currently is. You can specify a target (as in :30put % which will put it below line #30) If you

Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Hi, I'm trying to delete several lines from the beginning of file till the appearance of a specific pattern, without deleting the pattern. I have used the following command: :1,/Citations: /d/e-10 but the offset doesn't work. Thanks in advance, Nikos

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Hi, I'm trying to delete several lines from the beginning of file till the appearance of a specific pattern, without deleting the pattern. I have used the following command: :1,/Citations: /d/e-10 but the offset

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Hi, I'm trying to delete several lines from the beginning of file till the appearance of a specific pattern, without deleting

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Hi, I'm trying to delete several lines from the beginning of file till the appearance of a specific pattern, without deleting

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Hi, I'm trying to delete several lines from the beginning of file till the appearance of a specific pattern, without deleting the pattern. I have used the following command: :1,/Citations: /d/e-10 but the offset doesn't work. Thanks

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Hi, I'm trying to delete several lines

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Hi, I'm trying to delete several lines

Re: Deleting question

2006-09-13 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 9/13/06, Nikolaos A. Patsopoulos [EMAIL PROTECTED

vim | cut paste in ex mode

2006-09-13 Thread Nikolaos A. Patsopoulos
Hi, is there a way to yank in ex-mode? I want to find all \d\d\d\dnbsp; in my file and put them in the end of their containing line. Thanks in advance, Nikos

Re: vim | cut paste in ex mode

2006-09-13 Thread Nikolaos A. Patsopoulos
Tim Chase wrote: is there a way to yank in ex-mode? I want to find all \d\d\d\dnbsp; in my file and put them in the end of their containing line. 1) yes, you can yank in ex-mode, though it usually happens in line-wise fashion, unless you pull some stunts to prevent that: :10y will yank

vim | reformatting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Hi, I'm trying to fix a file in the following format : 5,329; 1999; a Univ Washington/a; 695; 2001; NHLBI; 684; 1998; a Stanford Univ/a; 3,537; 1998; La Jolla Inst Allergy Immunol; 3,333; 1996; a BRIGHAM WOMENS HOSP/a; 2,967; 1998; a Northwestern Univ/a; 2,936; 2002; a NHLBI/a; 2,695; 1996; a

Re: vim | reformatting question

2006-09-13 Thread Nikolaos A. Patsopoulos
Max Dyckhoff wrote: It seems like you are just trying to join groups of three lines, which you can do very easily using this following command: :g/./j!3 Hope that helps! Max -Original Message- From: Nikolaos A. Patsopoulos [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 13

html file to cvs

2006-09-06 Thread Nikolaos A. Patsopoulos
file (since it is impossible to cut paste the whole code here) but I've got a failure notice. I have published a html file in the following address: http://users.uoi.gr/npatsop/portal_002.htm Thanks in advance, Nikos -- Nikolaos A. Patsopoulos, MD Department of Hygiene and Epidemiology

Re: html file to cvs

2006-09-06 Thread Nikolaos A. Patsopoulos
not an editor. Hope this gives some inspiration. On Sep 6, 2006, at 06:14, Nikolaos A. Patsopoulos wrote: I have a huge pack of html files (1000) and I want to extract some info on cvs files. #!/usr/bin/perl # Very

Re: VIM script replacement question

2006-05-25 Thread Nikolaos A. Patsopoulos
Alan G Isaac wrote: On Thu, 25 May 2006, Nikolaos A. Patsopoulos apparently wrote: In detail: 1.I want in front of the number in the first column to add # , then change line after the value 2. change line after 3rd column 3. change line after 5th column 4. repeat all three steps

Re: VIM script replacement question

2006-05-25 Thread Nikolaos A. Patsopoulos
Alan G Isaac wrote: On Thu, 25 May 2006, Nikolaos A. Patsopoulos apparently wrote: The replacement didn't occur to the whole file. You must have forgotten the '%'. hth, Alan Isaac No, I used %. Got them same problem with Tim's code :(

Re: VIM script replacement question

2006-05-25 Thread Nikolaos A. Patsopoulos
Alan G Isaac wrote: On Thu, 25 May 2006, Nikolaos A. Patsopoulos apparently wrote: No, I used %. Got them same problem with Tim's code Something is not right ... Try using :g/./s/ instead of :%s/ and see what happens. hth, Alan Isaac Works great! Million thanks! Nikos

Re: VIM script replacement question

2006-05-25 Thread Nikolaos A. Patsopoulos
Alan G Isaac wrote: On Thu, 25 May 2006, Nikolaos A. Patsopoulos apparently wrote: No, I used %. Got them same problem with Tim's code Something is not right ... Try using :g/./s/ instead of :%s/ and see what happens. hth, Alan Isaac One last question: I get this: #3 00

Re: VIM script replacement question

2006-05-25 Thread Nikolaos A. Patsopoulos
Alan G Isaac wrote: On Thu, 25 May 2006, Nikolaos A. Patsopoulos apparently wrote: 00 must become 0 0 The original replacement I sent had these spaces in it: :g/./s/^\(\d\+\)\s\+\([01]\)\s\+\([01]\)\s\+\([01]\)\s\+\([01]\)\s*/#\1\r\2 \3\r\4 \5 Look after \2 and after \4 hth, Alan