text file analysis


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting text file analysis
# 1  
Old 07-08-2008
text file analysis

Hello,

I have a text file containin 4 lines which are repeated along the file, ie

the file looks like this:

16:20:12.060769 blablabla 40
16:20:12.093199 blablabla 640
16:20:12.209003 blablabla 640
16:20:12.273179 blablabla 216
16:20:27.217444 blablabla 40
16:20:27.235410 blablabla 640
16:20:27.327552 blablabla 640
16:20:27.395484 blablabla 216

.......

I want to read the file line by line, take the first word of each one, ie the date, conver it to ms, then stock it in tables, I will have 4 tables, T1 containing the dates of 1,5,9 ...lines

T2: 2,6.. lines
T3: 3,7... lines
T4: 4,8... lines

ANy help please??
# 2  
Old 07-08-2008
This makes a list of ms
Code:
   tr -s '[:punct:]' ' ' <inputfile | \
   awk '{sum=$1*3600000 
          sum+=$2*60*1000
          sum+=$3*1000 
          sum+=$4/1000 
          printf("%12.0f\n", sum)}'

I'm not clear about separation.
# 3  
Old 07-08-2008
Thanks so much,

Just this makes only the conversion , but what about the tables? and how will I make difference between the lines ?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies

2. Solaris

pstack file analysis

Hi ... Can you please share how to analyse pstack file and various options for core dump analysis (3 Replies)
Discussion started by: anand87
3 Replies

3. UNIX for Dummies Questions & Answers

Text analysis

Hey Guys, Does anyone know how to count the separate amount of words in a text file? e.g the 5 and 20 Furthermore does anyone know how to convert whole numbers in decimals? Thanks (24 Replies)
Discussion started by: John0101
24 Replies

4. UNIX for Dummies Questions & Answers

Help with text analysis - UNIX

Hey Guys I recently posted yesterday about trying to count the amount of separate words that exists in a text file e.g. walle.txt. i want the output to give to give me a list of words with a number next indicating how many times its came up in the file e.g: cat 20 the 11 if 40 I'm... (0 Replies)
Discussion started by: John0101
0 Replies

5. Shell Programming and Scripting

Log File Analysis

Hi All, Given a list of date and time, how can i split them in intervals of 1 hour. The input file is listed as below f.e.: 16-OCT-2009 09:11:47 10.65.4.24. . . (1 Reply)
Discussion started by: x-plicit78
1 Replies

6. Solaris

Core file analysis

How can we analyze a core file and determine why it was generated on a solaris system? I know file core filename will tell us what program generated the file. But, what to do next to get more details? Thanks, (5 Replies)
Discussion started by: Pouchie1
5 Replies

7. UNIX for Advanced & Expert Users

WEB Server Log File Analysis using awk/sed/grep

I'm trying to find a way to show large page sizes (page size in K) from multiple web server log files. Essentially I want to show only rows from a file where a specific column is larger than some value. Has anyone ever done this type of log analysis? If so, a snippet of code would be very... (2 Replies)
Discussion started by: mike_cataldo@ad
2 Replies

8. Shell Programming and Scripting

AWK script: decrypt text uses frequency analysis

Ez all! I have a question how to decrypt text uses letter frequency analysis. I have code which count the letters, but what i need to do after that. Can anybody help me to write a code. VERY NEEDED! My code now: #!/usr/bin/awk -f BEGIN { FS="" } { for (i=1; i <= NF; i++) { if ($i... (4 Replies)
Discussion started by: SerJel
4 Replies

9. UNIX for Dummies Questions & Answers

core file analysis

Hi folks, I'm hoping someone would be charitable enough to give me a quick explanation of adb usage for analyzing core files...or point me in the right direction. A search here revealed scant results and web searches are providing me with ambiguous information. Running Solaris. Thanks,... (1 Reply)
Discussion started by: kristy
1 Replies
Login or Register to Ask a Question