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 dencom 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: FedoEx
  • Content: Threads
  • Order by date
  1. FedoEx

    Array help.

    I have four columns input data.x,y,z b,c,d are some numbers not necessarily the same. x 0 z1 bl x 0 z2 cl x 0 z3 dl 0 0 z1 bc 0 0 z2 cc 0 0 z3 dc 0 y z1 br 0 y z2 br 0 y z3 br The data could be separated in blocks of triplets for which the third column is the same. The sequence z1,z2,z3 would...
  2. FedoEx

    Convert to *.js file

    Input file 1300483198 -4.60508 1300483199 -4.60825 1300483200 -4.60691 1300483201 -4.60581 1300483202 -4.60806 1300483203 -4.60747 1300483205 -4.60788 1300483206 -4.60704 1300483207 -4.60843 1300483208 -4.60675 1300483209 -4.60827 1300483210 -4.60721 1300483211 -4.60807 1300483212 -4.60778...
  3. FedoEx

    print string that is on the next line below the regex

    simple example inputfile regex1 regex2 regex3 1 2 3 4 5 6 regex1 regex3 regex2 aa bb cc 7 8 9 If I want to print the next line after the regex2. In my inptut file awk '/regex1/{getline;print $0}' inputfile How can I print only the...
  4. FedoEx

    Extract ranges of lines based on values in the lines

    Sample input 1 y 10 2 y 11 3 y 10 4 n 12 5 n 22 6 y 12 7 y 12 8 n 33 9 y 12 10 y 10 11 y 10 12 y 10 13 y 10 14 y 11 If I want to extract list of lines for which $2==y I can do. awk '$2=="y"{print $1}' list 1 2 3 6 7 9 10 11 12 13 14 What I really need is to print...
  5. FedoEx

    Variable Number Input arguments inside infinite while loop

    #!/bin/bash while : #infinite loop do echo " what is your choice .." read ch #expects to read only one input echo " ok your choice is " $ch #execute the simple function with the ch arg done Is there a way to do the code above for a random number of input arguments...
  6. FedoEx

    Variable number of input arguments and why did I need {/strt/,/end/}

    I advanced a lot in awk mainly thanks to this forum. I am posting here my latest creation and the way I arrived to it. I am asking you gurus for alternative way to do this or for possible improvements, suggestions .... Here is the example infile $cat infile #S 1 line one contents...
  7. FedoEx

    Another way to print between two regular expressions

    Test file $cat testfile a b c 1 2 3 begin line with first regex block 1 11 between 2 12 regex 3 13 end line with last regex 4 5 6 blah blah I need another method printing the block between two regular expressions where the entire code is in “{ }” brackets. I was...
  8. FedoEx

    Loop over repeating blocks

    Example data.in hundreds of blocks that look something like that #S 1 a b c d 11 2 3 0 31 5 6 1 72 8 9 2 end block one #S 2 a f g h 24 3 4 0 62 7 8 1 52 6 8 2 45 7 9 3 87 4 1 4 end block two #S 3 d g k j 11 4 5 0 33 1 3 1 43 4 6 2 end block three The numbers of lines with numbers is...
  9. FedoEx

    awk gsub between the first two regular expressions in multiple dirs.

    Awk gsub between the first two regular expressions in multiple dirs. Hello. I create 10 directories at once with $for (( i=0; i<10; i++)) ;do mkdir $i; done In all of these 10 directories I copy the same file parsec.in. I know how to print between the two regexp $awk ' /begin...
  10. FedoEx

    grep sed awk match only regexp1 AND regexp2 AND regexp3 ..

    I know how to do OR in awk awk '/regexp1|regexp2|regexp3/{print}' filename or sed sed -n '/regexp1\|regexp2/\|regexp3/p' filename and grep grep "regex1\|regexp2" filename mathes lines regex1 or regex2 or regexp3 How do I match lines containing only regexp1 AND regexp2 AND regexp3...
  11. FedoEx

    Use one awk '{... }' instead of three in a bash script

    I have the data file which looks like that #S 1 …............ #D Tue …....... ….................... ….................... #S 350 a2scan oh -4.42031 -3.62031 or 0.298354 0.381046 28 -600000 #D Tue Feb 17 05:02:03 2009 #P7 S4L S4R S5L...
  12. FedoEx

    Conditional merge two files with awk

    Hello. I am in a process of learning awk. I read and tested most of the examples in the gnu awk users guide regarding the arrays. I also went through this forum in search for solution to my current problem. I have one file with about thousand lines which looks like that. data1 S 1 A 20...

Part and Inventory Search

Back
Top