Hi all, I am new to these forum and to scripting in general for that matter. i have been looking through the forums for something that could explain my problem. I have be come pretty familiar with sed and awk but I can not seem to figure this out... I am trying to match data from 3 files but every thing I have tried doesn't seem to do what i need it to. And maybe this is something better suited for perl or python ( which i have no experience with ).. ok here goes...
Problem:
1. Want to match $1b to $2a, if match copy $2b to $4a
2. Want to match $1c to $2a, if match copy $2c to $4a (and overwrite the data in $4a)
file_a is comma seperated and has 4 fields
$1a,$2a,$3a,$4a
file_b is comma seperated and has 2 fields
$1b,$2b
file_c is comma seperated and has 2 field
$1c,$2c
Here is example of the data in the files:
So far I have figured out how to extract all this information and organize it in these files using AWK and SED, but I am not sure that I can get it to do this type of problem... Any help on this problem that i have been beating on my keyboard for would be greatly appreciated. Thank you
Last edited by Yogesh Sawant; 04-04-2008 at 09:39 AM..
Reason: added code tags
Hi,
Within a shell script I'm trying to copy all the files in a directory structure to another folder but only the files of type "pdf"
I have made a start but I can't work out how to finish it.
find $ATEBUILD/doc/user -name "*.pdf" | xargs cp THEN WHAT?
I hope this makes sense!
Rob (6 Replies)
Dear All,
I am trying to write an script to calculate geometric centre of selected residues of a protein structure. Say I have a PDB file (a text containing the x, y, and z coordinates of atoms of a protein). I want to extract the X coordinates of the atoms belonging to the interested residues... (2 Replies)
hey,
I use cygwin to connect to AIX 5.2 but when I open vi I get an error saying:
ex: 0602-108 cygwin is not a recognized terminal type
how can I fix that? I thought cygwin was tty vt100? (1 Reply)
I have requirement of one directory in /tmp area on Sun server. The area contains following files :
brdcems# /tmp/.tivoli >>ls -lt
total 0
srwxrwxrwx 1 root other 0 Nov 16 13:41 a9c30c14-80bf256e-94
srwxrwxrwx 1 root other 0 Nov 12 12:28 a9c30cc8-80bf256e-94
I... (4 Replies)
We are using GTAR for daily copies of our database using Travan cartridges (Tapestor drive)and are having intermittent problems. Some days it does not copy and we can't figure out why. Sometimes it seems to be hanging and a tape status command doesn't return anything. Other times it doesn't copy... (0 Replies)
Hi,
Need some simple find help.
I need to search for all .so files within sol directory.
My directory tree has mix of directories and i want to search only inside sol directory.
I could get this done combining find with for, any option to do this with find alone.
for a in `find .... (13 Replies)
Hi All,
#!/bin/ksh
find /home/other -ls -type f -xdev | sort -nrk7 | head -2 >bigfile.txt
The above is my script, which writes the large file into a file called bigfile.txt. My script contains only the above two lines.
after execution i am getting the output like
find: cannot chdir to... (1 Reply)
Hi I'm trying to write a script which takes an integer as input and checks for files with size > input and displays it on screen.
The code I've tried :
echo 'Enter the min file size expected'
read filesize
du -ah <folder name> | awk -F: '$1>int(filesize) {print $1,$2)' is always... (28 Replies)
Using the KSH, write a shell script called display_by_length, which takes an absolute pathname to a directory and displays all ordinary files in the directory ordered by their length; for each file listed, display the name of the file and its length - nothing else. Extend this script to take an... (1 Reply)
hi guys,
i m new to shell script..
i dont know how to type cast string into integers and i mention my problem below..
date="21091988"
month=$((${date:2:2})) # extract the month from previous date variable
temp=$(($month*23))
when i am trying to calculate the temp value i got the... (5 Replies)