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 Chriss Miller 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: johngiggs
  • Content: Threads
  • Order by date
  1. johngiggs

    How do I print from a specific string to a new line with a matching pattern

    Hi, I have a log file I want to parse. Lines normally begin like this: 2022-04-07 12:46:14,624-0400 some text here 2022-04-07 12:46:14,625-0400 some more text here 2022-04-07 12:46:14,625-0400 ERROR something oh my gosh this is terrible bad error message 2022-04-07...
  2. johngiggs

    Awk Script Using a Secondary Input File

    Hi, I have an awk script that I've been using to parse some data from a file. The source data has some things that are inaccurate, so I'd like to replace certain strings with data from another file. Here's what I originally was using for one section: /^department:/{departmentnumber =...
  3. johngiggs

    PHP 5.3.3 vs. PHP 5.4.16

    I have a PHP script which I'm using in a html form. It works fine in PHP 5.3.3, but not on 5.4.16. <?PHP $filename = "/tmp/restart.txt"; #Must CHMOD to 666 $text = $_POST['requester']; # Form must use POST. if it uses GET, use the line below: $text2 = $_POST['reason']; # Form must use POST...
  4. johngiggs

    Regex Question

    Hi, I am doing some regex to allow CORS for specific domains. Currently I'm using the following: SetEnvIf Origin "^http(s)?://(.+\.)?(mysite\.org|mysite2\.com)$" CORS_ALLOW_ORIGIN=$0 This should allow *.mysite.org and *.mysite2.com via CORS. The problem I'm encountering is that if the DNS...
  5. johngiggs

    Apache RewriteRule or RewriteCond

    Hi, I've been trying to craft a RewriteRule to alleviate an issue we're seeing with some inbound links. Something is appending ?null to the URL. I tried several RewriteCond and RewriteRule options I could think of to no avail. A sample URL is...
  6. johngiggs

    Help Splitting Field of Input File

    Hi, I'm writing an awk script to parse an input file. The input file has many fields about a user. There is one field I need to break up into pieces. ... givenName: John sn: Smith st: CA postalCode: 90210 departmentNumber: 999-IT Department ... I am already calling the script with awk -F"...
  7. johngiggs

    Help with setting destination of uploaded file dynamically

    I have a basic PHP script that I use to upload files. I can hard code the destination in the PHP script, but I want to set it dynamically via a variable I issue via curl. Here's the script I am working on: <?php $target_path = "$destination"; $target_path = $target_path . basename(...
  8. johngiggs

    Display selected fields from one sheet on a new sheet in alphabetical order

    I have tried a few different things with VLOOKUP in Excel to try to display data from one sheet on a new sheet in alphabetical order, but was unsuccessful. The data I want in the new sheet is in columns A and Q of sheet 1. If Q is not null print the value of column A and column Q in column A...
  9. johngiggs

    How do I set the appropriate number of tabs in an awk script?

    I have an awk script that I'm using to print out the columns of a file and I have the column width set to 60 for each: printf ("%-60s %-60s\n", value1, value2) That works fine, but in this case, I want the fields to be tabbed, but obviously with a longer line X number of tabs will not keep...
  10. johngiggs

    How do I create a form and use the value to pass to a base URL?

    I am trying to create a HTML form and pass the value of the search field to append it to the URL. For example: Search: 123456 Press "Go" and the destination URL becomes http://www.example.com/page1/123456. I know how the basic forms work, but I can't figure out how to append the base URL...
  11. johngiggs

    Using while loop on file with spaces in some fields

    How can I use a while loop to read a file that has spaces. Ex. input.file looks like this: Field 1 Field 2 Field 3 cat input.file | while read field1 field2 field3 do ... done The problem I'm having is that the while loop is breaking up the fields into 6 fields instead of 3. Any...
  12. johngiggs

    Atempo Time Navigator Docs/Help

    All, Does anyone know of any good resources for Atempo Time Navigator? The last 2 companies I've worked for had NetBackup and the new company has Atempo Time Navigator, which I'm not at all familiar with. Thanks, John
  13. johngiggs

    How do I set a variable that doesn't print the first char of field?

    I am trying to parse a file and have a few fields that need to have character replacement done before the field is printed. So the input file looks like this: D10/04/2011 T$5.29 C PA STORE MSOMEPLACE, STATE ^ I need the ^D, ^T, and ^P to find what I want, but I then I want to set the...
  14. johngiggs

    How do I skip an empty record in my awk script?

    I have an input file that's missing some data. I need to figure out how to only print the server name if there is no nameserver data. server1.mydomain.com search somdomain.com nameserver 10.1.1.154 nameserver 10.1.1.155 server2.mydomain.com server3.mydomain.com server4.mydomain.com ...
  15. johngiggs

    Keeping Values While Parsing

    I wrote an awk script that lets me parse the file and print the first host name, but I can't figure out how to get it to display other hosts in the same policy. BEGIN{printf ("%-28s %-10s %-30s %-15s %-30s %-38s %-15s\n", "Policy", "Active", "Client", "OS", "Schedule", "Type", "Policy...
  16. johngiggs

    Issue Trying To Redirect Based On A URI With Hex

    I have a URI that I'm trying to redirect back to the homepage on my site. For some reason since it contains hex I can't seem to get it to work. A sample source URL is...
  17. johngiggs

    zfs zpool issue

    I had a zpool spare disk that failed and was replaced. pool: diskpool01 state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM diskpool01 ONLINE 0 0 0 raidz2 ONLINE 0 0 0 c0t0d0 ONLINE...
  18. johngiggs

    Parsing a file

    I'm having trouble parsing what should be something simple. I have an input file with lines like this: domain1.com www.domain2.com domain2.net www.anotherdomain.nl domain4.com ... etc. So usually there are 2 lines per record, but sometimes there will be just 1. The desired output is...
  19. johngiggs

    How do I parse a file and use an if clause where needed?

    I have a file in this format: from: http://domain.subdomain.tld/path/to/redirect to: http://newdomain.subdomain.tld/path/to/redirect/to from: http://domain.subdomain.tld/path2/to/redirect?code=abc to: http://newdomain.subdomain.tld/path2/to/redirect/to I want to parse the file to give me...
  20. johngiggs

    Maintaining Consistent Drop Down Menu

    I have a lot of pages on my site and would like to find a better way to manage changes I make to my CSS dropdown menu (from: http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm) for example. If I update the menu on the homepage with a new item, I would then need to update all subpages...

Part and Inventory Search

Back
Top