Sponsored Content
Top Forums Shell Programming and Scripting pattern grep using Perl in .TSV file Post 302416266 by vmsenthil on Monday 26th of April 2010 02:25:12 AM
Old 04-26-2010
Question pattern grep using Perl in .TSV file

Hi All,

I have a .TSV extension file having ~1 Gig data and I need to grep a pattern in that file using perl. I am not able to read the file using perl any suggestions on this/ If I Change the format my data gets mismangled so I am bothered about using specific format as well.

Code:
#! C:\programfiles\perl\bin\perl
    open(HANDLE,"<file1.tsv")or die "can't open file: $!";
    while ($record = <HANDLE>)
    {
      print $record;
     }
    close (HANDLE);


TIA,
-Senthil

Last edited by Franklin52; 04-26-2010 at 03:44 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl pattern matching vs. grep

I originally had a shell script that did a grep 10 times to pull out the number of times a certain pattern occured in a file: ie... aOccurances=`grep aPattern file|wc -l` bOccurances=`grep bPattern file|wc -l` ... ... ... fOccurances=`grep fPattern file|wc -l` As the file got bigger with... (0 Replies)
Discussion started by: junkmail426
0 Replies

2. Shell Programming and Scripting

Split a file based on pattern in awk, grep, sed or perl

Hi All, Can someone please help me write a script for the following requirement in awk, grep, sed or perl. Buuuu xxx bbb Kmmmm rrr ssss uuuu Kwwww zzzz ccc Roooowwww eeee Bxxxx jjjj dddd Kuuuu eeeee nnnn Rpppp cccc vvvv cccc Rhhhhhhyyyy tttt Lhhhh rrrrrssssss Bffff mmmm iiiii Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies

3. UNIX for Dummies Questions & Answers

Grep a pattern in gz file

I have a set of .gz files. I need to grep a pattern and need to find out the file in which that pattern occurs. zgrep in not available in my server.Any other options available for searching a pattern without unzipping the .gz files. (2 Replies)
Discussion started by: rprajendran
2 Replies

4. UNIX for Dummies Questions & Answers

tsv file comparison

Hi Guys, I have to write a script to compare the tsv files headers with the values stored in the variable in bash. I have declared variables as HEADER_VERSION="All Versions\tVersion Type\tVersion\tLevel" now file contains data as follows: All Versions Version Type Version Level... (0 Replies)
Discussion started by: Swapna173
0 Replies

5. Shell Programming and Scripting

script to grep a pattern from file compare contents with another file and replace

Hi All, Need help on this I have 2 files one file file1 which has several entries as : define service{ hostgroup_name !host1,!host5,!host6,.* service_description check_nrpe } define service{ hostgroup_name !host2,!host4,!host6,.* service_description check_opt } another... (2 Replies)
Discussion started by: namitai
2 Replies

6. Shell Programming and Scripting

Grep pattern in PERL

Hi, Can anyone tell me how this grep works? Type of input is not known Thanks in advance (2 Replies)
Discussion started by: irudayaraj
2 Replies

7. Shell Programming and Scripting

Split each column in TSV file to be new line?

My TSV looks like: Hello my name is John \t Hello world \t Have a good day! \t See you later! Is there a simple bash script that splits the tsv on tab to: Hello my name is John Hello world Have a good day! See you later! I'm really stuck, would appreciate any help! (5 Replies)
Discussion started by: pxalpine
5 Replies

8. Shell Programming and Scripting

How to grep a pattern in perl?

hello Everyone i am a newbie. i have a file which contains the following E:\gtmproj\script\i486_nt\obj\check_geomtools.exe: o:\portsrc\spg\system_1\i486_nt\advapps\TK-2\objmt\winclockmtq.lib E:\gtmproj\script\i486_nt\obj\check_geomtools.exe:... (12 Replies)
Discussion started by: Rashid Khan
12 Replies

9. Shell Programming and Scripting

Grep a file pattern in another

Hi I'm new to the forum, so I'd apologize for any error in the format of the post. I'm trying to find a file content in another one using: grep -w -f file1 file2 file1 GJA7 TSC file 2 GJC1 GJA7 TSC1 TSC (11 Replies)
Discussion started by: flyfisherman
11 Replies

10. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies
RDF::Trine::Serializer::TSV(3pm)			User Contributed Perl Documentation			  RDF::Trine::Serializer::TSV(3pm)

NAME
RDF::Trine::Serializer::TSV - TSV Serializer VERSION
This document describes RDF::Trine::Store version 1.000 SYNOPSIS
use RDF::Trine::Serializer::TSV; my $serializer = RDF::Trine::Serializer::TSV->new(); DESCRIPTION
The RDF::Trine::Serializer::TSV class provides an API for serializing RDF graphs to the TSV syntax. METHODS
Beyond the methods documented below, this class inherits methods from the RDF::Trine::Serializer class. "new" Returns a new TSV serializer object. "serialize_model_to_file ( $fh, $model )" Serializes the $model to TSV, printing the results to the supplied filehandle "<$fh">. "serialize_model_to_string ( $model )" Serializes the $model to TSV, returning the result as a string. "serialize_iterator_to_file ( $file, $iter )" Serializes the iterator to TSV, printing the results to the supplied filehandle "<$fh">. "serialize_iterator_to_string ( $iter )" Serializes the iterator to TSV, returning the result as a string. "statement_as_string ( $st )" Returns a string with the nodes of the given RDF::Trine::Statement serialized in N-Triples format, separated by tab characters. BUGS
Please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. SEE ALSO
http://www.w3.org/TR/rdf-testcases/#ntriples <http://www.w3.org/TR/rdf-testcases/#ntriples> AUTHOR
Gregory Todd Williams "<gwilliams@cpan.org>" COPYRIGHT
Copyright (c) 2006-2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-29 RDF::Trine::Serializer::TSV(3pm)
All times are GMT -4. The time now is 11:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy