noob question - is awk the tool to clean dirty text files?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting noob question - is awk the tool to clean dirty text files?
# 1  
Old 02-21-2010
noob question - is awk the tool to clean dirty text files?

Hi,

nevermind. I think I've found the answer. It appears I was looking for index, match, sub, and gsub.

I want to write a shell script that will clean the html out of a bunch of files and format the data for import into excel.

Awk seems like a powerful tool, but it seems oriented to text that is already formatted and delimited. From my cursory study, awk seems to only be able to access lines and words. Is there a way to find and manipulate chunks of text within an awk "word".

Or perhaps there are better tools...?

Last edited by yogert909; 02-21-2010 at 08:18 PM..
# 2  
Old 02-22-2010
html2text exists
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Alignment tool to join text files in 2 directories to create a parallel corpus

I have two directories called English and Hindi. Each directory contains the same number of files with the only difference being that in the case of the English Directory the tag is .english and in the Hindi one the tag is .Hindi The file may contain either a single text or more than one text... (7 Replies)
Discussion started by: gimley
7 Replies

2. Shell Programming and Scripting

awk help or any other tool to sort between two files

Experts Good day, I want to sort two files f1 & f2 to matching with f1's first field with f2's 3rd field like to get in a result file : I tried with join but getting wrong result, I think there must be something with awk or other unix tool: cat f1 MYQCI63 srvcmi12 D7QDI ... (4 Replies)
Discussion started by: rveri
4 Replies

3. Shell Programming and Scripting

For loop -- noob question

Hello, I am new to shell scripting and i am trying to figure why is this not working with else statement. I am searching for every directory in that DIR i am in, however the "else" seems to be triggered whenever the run the script.. Much thanks in advance! #!/bin/shell for item in... (3 Replies)
Discussion started by: Reb0rn
3 Replies

4. Shell Programming and Scripting

Need help with awk tool - finding text between two patterns

This is regarding using awk tool to find lines matching between 2 patterns. cat file | awk '/pat1/,/pat2/' But it's not working as expected in the following case. If pat1 also comes after pat2 then it's matching whole file after pat1. e.g. # > cat -n file 1 First line... (3 Replies)
Discussion started by: anand_bh
3 Replies

5. Ubuntu

Simple Noob Question

I am editing the squid.confi on my server. I am done editing. How do I exit the confi file? Thank you. (2 Replies)
Discussion started by: sethartha
2 Replies

6. UNIX for Dummies Questions & Answers

Noob question on comparing #'s.

I have a file with 3 digit numbers in it formatted as such: 123 065 321 How would I go about seeing if each number is less than 100 and if so outputting it to another file Yes, I am a bit of a noob. I have tried with grep but I don't think it'll work. Any general direction would be... (6 Replies)
Discussion started by: kirkm76
6 Replies

7. UNIX for Dummies Questions & Answers

Noob sorting question

Ok here is the deal, I have a command given to me by some systems guy who I cannot get ahold of on the weekend without paying him alot of money to help me. I need to get this done before Monday as I am just getting pummeled by DOS attacks. The comand given was.... netstat -ntu | awk '{print... (1 Reply)
Discussion started by: Hexabah
1 Replies

8. Programming

Question about compiling (noob)

I'm just getting started to lean C and I'm using Ubuntu today I found a tutorial at this site: http://einstein.drexel.edu/courses/CompPhys/General/C_basics/c_tutorial.html and I got an error after compiling the fist code: #include < stdio.h> void main() { printf("\nHello World\n"); } ... (9 Replies)
Discussion started by: arya6000
9 Replies

9. UNIX for Dummies Questions & Answers

Is there any non graphical tool that make selective merge between text files?

whitout using awk / sad and so on? (3 Replies)
Discussion started by: umen
3 Replies
Login or Register to Ask a Question