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 TouchToneTommy 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. bigbalbossa

    Running a script under a different user using 'become'

    I have a txt file containing a list of filenames (with full path) that need to be deleted from a server. Currently, i have to manually run a delete script as user 'xyz' using the become command on linux: roc01[phase1]:/u02/Code> become xyz dug's Password: ***manually enter my password, then...
  2. bigbalbossa

    Compare Keys and overlay data

    I'm doing a string compare on two variables in two different files. File1: contains a lookup key File2: contains the lookup key, key2, and key3 field If the file1 key matches a key in file2, i need to append the key2 and key3 fields to file1. My current script is working properly, but...
  3. bigbalbossa

    Assigning Nth value to every record in file

    All, I have a script that calculates an nth value. I need to use this value to assign a number to every record in my file. For example, if my datafile contains 2000 records and i want to keep 100 nth'd records, my value will be 16 (based on a formula in my script). Now, i need to print each...
  4. bigbalbossa

    Unix: Sorting file based on bytes

    What syntax can be used if I want to sort a 900 byte fixed length file on bytes 40 - 60 (may or may not be numeric)? I'd like to develop a perl script with an option to allow users to specify a sort range. Thanks
  5. bigbalbossa

    Hash - how to print value if key exists

    Guys/Gals I've created a hash with List Code being key, and value being the count: open(F1, "file1") || die ... while(<F1>) { $hash{$LIST}++; } Now, i'm bumping this against data in another file and need to print the count if List Code matches: open(F2, "file2") || die ... my $LIST2 =...
  6. bigbalbossa

    Hash - Min and Max values

    A delimited flat file contains two fields: List Number and Seq Number. 1|1 1|2 1|3 1|4 1|5 2|1 2|2 2|3 2|4 2|5 I need to find the min and max value for each list number. Seems easy enough...but i'm struggling. Thanks All.
  7. bigbalbossa

    Find files with next weeks timestamp

    All, I have a script scheduled to run once every Friday night. Origionally, it was to find files matching the current date in MMDDYY format. Now it needs to match the following Fridays date. This friday will be 040607...when the script runs on this date, it needs to find files with 041307 in...
  8. bigbalbossa

    Character Encoding Issue

    All, I've run into an issue I have no experience with. I'm viewing a file in ultraedit that contains one name, UE shows this as (says U8-DOS format): LILIANA MAGAÑA FRANCO When i 'cat' this file on a unix box it looks like: LILIANA MAGAÃA FRANCO when i 'more' this file on a unix box it...
  9. bigbalbossa

    Creating a &quot;simple&quot; report

    All, This little exercise has me confused. I would like to read this file: AL|2 AL|4 AL|7 AL|10 AL|11 AK|2 AK|4 AK|7 AK|10 AK|11 AZ|2 AZ|4 AZ|7 AZ|10 AZ|11 AR|2 AR|4 AR|7 AR|10 AR|11 CA|2 CA|4 CA|7 CA|10 CA|11 And create a report that looks like: 2 4 7 10 11 AK...
  10. bigbalbossa

    Hashes within a hash?

    Guys...this is going to be a little long, bear with me. The following code with work on the input file data below on a Unix Tru64 system. With the help of this forum, i was able to figure out how to print my hash horizontally, now i need to add the third field in this file ($ptype) to my...
  11. bigbalbossa

    Can can a foreach loop be printed horizontally?

    Loop: foreach my $key (sort keys %hash) { printf SERVER ("Source: %d\r",$key); print SERVER ("--------------------\r"); printf SERVER ("Recs with Blank FNAME: %d\r", $hash{$key}{12}); printf SERVER ("Recs with Blank LNAME: %d\r", $hash{$key}{25})...
  12. bigbalbossa

    Net::FTP - error finding files with spaces

    Hi All, I have a script that reads a flat file containing only filenames, then does a listing on those files to see if they exist on the server...but it's choking on files with spaces in name. I've tried about everything i can think of to no avail. Just using the normal ftp login and then...
  13. bigbalbossa

    Finding files using cmd on windows xp

    Hey guys/gals, Is it possible to use the cmd prompt to find files over 1GB??? I've search all over the freakin place...basically, i just want to create a report list all files over a certain size.
  14. bigbalbossa

    Tru64 - unzip file with password question

    How can you unzip a winzip'd file (transferred in binary) on a Tru64 box? I've tried unzip -P, but it's not working. Error: Archive: Final.zip skipping: Final.txt need PK compat. v4.5 (can do v2.1)
  15. bigbalbossa

    Greediness in tr question

    I'm trying to count the number of delimiters in a line, but having trouble with files that are delimited by ~^. If the file is delimited by a pipe...the following code works fine, but when ~^ is introduced...tr treats each character separately. Can you make tr look for ~^ together...
  16. bigbalbossa

    Newbie Question: How to count pipes in a string / output to file

    I have been a perl programmer for years and now trying to teach myself C...seemed like a good idea :) My exercise for the day is to create a program that: 1) Reads a pipe delimited file. 2) Counts the number of pipes per line 3) Outputs two files, one with the correct number of pipes, one...
  17. bigbalbossa

    Removing every other character from lines

    Guys, I have a txt file that has a space between every character in entire file. For example: 2 5 J L 1 7 / 3 3 T M N T A N should be: 25 JL 17/33 TMN TAN What's the best way to remove this space? I'm sure you awk guys have any answer :)
  18. bigbalbossa

    Can you print every nth record in a file

    Of course you can...but this has turn into a HUGE hassle. I simply need to read a file and print every 15th record...thoughts?
  19. bigbalbossa

    Parse Excel Data using Win32::OLE

    Perl Gurus, i've read numerous threads concering perl and excel, but unfortunately none seem to enlighten me. I have a number of excel files that i need to read, if the string "TEST" exists, replace with "TESTED" and save the file. Seems easy enough, but i've not worked with this module much...
  20. bigbalbossa

    File Retention Script

    I would like to delete files from a remote server via ftp based on date. A 'dir' produces this listing: -rwxrwx--- 1 proc C01998 42 Nov 23 12:12 HF_AVSVH_OP.ctl -rwxrwx--- 1 proc C01998 40 Dec 12 10:37 HF_AVS_OP.ctl Retention is 10 days, so the file HF_AVSVH_OP.ctl should be deleted (base...

Part and Inventory Search

Back
Top