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 bkrike 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: *

  • Users: thunderkid
  • Content: Threads
  • Order by date
  1. thunderkid

    Selecting Last Records

    How do I use awk to select last record in data below: 23 100 345 F0001 24 400 241 F0002 25 234 213 F0002 30 234 211 F0003 31 212 211 F0003 32 112 211 F0003 26 212 211 F0004 desired format 23 100 345 F0001 25 234 213 F0002 32 112 211 F0003 26 212 211 F0004 Thanks thunderkid
  2. thunderkid

    Summing Column Data

    I am trying to sums up col2 data in following data file # ----- data.txt ------- alpha 2 alpha 3 beta 4 beta 6 beta 10 gamma 1 alpha 4 alpha 10 desired results Col1 sums alpha 9 beta 10 gamma 1 alpha 14 Note that col1 fields may be repeated, but I want to make new calculation when they...
  3. thunderkid

    Workaround for IF Worksheet Function

    I am running into limitations with IF worksheet function--allows seven nested IF statement. I have budget worksheet and I want the balance to be read based on month of year. Here is an example: B2...
  4. thunderkid

    Selecting Records and Averaging Fields

    Need help! I am trying to calculate the average for the 5th column values for records when value in third column changes. A sample of data is given below. thanks thunderkid data ----- short 2 1 3 2 0 short 2 1 3 2 0 short 2 1 3 2 0 short 2 1 3 2 0 short 2 1 3 2 0 short 2 1 3 2 0 short...
  5. thunderkid

    Using Cut Command To Split File

    I am trying to format inputs from several processed files. I want to use cut command. Current: File1col1 File1col2 File1col3 File1col4 I have tried: cut -f1,2 File1.dat > firstsec.dat cut -f3,4 File1.dat > thirdfourth.dat The files have space as a delimiters. As I have use Cut it is not...
  6. thunderkid

    Calculating Totals

    I need to calculate the total for last two columns and print values in summary table. Sounds simple? I have tried modifying other scripts and searching the forum, but just don't get it. Below is sample data: 1 redx 55 1 redy 47 2 redx 23 2 redy 42 3 redx 50 3 redy 51 . . . 30 redx 30 30 redy...
  7. thunderkid

    Summarizing Data in Columns

    This is second part of previous thread. I need help with summarizing the results of data collection process. The data is as follows: short 1 1 455 17 8 0 short 1 1 455 20 6 2 short 1 1 455 20 4 2 short 1 1 345 20 4 0 short 1 2 405 17 8 0 short 1 2 220 17 6 2 med 1 1 455 17 8 0 med 1 1 450...
  8. thunderkid

    Calculations Involving Two Rows

    I am trying to make a calculation from data below for equipment simulation.Sample of data is given below for short and med cases. The calculation is for solvent that is expended during operation. Col 6 shows the amount of solvent available. To get expended solvent you have to subtract next...
  9. thunderkid

    Create Chart Using Dynamic Range (Q146055)

    I am attempting to use Q146055 to build chart using a macro. I have included sample data and code below. I added Dim statement for myrange and mysheetname. I am getting the following error Runtime error '1004' Method 'Range of object' _Global failed Debug jumps to Range ("c4").Select I am...
  10. thunderkid

    Create Chart Using Dynamic Range (Q146055)

    I am attempting to use Q146055 to build chart using a macro. I have included sample data and code below. I added Dim statement for myrange and mysheetname. I am getting the following error Runtime error '1004' Method 'Range of object' _Global failed Debug jumps to Range ("c4").Select I am...
  11. thunderkid

    Create Chart Using Dynamic Range (Q1460550

    I am attempting to use Q146055 to build chart using a macro. I have included sample data and code below. I added Dim statement for myrange and mysheetname. I am getting the following error Runtime error '1004' Method 'Range of object' _Global failed Debug jumps to Range ("c4").Select I am...
  12. thunderkid

    Picking the Right Records

    I am trying to modify a current awk script that PHV provided on an earlier thread (271-801668). I have provided my current task and PHV’s script for earlier task. Here is sample of input file: 123 <time1_data> xxxx bbb1 cccc1 dddd1 123 <time2_data> xxxx bbb1 cccc1 dddd1 234 <time3_data>...
  13. thunderkid

    Selecting Records from Data

    I am a novice at awk. I have searched database for script that I might modify, but have not had any success. I am trying to selectively picked records from data file. Here is a sample of input file: 123 <time1_data> aaaa 123 <time2_data> aaaa 234 <time3_data> aaaa 234 <time4_data> aaaa...
  14. thunderkid

    Reading Multiple Text File into Single Worksheet

    I would like to open multiple text files into a single Excel file (each file would be extracted onto a sheet). I would like to read the text files, up to 20 files, from a text file. I know that I can use the following subroutine for single text file into one worksheet: Sub OpenTextFile()...
  15. thunderkid

    Reading Search Values from a Second File

    I want to thanks the many out there that give so much to helping others learning about “awking”. Your help has really made a difference in my being able to tackle data extractions and formatting. I am extracting data from a text file. The text file has thousands of line and up to 25 columns...
  16. thunderkid

    Run Into a Snag with Awk

    I am a novice user of awk. I am at the end of my wit trying to understand what I am doing wrong! I have the following script: $4 == "rt45" END { print $0 } My input file: seed1 0:01:41.0 2345 rt45 abc 0:01:42.0 2345 rt45 seed1 0:02:03.0 2345 rt45 abc 0:03:04.0 2345 rt45 seed2 0:03:05.0...
  17. thunderkid

    Getting Awk to Add Zeroes

    I have a simple awk script that I am trying to get awk script to print 0 (zero) when it does not find any quantities as it searches a data file. Here is an example script BEGIN { print "nuts", "apples" } $1 == nuts && $8 == apples {found++} END { print $1, $8} I have tried inserting the...
  18. thunderkid

    Adding Text to Selected Lines (Revisited)

    I need to create new file as follows: Input: 34567645 abc 0:01:41.0 2345 rt45 abc 0:01:42.0 2345 rt45 abc 0:02:03.0 2345 rt45 abc 0:03:04.0 2345 rt45 56753434 def 0:03:05.0 erte wfe5 def 0:03:06.0 erte wfe5 def 0:04:07.4 erte wfe5 def 0:05:08.5 erte wfe5 Desired output: 34567645 abc 0:01:41.0...
  19. thunderkid

    Adding Text to Beginning of Selected Line

    I need to create new file as follows: Input: Seed 34567645 abc 0:01:41.0 2345 rt45 abc 0:01:42.0 2345 rt45 abc 0:02:03.0 2345 rt45 abc 0:03:04.0 2345 rt45 Seed 56753434 def 0:03:05.0 erte wfe5 def 0:03:06.0 erte wfe5 def 0:04:07.4 erte wfe5 def 0:05:08.5 erte wfe5 Desired output...
  20. thunderkid

    Extracting Time From Multiple Lines of Data

    I would like to extract time from last records from data set shown below: input abc 0:01:10.0 rtyh jdkrd abc 0:01:30.0 rtyh jdkrd abc 0:01:60.0 rtyh jdkrd abc 0:02:10.0 rtyh jdkrd abc 0:03:00.0 rtyh jdkrd desired output abc 0:03:00.0 rtyh jdkrd Tahnks

Part and Inventory Search

Back
Top