Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. jupiler

    reading multiple files

    Thanks. It works nicely. This has been very helpful! Regards.
  2. jupiler

    reading multiple files

    This is the script. What do I need to change in order to apply it to multiple files? The eventual output files need to have the same name as the input files, but stored in a different folder (e.g. C:\Perl\Corpus\). Any help will be appreciated. Thanks! print "Name of file (leave out...
  3. jupiler

    reading multiple files

    The txt files in the folder are convered pdf files from which I want to remove the 'hard returns'. For instance: John is walking in the park. He is walking with Mary. becomes: John is walking in the park. He is walking with Mary. I've written a, I admit, not-so-elegant script which works...
  4. jupiler

    reading multiple files

    By browsing through the archives, I found some relevant lines: opendir(FOLDERNAME, "[path of folder]"); @Files=grep(/\.txt/, readdir(FOLDERNAME)); close(FOLDERNAME); foreach $file (@Files){ [specification of the command] } Unfortunately, it does not work so there must be some mistake in...
  5. jupiler

    reading multiple files

    Hi, I'm used to applying Perl scripts to only one file. What do I need to add to them in order to handle a complete folder in which multiple txt files are stored? Thanks for your help! J
  6. jupiler

    Pattern matching: keywords in contexts

    Thanks mikevh, Great feedback, I appreciate that! >>I'd recommend that you always chomp files when reading, and put the "\n" back on when writing or printing. Leaving the line-terminators on is almost never a good idea. J: ok, set to automatic pilot from now on ;-) >>Also you...
  7. jupiler

    Pattern matching: keywords in contexts

    Hello, I'm trying to retrieve the contexts of each keyword in an array. The problem is that I only get the right output for the last keyword in the array. Example: FILE1: tree apple FILE2: This is a tree. The aPple is green. It looks like a tree. should become: ** <KEYWORD>tree...
  8. jupiler

    Changing file formats

    Hi, How do I quickly change this format: tag tag1 word word1 sentence sentence0.2 into this one: tag tag 1 word word 1 sentence sentence 0.2 Fields are separated by tabs and after each number a newline is printed. Thanks in advance. J
  9. jupiler

    text mark-up

    thx! It works. J
  10. jupiler

    text mark-up

    The script does not work. Nothing happens. I'm using gawk. Could that be the reason why? Cheers, J
  11. jupiler

    text mark-up

    Hi all, Could s.o. help me in finding a script for the following task: given the two input-files 'list.txt' and 'text.txt', I need to have a script that looks for all the words (listed in the list.txt file) in the text.txt file and places them between §. So, if list.txt is for instance: cat...
  12. jupiler

    problem with arrays

    Hello, While working on the previous script, I encountered a new problem. Given a file (&quot;termlist.txt&quot;) and an inputfile (&quot;textfile.txt&quot; --> one sentence = one line), I need to write a script that states: If a pattern in sentence X of &quot;textfile.txt&quot; matches a term...
  13. jupiler

    Inserting lines in one single file

    Hi, The &quot;premier&quot; does not have to be changed. The idea is, irrespective of the content of the lines, to get the output as it is shown in the example above. Would it also be possible to write a (gawk) script in which you state that awk should: 1. first print &quot;**&quot; 2. print...
  14. jupiler

    Inserting lines in one single file

    Hi, Four files (one for Dutch, one for French, one for Italian and one for English) need to be merged into one single file. Dutch file: <Seg L=NL-BE>Artikel 1 <Seg L=NL-BE>Artikel 2 English file: <Seg L=EN-GB>ART. 1 <Seg L=EN-GB>ART. 2 Italian file: <Seg L=IT-IT>Articolo 1 <Seg...

Part and Inventory Search

Back
Top