User Profile

Collapse

Profile Sidebar

Collapse
Sevla
Sevla
Last Activity: Jun 2 '09, 08:07 PM
Joined: May 21 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Sevla
    started a topic How can i CHANGE one specific word in a line????
    in Perl

    How can i CHANGE one specific word in a line????

    hello,

    im having a problem to change a particular word in a line, can´t find where is my mistake

    also i would like to know how to make this program check automatically if a particular word exists on the line you got to you exchange it or not

    i didnt find the right condition to do it



    Code:
    #!C:/perl/bin/perl.exe  #Handle Area - in - outfile
    ...
    See more | Go to post

  • Sevla
    replied to How to export a text line to a new file?
    in Perl
    i finally got this code

    search by line and export it to a new file

    it worked pretty nice

    Code:
    #!C:/perl/bin/perl.exe
    #Handle Area - in - outfile
    
    open my $file, q{c:/perl/discoverEdit[1].4796.11.30.5.8.2009.dci} or die "Can't open input file";
    open(OUTFILE, "> c:/perl/report.dci") or die "Can't open output file";
    my @read =
    ...
    See more | Go to post

    Leave a comment:


  • Sevla
    replied to How to export a text line to a new file?
    in Perl
    yes

    i mean with this code search for a line and then this line is outputed in a new file with the line i wrote


    and on searching area

    wich way i declare to make me search for a line on command and output it on a report.txt file ?
    See more | Go to post

    Leave a comment:


  • Sevla
    replied to How to export a text line to a new file?
    in Perl
    thanks a lot, it worked perfectly now

    i just have one more thing to boring you with guys,

    i had to make this whole search, by word , outputing in a outfile, to get me familiar with perl and start on programming enviroment, and now to finally finish this little program at my job i need to make the search by the specific line , once it had numbered the file lines,

    if someone can give a little help here...
    See more | Go to post

    Leave a comment:


  • Sevla
    replied to How to export a text line to a new file?
    in Perl
    its exactly what i wanted man,

    thanks a lot

    just a obs: the output file overwrites one over one each time a new searching is made, can store in different files each searching?

    here it goes my code:

    Code:
    #!C:/perl/bin/perl.exe
    #Handle Area - in - outfile
    
    open(INPUTFILE, "< c:/perl/discoverEdit[1].4796.11.30.5.8.2009.dci") or die "Can't open input file";
    ...
    See more | Go to post
    Last edited by eWish; May 28 '09, 01:10 AM. Reason: Please use the [code][/code] tags

    Leave a comment:


  • Sevla
    started a topic How to export a text line to a new file?
    in Perl

    How to export a text line to a new file?

    Hello,

    i need to make a search of a text line on a dci/txt file and after i found it, i´d need to export this line to another new file.


    could it be possible, copying a specific line of this dci/txt file and export it to a separated dci/txt file?



    Thanks
    See more | Go to post

  • i see, the results quoted the word i typed on STDIN, but if i would like to keep the whole text line still on the results but with the quote on the exact word i entered on STDIN, ... could it be possible??


    Thanks for patience
    See more | Go to post

    Leave a comment:


  • sorry i didnt get what you meant with these codes,
    See more | Go to post

    Leave a comment:


  • Sevla
    started a topic FileHandle - searching single word from a txt file
    in Perl

    FileHandle - searching single word from a txt file

    hello guys

    i set this code , and i would like to know if its possible set "quotes" on the searched word.

    Thank You


    Code:
    #word searching program within a txt file
    #!C:/perl/bin/perl.exe
    start:
    #Handle Area - file opening
    open FILE, "c:/perl/notice.txt" or die "failed to open notice.txt $!\n";
    @read=<FILE>;
    close FILE;
    ...
    See more | Go to post
    Last edited by eWish; May 26 '09, 07:11 PM. Reason: Please use the [code][/code] tags.

  • Sevla
    replied to FILEHANDLE Questions
    in Perl
    great man, thanks a lot
    See more | Go to post

    Leave a comment:


  • Sevla
    replied to FILEHANDLE Questions
    in Perl
    hello guys, i solved the searching topic, i just need a help about how make a error message if your searched word were not found

    Code:
    #!C:/perl/bin/perl.exe
    #filehandle, opening
    start:
    open FILE, "c:/perl/noticia.txt" || die "failed to open notice.txt $!\n";
    @read=<FILE>;   # read entire file into array
    close FILE;
    chomp @read;
    
    #searching for a key word inside
    ...
    See more | Go to post
    Last edited by eWish; May 26 '09, 07:17 PM. Reason: Please use the [code][/code] tags.

    Leave a comment:


  • Sevla
    replied to FILEHANDLE Questions
    in Perl
    can someone help me with code to get a specific word, from a text.txt

    here is the code, i cant find where is mistake
    Code:
    #!C:/perl/bin/perl.exe
    open (my $read, "c:/perl/notice.txt" )|| die "failed to open notice.txt $!\n";
    while(<$read>) {
    print "$_";
    }
    close $read;
    
    print "search a word\?\n";
    $choose=<STDIN>; chomp
    ...
    See more | Go to post
    Last edited by numberwhun; May 22 '09, 10:20 PM. Reason: PLEASE use code tags!

    Leave a comment:


  • Sevla
    replied to FILEHANDLE Questions
    in Perl
    the last question about this topic...

    with external files as text.txt i can use this code?

    by replace the @list_name for open ( $file "c:....../file.txt")|| die "failed to open text.txt $!\n"; ??

    thanks for your kind patience
    See more | Go to post

    Leave a comment:


  • Sevla
    replied to FILEHANDLE Questions
    in Perl
    my falt,

    thanks a lot,

    i just started programming these last few days,
    See more | Go to post

    Leave a comment:


  • Sevla
    replied to FILEHANDLE Questions
    in Perl
    thats a simple example, im trying to make a searching by a list name, looking for a specific word or name,

    Code:
    #!C:/perl/bin/perl.exe
    
    @list_name = (carlos,jonas,bruno,jonas,milles,cassio,otario,
    felipe,loko,anta,paulo,roberto,jose,pablo,srv,zeraldo,eduardo,
    caio,kaua,diego,fabio,pedro,helbert,geraldo,jonathan,linus,
    theo,ken,monstro,otaciolio,tonhao,beto,dartanhan,joe,jimi),
    
    print
    ...
    See more | Go to post
    Last edited by numberwhun; May 22 '09, 10:18 PM. Reason: PLEASE use code tags!

    Leave a comment:


  • Sevla
    started a topic FILEHANDLE Questions
    in Perl

    FILEHANDLE Questions

    hello

    im novice perl programmer, and i need a little help about manipulating files, as text.txt for example,

    i need seek some specific "word" or information on the txt file or any external file and display an error log if the word/info was not found, such as creating a log file reporting with details

    and i have not known the code to do this yet,

    Thanks for patience
    See more | Go to post
No activity results to display
Show More
Working...