The problem I am having with the UNPACK function is the following:
I am currently unpacking a record of 220 bytes into 3 variables. The first is to be left untouched, the second has some search and replace stuff going on in it, and the third is untouched. When I print out the results after...
Hi.
The subject may be a bit odd, but what I want to do is create a cron job that will run every evening on the hour from 7pm till 2am. The job will go out and get a file from our server and check this file against counts that already exist on our current machine. If the file matches the...
This is a pretty simple question, but one that I can't seem to find a quick answer for. So I thought maybe someone on this board might be able to help me out. Basically I am using VI to look at a file with 10 records in it. With my cursor on the last character of the record, I hit the...
Hi,
I am trying to figure out how I can successfully SFTP a file from within a shell script. Currently we do a few things with FTP within a shell script, but we are in the process of changing this. Can someone point me to a good way that I might be able to do the same thing with SFTP...
Hello,
I am currently writing a script to print a report after collecting a bunch of information on our servers. The report is looking fine except for 1 thing. There are about 3 spots on the report that the number comes out negative. I tried running the command on the command line and I still...
Hello,
I am trying to use the length function to determine the length of the input string and then print it if it is 1313 long. Else just skip it. This is what I have so far. I am not sure what I am doing wrong. Any help would be great.
#!/bin/ksh/perl -w
use strict;
##Open file for...
I am trying to open a file and then access each line and then enter that line into the "n"th position of an array. I am not sure how to do this. I am pretty new to perl, and would love some help. Here is my small code snippet. What could I do so I can take the undefined length of...
Hello,
I am trying to create a report that checks for populated values in certain positions of a fixed length record. If there is nothing in the string, then it increments a certain counter and if something exists in the string then it increments another counter. This is the code I have for...
How would I push a buffered string of 5 char's into an array that would break them into individual pieces? What I am trying to do is open a file, access the first of 5000 records which are each 5 bytes long and separated by a linefeed. Check to ensure values 2 and 4 are equal and 1 and 3 are...
How can I write a script to add a single character to a flat file that has 900,000 records. The character has to be inserted every so many particular bytes. Ex: 2000 bytes. The file then is output to another name so it now has this character at the end of each record.
TIA,
Geek8
Dear Experts,
I am totally perplexed by a issue that came up at work today. We have a ASCII file sitting on a Linux box. There are over 900,000 records in that file and each record is 2732 bytes long. I need to add a line feed to each record to show the end. The record then would become 2733...
How do I write a script that does a "diff" on a 2.5 gig file and then process the record if there are no changes? I am kinda jumping into scripting and can't seem to get this to work since everytime it goes into the "diff" command, it says "memory exhausted". Is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.