Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help parsing and replacing text with file name Post 302342141 by mycoguy on Friday 7th of August 2009 01:05:07 PM
Old 08-07-2009
Hi Zaxxon,

Thanks a million! I didn't want the actual sequence, just the sequence name, so I used some of your code and bits of other things that I pieced together. This is hideous and long (I know Smilie) but it works. Next week I'll try to learn to pipe.

Code:

Code:
grep '^>' *.fa >new; sed -e 's/.fa:>/\t/g' new > new2; perl -e ' @cols=(1, 0); while(<>) { s/\r?\n//; @F=split /\t/, $_; print join("\t", @F[@cols]), "\n" } warn "\nChose columns ", join(", ", @cols), " for $. lines\n\n" ' new2 > new3; rm new; rm new2

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Text File Parsing

Hey Guys.I am a newbie on Bash Shell Scripting and Perl.And I have a question about file parsing. I have a log file which contains reports about a communication device.I need to take some of the reports from the log file.Its hard to explain the issue.but shortly I can say that, the reports has a... (2 Replies)
Discussion started by: Djlethal
2 Replies

2. Shell Programming and Scripting

replacing strings with text from other file

Hi, Im trying to update some properties files with text from another file: file1 user=xyz file2 user= after script file2 user=xyz Im using this reading the $QUARTZURL,ETC... from quartz.properties: echo... (1 Reply)
Discussion started by: mc1392
1 Replies

3. Shell Programming and Scripting

Parsing text from file

Any ideas? 1)loop through text file 2)extract everything between SOL and EOL 3)output files, for example: 123.txt and 124.txt for the file below So far I have: sed -n "/SOL/,/EOL/{p;/EOL/q;}" file Here is an example of my text file. SOL-123.go something goes here something goes... (0 Replies)
Discussion started by: ndnkyd
0 Replies

4. Shell Programming and Scripting

Replacing Text in Text file

Hi Guys, I am needing some help writing a shell script to replace the following in a text file /opt/was/apps/was61 with some other path eg /usr/blan/blah/blah. I know that i can do it using sed or perl but just having difficulty writing the escape characters for it All Help... (3 Replies)
Discussion started by: cgilchrist
3 Replies

5. Shell Programming and Scripting

replacing text in a file, but...

Hi all, Very first post on this forums, hope you can help me with this scripting task. I have a big text file with over 3000 lines, some of those lines contain some text that I need to replace, lets say for simplicity the text to be replaced in those lines is "aaa" and I need it to replace it... (2 Replies)
Discussion started by: Angelseph
2 Replies

6. Shell Programming and Scripting

replacing text with contents from another file

I'm trying to change the ramfs size in kernel .config automatically. I have a ramfs_size file generated with du -s cat ramfs_size 64512 I want to replace the linux .config's ramdisk size with the above value CONFIG_BLK_DEV_RAM_SIZE=73728 Right now I'm doing something dumb like: ... (3 Replies)
Discussion started by: amoeba
3 Replies

7. Shell Programming and Scripting

Need help parsing a text file

I have a text file: router1#sh ip blah blah | incl --- Gi2/8 10.60.4.181 --- 10.60.123.175 11 0000 0000 355K Gi2/8 10.60.83.28 --- 224.10.10.26 11 F9FF 3840 154K Gi2/8 10.60.83.198 --- ... (1 Reply)
Discussion started by: streetfighter2
1 Replies

8. Programming

Parsing a Text file using C++

I was trying to parse the text file, which will looks like this ###XYZABC#### ############ int = 4 char = 1 float = 1 . . ############ like this my text file will contains lots of entries and I need to store these entries in the map eg. map.first = int and map.second = 4 same way I... (5 Replies)
Discussion started by: agupta2
5 Replies

9. Shell Programming and Scripting

Parsing text file

I'm totally stumped with how to handle this huge text file I'm trying to deal with. I really need some help! Here is what is looks like: ab1ba67c331a3d731396322fad8dd71a3b627f89359827697645c806091c40b9 0.2 812a3c3684310045f1cb3157bf5eebc4379804e98c82b56f3944564e7bf5dab5 0.6 0.6... (3 Replies)
Discussion started by: comp8765
3 Replies

10. Shell Programming and Scripting

Parsing text file

Hi Friends, I am back for the second round today - :D My input text file is this way Home friends friendship meter Tools Mirrors Downloads My Data About Us Help My own results BLAT Search Results ACTIONS QUERY SCORE START END QSIZE IDENTITY CHRO STRAND ... (7 Replies)
Discussion started by: jacobs.smith
7 Replies
Class::DBI::ColumnGrouper(3pm)				User Contributed Perl Documentation			    Class::DBI::ColumnGrouper(3pm)

NAME
Class::DBI::ColumnGrouper - Columns and Column Groups SYNOPSIS
my $colg = Class::DBI::ColumnGrouper->new; $colg->add_group(People => qw/star director producer/); my @cols = $colg->group_cols($group); my @all = $colg->all_columns; my @pri_col = $colg->primary; my @essential_cols = $colg->essential; DESCRIPTION
Each Class::DBI class maintains a list of its columns as class data. This provides an interface to that. You probably don't want to be dealing with this directly. METHODS
new my $colg = Class::DBI::ColumnGrouper->new; A new blank ColumnnGrouper object. clone my $colg2 = $colg->clone; Clone an existing ColumnGrouper. add_column / find_column $colg->add_column($name); my Class::DBI::Column $col = $colg->find_column($name); Add or return a Column object for the given column name. add_group $colg->add_group(People => qw/star director producer/); This adds a list of columns as a column group. group_cols / groups_for my @colg = $cols->group_cols($group); my @groups = $cols->groups_for(@cols); This returns a list of all columns which are in the given group, or the groups a given column is in. columns_in my @cols = $colg->columns_in(@groups); This returns a list of all columns which are in the given groups. all_columns my @all = $colg->all_columns; This returns a list of all the real columns. primary my $pri_col = $colg->primary; This returns a list of the columns in the Primary group. essential my @essential_cols = $colg->essential; This returns a list of the columns in the Essential group. perl v5.12.4 2005-09-14 Class::DBI::ColumnGrouper(3pm)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy