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 strongm 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: ChrB
  • Order by date
  1. ChrB

    RegEx meets curly brace } - not

    Yep that did the trick! Thanks PHV
  2. ChrB

    RegEx meets curly brace } - not

    Hi folks I have - with your help - some code which shortens lines in a file to a specified length MaxLen: k = length while ( k > MaxLen ) { for (m = MaxLen; m > 0; m--) if (substr( $0, m, 1) == " ") break if ( m == 0 ) m = MaxLen print substr($0, 1, m) > Output...
  3. ChrB

    Cut string to xx char, insert newline at nearest space

    CaKiwi - thanks a lot, it works like a charm ! Less code, more functionality ! Am I correctly understanding that the for-loop targets only the statement "if (substr(...) break" ? Did not know that you can assign a new value to $0 - guess I have learned somic tonight ! Thanks Chris
  4. ChrB

    Cut string to xx char, insert newline at nearest space

    I am using GNU Awk 3.1.0 on Windows and have checked the manual of V. 3.1.3. There seems to be no fold command... or am I missing something? thanks
  5. ChrB

    Cut string to xx char, insert newline at nearest space

    I have files with long text strings that need to be cut to a certain length. This is the code I have done so far: 10: MaxLen = 60 # desired length of string 20: LineLen = length($0) 30: if ( length($0) > MaxLen ) { # If $0 >...
  6. ChrB

    SUB-criteria covering two lines ?

    Hi folks Thanks a lot for your replies. Both solutions are working fine! Now I have to choose which one serves best. Thanks!
  7. ChrB

    SUB-criteria covering two lines ?

    Hi I am new to AWK, on Windows, and need to re-format textfiles like this one: :54:any text on one line :86:this text field co vers two lines or ev en more lines :54:here is another text on one line The result should show all lines beginning with :xx: ; the record starting with :86: should...

Part and Inventory Search

Back
Top