Show us clearly (with CODE tags) what is actually in your input file.
Show us exactly (with CODE tags) what you are trying to extract from that input file.
How would using cut to extract the first and 4th (or first and eighth) tab delimited fields from lines that contain only one field (and no tabs) help you extract every fourth line from a file.
If you don't understand the concept of an array in shell scripting, why do you want an array in your shell script? What are you going to do with that array?
I repeat 3, 5, and 7 do not appear in any row in your file. Your file contains 03, 05, and 07, respectively. What transformation are you trying to perform? Are you trying to convert octal input to decimal values? Are you trying to strip leading zeros from leading zero-filled decimal values?
I repeat: IS THIS A HOMEWORK ASSIGNMENT?
No this is not home work assignment. I had some requirement to restart some of the killed process. my program generate some files(like /tmp/grepd.0003.00049:12:server_read_cb:xxld died) when some process died. So based on the input from the file i have to extract these numbers and manipulate to restart those processes. out File contains following after executing above code
=======
======
so from above out file, i want to extract 03,05,04,07 which is on every fourth row and convert to decimal value, store it in an array.
Moderator's Comments:
Please use CODE tags for sample input, sample output, and code as directed in private mail you received shortly after you posted the 1st message in this thread.
Last edited by Don Cragun; 07-16-2014 at 04:25 PM..
Reason: Change Bold tags to ICODE tags, add missing CODE tags.
I have the following output. I want to write a script to check for
1. waits > 0 on all rowsand Ratio > .0. if true then send email.
=========================
ROLLBACK SEGMENT CONTENTION
=========================
If any ratio is > .01 then more rollback segments are needed
NAME ... (1 Reply)
Hello ALL,
I am fresher in Unix . i need help to write small shell script . Please help me unix guru.
I am developing the internal site in my office . the data files are generated in one directory everyday .
I have to write shell script to sort those files and put it is internal site .
... (3 Replies)
Hi,
I am a new for shell script. i need to write script using the following commands
cd /usres/test
# create directory
mkdir temp+DATE( i need to append date )
#moving files from one directory to this directory(we need to check total files in source and taget)
cd /users/sample
... (2 Replies)
can anybody help me out in writing the any script (awk,shell or perl script) for incrementing the specific field highlighted below
/{/data/{/assetMetricsList//{1]/dailyCount,........./{/data/{/assetMetricsList//{100]/dailyCount
It should be in below format in oneline seperated by commas
... (1 Reply)
Can anyone please help me in writing a shell script that would check if a particular user(xyz) has logged in, and if yes, the audit daemon needs to be started. When the user logs off the dameon needs to shutdown , and the report needs to be e-mailed to a set of users. (12 Replies)
I am attempting to write a housecleaning script that does the following:
1) goes to a specific directory
2) deletes all contents of that directory but a specific directory within it.
So my users all keep and use the Shared directory in OSX. Within /Users/Shared there are also standard named... (1 Reply)
Hi,
I have two text files. Need to create a third text file extracting specific data from first two existing files..
Text File 1: Format contains:
SQL*Loader: Release 10.2.0.1.0 - Production on Wed Aug 4 21:06:34 2010
some text ............so on...and somwhere text like:
Record 1:... (1 Reply)
Hi, I'm very new to this, so bear with me please.
I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (2 Replies)
Hi, I'm very new to this, so bear with me please.
I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (4 Replies)