Parse multiple html files in directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Parse multiple html files in directory
# 8  
Old 12-17-2014
How would you specify a path for other tools?

Try
Code:
"C:\Users\cmccabe\Desktop\list\geneticslab.emory.edu.txt\parse\*"

# 9  
Old 12-17-2014
Code:
  awk     '/^<h2 id="genes"/      {getline
>                                  for (i=1; i<=NF; i++)
>                                         {n1=gsub (".*omim.org/entry/", "", $i)
>                                          n2=gsub (". target = ._blank.>", "\t", $i)
>                                          n3=gsub ("</a>.*", "", $i)
>                                          print $i  >  FILENAME".parsed"
>                                         }
>                                 }
>         ' FS="," "C:\Users\cmccabe\Desktop\list\geneticslab.emory.edu.txt\parse\*"
awk: fatal: cannot open file `C:\Users\cmccabe\Desktop\list\geneticslab.emory.edu.txt\parse\*' for reading (No such file or directory)

For windows, I would quote the path and that seems to have worked to un-suppress the \, but it doesn't like the wildcard. Thank you Smilie.
# 10  
Old 12-17-2014
What's the result of
Code:
dir "C:\Users\cmccabe\Desktop\list\geneticslab.emory.edu.txt\parse\*"

?
# 11  
Old 12-17-2014
Code:
 awk     '/^<h2 id="genes"/      {getline
                     >                       print $i  >  FILENAME".parsed"
                               for (i=1; i<=NF; i++)
>                                         {n1=gsub (".*omim.org/entry/", "", $i)
>                                          n2=gsub (". target = ._blank.>", "\t", $i)
>                                          n3=gsub ("</a>.*", "", $i)
>                                          print $i  >  FILENAME".parsed"
>                                         }
>                                 }
>         ' FS="," dir "C:\Users\cmccabe\Desktop\list\geneticslab.emory.edu.txt\parse\*"
awk: fatal: cannot open file `dir' for reading (No such file or directory)

Thank you very much Smilie.
# 12  
Old 12-18-2014
Please issue above command directly from the command line, not as the input stream parameter to awk.
# 13  
Old 12-18-2014
I used the following in ubuntu and it worked perfectly.
Code:
 awk     '/^<h2 id="genes"/ {getline   for (i=1; i<=NF; i++) {n1=gsub (".*omim.org/entry/", "", $i) n2=gsub (". target = ._blank.>", "\t", $i)                                          n3=gsub ("</a>.*", "", $i) print $i  >  FILENAME".parsed" }
}  
 ' FS="," /home/dnascopev/Desktop/list/geneticslab.emory.edu.txt/parse/*

each of the 97 files in that directory have the original and a.parsed (CM080 and CM080.parsed, CM081 and CM081.parsed). [/CODE]

Is there a way to combine the 97 files that .parsed into one overall file called all_genes.txt? Thank you for all your help Smilie.
# 14  
Old 12-18-2014
Code:
cat *.parsed > all_genes.txt

This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Merge Multiple html files into one

Hi all I have written some code to write my output in html. As i have multiple servers, need to generate single html file. but my code is generating html file for each server. I have merged the files using below code. cat /home/*_FinalData.html > /home/MergedFinalData.html But how to... (1 Reply)
Discussion started by: Snehasish
1 Replies

2. Shell Programming and Scripting

awk Parse And Create Multiple Files Based on Field Value

Hello: I am working parsing a large input file which will be broken down into multiples based on the second field in the file, in this case: STORE. The idea is to create each file with the corresponding store number, for example: Report_$STORENUM_$DATETIMESTAMP , and obtaining the... (7 Replies)
Discussion started by: ec012
7 Replies

3. Shell Programming and Scripting

Parse html

I downloaded source code using: wget -qO- http://fulgentdiagnostics.com/test/clinical-exome/ | cat > flugentsource.txt Now I am trying to use sed to parse it to confirm a gene count. Basically, output (flugent.txt) all the gene names with a total count after them I'm not all that... (5 Replies)
Discussion started by: cmccabe
5 Replies

4. UNIX for Advanced & Expert Users

Mutt for html body and multiple html & pdf attachments

Hi all: Been racking my brain on this for the last couple of days and what has been most frustrating is that this is the last piece I need to complete a project. There are numerous posts discussing mutt in this forum and others but I have been unable to find similar issues. Running with... (1 Reply)
Discussion started by: raggmopp
1 Replies

5. Shell Programming and Scripting

Read multiple files, parse data and append to a file

Hi..Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files In the below files, we are interested in File 1: 38 107 C 3 T 6 C/T 38 241 C 4 T 5 C/T 38 247 T 4 C 5 T/C 38 259 T 3 C 6 T/C... (8 Replies)
Discussion started by: empyrean
8 Replies

6. Shell Programming and Scripting

Parse files in directory and compare with another file

I have two files File 1 in reading directory is of following format Read 1 A T Read 3 T C Read 5 G T Read 7 A G Read 10 A G Read 12 C G File 2 in directory contains Read 5 A G Read 6 T C Read 7 G A Read 8 G A Read 20 A T File2 contains (1 Reply)
Discussion started by: empyrean
1 Replies

7. Shell Programming and Scripting

Need script to remove millions of tmp files in /html/cache/ directory

Hello, I just saw that on my vps (centOS) my oscommerce with a seo script has created millions of tmp files inside the /html/cache/ directory. I would need to remove all those files (millions), I tried via shell but the vps loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies

8. Shell Programming and Scripting

sed to parse html

Hello, I have a html file like this : <html> ... ... ... <table> ....... ...... </table> <table name = "hi"> ...... ..... ... </table> <h1> Welcome </h1> ....... ...... </html> (11 Replies)
Discussion started by: prasanna1157
11 Replies

9. Shell Programming and Scripting

to parse a directory and its subdirectories and find owner name of files

hi all, i need to capture all the files in a directory and its subdirectories that have owner name different than the root owner. for one file it is " stat -c %U filename " but i need to search for each and every file and record it. thanks in advance (14 Replies)
Discussion started by: vyasa
14 Replies

10. Shell Programming and Scripting

Multiple edits to a bunch of html files

I'm trying to upgrade a whole bunch of pages on my site to a new design. I thought one way of doing it would be to enclose the content in special comment tags and then use some form of script to wrap the new html around it. Like this: <!-- content start --> <h1>Blah blah blah</h1> yada yada... (9 Replies)
Discussion started by: dheian
9 Replies
Login or Register to Ask a Question