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 Mike Lewis 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: *

  1. clemhoff

    Array printing and if statement

    It's actually much easier to stack the variable and shorten the logical condition like the way you did. I'm really glad to have learned this technique. Thank you PS: Script editing is not a real problem because it is embedded in an AppleScript.
  2. clemhoff

    Array printing and if statement

    I'm stuck on a problem of array printing and a "if" condition . I tried different combinations with the 'for' loop but the result always returns empty. Also when I try to include the "else" statement, I invariably get an "illegal instruction" message. Could you help me on this? --- SAMPLE ---...
  3. clemhoff

    List output from HTML pages

    Indeed the comment tag is at the end of each record. But I retain the first script... just in case! Thanks for your help.
  4. clemhoff

    List output from HTML pages

    Hi Feherke, Thank you for the script, it works perfectly. (as usual !) One question though, why the if statement line in the "END" procedure? Could you help me understand ?
  5. clemhoff

    List output from HTML pages

    Hello everyone, The extract below is the result of a pipe passed through sed with which I clean white space from HTML pages. /* --- SAMPLE --- */ ... <a href='/books/filebooks_gen_cbooks=41386.html'> <b>L'école de la chair</b></a> (Nikutai No Gakka)<br /> <span class=\"fs11\"> 1963<br />...
  6. clemhoff

    Split File

    Thank you very much Sir PHV !!
  7. clemhoff

    Split File

    Hello All, I would like to split a big "pipe" delimited file in as many files as there are columns. The number of columns being undefined, how to make so that each column header acts as the output file name? Sample IN header1|header2|...|headern 11111|txt1|...|alphanum_n1...
  8. clemhoff

    Insert data with values located n line further

    Annihilannic, You make my day ! Unfortunately the fields contain spaces and other HTML delicacies which I need, as well as the field "flags" which is crushed in the last substitution. But I will manage this by myself. Thank you for your input, code, explanations & ideas ! Regards Clement
  9. clemhoff

    Insert data with values located n line further

    Excuse me to reconsider this subject, but is my problem really unrealizable? If so, would you be so kind to point me in the right direction. Thank you in advance.
  10. clemhoff

    Insert data with values located n line further

    Hello everyone; I have plenty of very large (>60Mo) pseudo-xml files which looks as follows: <?xml version="1.0" encoding="UTF-8"?> ... more lines here </ObjectStyle> <Object type="Field" flags="67108864" flags="67108864"> <Style>128</Style> <Bounds top=" 24" left="138" bottom=" 38"...
  11. clemhoff

    traspose rows in columns

    Hello, no idea what your delimiter is.. A global substitution of consecutive spaces or tabs to a line feed awk '{gsub(/[ \t]+/,"\n")}1' file
  12. clemhoff

    Append next line

    No problem Futurelet ! Your proposal works too. Thank you very much
  13. clemhoff

    Append next line

    Yes, I definitively missed the logical condition... :( Once again, thank you PHV for help, that works a treat.
  14. clemhoff

    Append next line

    Thank you Futurelet for your answer I tried your code, but I'm loosing the delimiter (vertical bar) I get this =2006062859.9370-11125.619 instead of: =2006|0628|59.9370-111|25.619
  15. clemhoff

    Append next line

    Hello, I'm trying to append a line to previous if it doesn't begin with a equal sign Input ... =POUILLY SUR VINGEANNE =2006 0628 59.9370-111 25.619 =45370 ... Expected Output: ... =POUILLY SUR VINGEANNE =2006|0628|59.9370-111|25.619 =45370 What I've tried so far: awk '/^=/ {if (line) print...
  16. clemhoff

    Reduce script/calls

    Yep PVH that works! Thank you M'sieur
  17. clemhoff

    Reduce script/calls

    Hi all, Just wondering if there's a way to write the following command in just one awk call: #!/bin/sh ... awk '{printf "%s" (NR%5 ? "\t" : "\n"),$0}' | awk 'BEGIN{OFS="\t"} {print "'"$1"'", "'"$2"'", $2, $1, $3, $4, $5, "'"`date +%d\/%m\/%Y\ %H:%M:%S`"'", ""}' ... stdout= 27/07/07 92410...
  18. clemhoff

    joining lines conditionally

    Excuse me for this late answer, I exceptionally granted myself long holidays :) So, many thanks to Vlad and Feherke for their answers. (Works perfectly under OS X) Clement
  19. clemhoff

    joining lines conditionally

    Hi All, I'm quite new to awk... I did search on this forum but did not find a solution to my problem.. The problem i am having is how to write this in awk (or sed ): - If a line does not end with a parenthese '(', join every following line till one begining with a ')'- ---------- Input ...

Part and Inventory Search

Back
Top