Search Results

Search: Posts Made By: kam786sim
1,572
Posted By methyl
This looks like a syntax error. Please re-post...
This looks like a syntax error.
Please re-post the line.


If it is just that the $ sign is a typo, this should lose all output to stdout and stderr from the child script....
1,320
Posted By methyl
1) Is testing whether there is at least on file...
1) Is testing whether there is at least on file (-f) in the root directory "/" which matches the pattern "ITF_*.dat". The asterisk is a wild card and the underscore and full stop characters are part...
1,320
Posted By Scott
1. if any files exist that match ITF_*.dat in...
1. if any files exist that match ITF_*.dat in the root (/) directory.
2. For an absolute path (one beginning with /), will remove the path, leaving just the filename. i.e. removes everything (*)...
3,455
Posted By aigles
Why don't you try the code of my last post ? ...
Why don't you try the code of my last post ?

Jean-Pierre.
3,455
Posted By aigles
Sorry, I forgot a modification (Assume that WOR...
Sorry, I forgot a modification (Assume that WOR is'nt a shell variable):awk '{
if ( substr($0, 392, 1)=="C" )
DOC = substr($0, 28, 15) substr($0, 386, 3);
else
DOC =...
3,455
Posted By aigles
There was type errors in the code of my previous...
There was type errors in the code of my previous post, they have been edited.

An example with your last sample datas (kam.txt):1 12367 A 1100
2 12367 ...
3,455
Posted By aigles
Try awk '{ if ( substr($0, 392, 1)=="C"...
Try
awk '{
if ( substr($0, 392, 1)=="C" )
DOC = substr($0, 28, 15) substr($0, 386, 3);
else
DOC = substr($0, 28, 18);
print $0 > "WOR/WORK_" DOC ".txt"
}'...
3,455
Posted By aigles
The syntax ${DOC}is valid for shell variables. ...
The syntax ${DOC}is valid for shell variables.
Here you are inside an awk program that does'nt accept this syntax.

Modify your script:awk '{
if ( substr($0, 392, 1)=="C" )
DOC =...
3,455
Posted By rdcwayx
awk '{if ($1~/C/) {print > "DOCKEY_" t;next}}...
awk '{if ($1~/C/) {print > "DOCKEY_" t;next}} {t=$2;print > "DOCKEY_" $2}' urfile
3,455
Posted By aigles
A solution is to do all the work in one awk...
A solution is to do all the work in one awk program (not tested):
awk '
{
if ( substr($0, 392, 1)=="C" )
DOC = substr($0, 28, 15) substr($0, 386, 3)
else
DOC = substr($0, 28,...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 03:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy