I have a main.ksh that executes a perl script and which in turn spawns child ksh processes and awk scripts. I have main.ksh in crontab to run every 10 mins.
Is there a way to make sure that neither an earlier version of main.ksh or ANY OF ITS CHILD PROCESSES are running when crontab starts...
I have a new requirment now. I want to be able to strip multiple columns from the flat file using awk. So it could be column 3 and 5 in the above example.
If i pass the variable fld2delete with the value "3,5" would I be able to strip it within the awk program.
The other...
Ygor,
Sorry about that. It works fine for files with small number of columns. I had a file with 49 columns in it and I was trying to delete the 49th column and was unable to do it. I read in the sed man pages that sed cannot edit very long lines. Is sed reliable for long lines and how long...
Ygor,
I used your solution in my application for stripping a column and it worked fine. However if you have a blank column in between it does not strip successfully. For example in the below data :
10/17/2003^F^444444^F^11^F^^F^1333^F^09-15-2003^R^
If I want to strip column 1 it gets...
PHV,
I tried your solution and ran into a few problems ...
* the uniq file has only the last row in the input file and * the dups has all the rows including duplicates.
Can you please explain your script??
Thanks for your help.
I have a text file with contents as follows that will be loaded into a database table:
600193439^_600076830^_600193439^_2^^
600193430^_600076827^_600193430^_6^^
600192222^_600076830^_600191112^_2^^
600333333^_600076830^_600193111^_2^^
...
...
The table has columns 2 and 4 as the primary keys...
Simple question...
* I have a a.tar.Z compressed file in directory A.
* I want to uncompress and untar the files in a.tar.Z and put them in directory B.
Is there a more efficient way than doing it in 3 steps...
- cp A/a.tar.Z B/.
- uncompress B/a.tar.Z
- tar -xvf B/a.tar
Thanks for your help.
vgersh99,
Thanks for your quick response.
I changed the FS to be "\\^F\\^" and OFS to be "^F^" in your script and tried it. It worked very well, except for the last column. For example when I specified the fld2delete=5 it did not delete the 5th field from the sample...
Hi everybody,
I have a file (a.dat) with the following data in it :
10/17/2003^F^555555^F^333^F^HELLO^F^04-15-2003^R^
10/17/2003^F^444444^F^11^F^^F^09-15-2003^R^
10/17/2003^F^555555^F^333^F^WATER^F^04-15-2003^R^
10/17/2003^F^^F^333^F^FIRE^F^04-15-2003^R^...
Hi everybody,
I have a file (a.dat) with the following data in it :
10/17/2003^F^555555^F^333^F^HELLO^F^04-15-2003^R^
10/17/2003^F^444444^F^11^F^^F^09-15-2003^R^
10/17/2003^F^555555^F^333^F^WATER^F^04-15-2003^R^
10/17/2003^F^^F^333^F^FIRE^F^04-15-2003^R^...
thanks for both your help guys. I used adam's solution since I had a for loop and had to pass the value of the variable for that iteration on click of the edit button.
I have a button and everytime the button is clicked I need to pass a string variable to the next jsp page. Can you please help me with a script for this :
<INPUT type="button" value="Edit" onClick="????">
Thanks for you help in advance.
CaKiwi thanks for your response. The script worked perfectly. An additional question. Instead of printing the 46th line before the pattern, can I search for the word "Case:" before the pattern 124304 and print that line.
So if the file is as below
========
06/18/2003 12:00:00:008...
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.