04-12-2011
thanks hergp.. command is working file but i want to create two seprate file
1. one condition is true.
2. second condition is not true.
---------- Post updated at 02:43 PM ---------- Previous update was at 01:35 PM ----------
i solved my problem.
awk -F- '$3 == 1393awk -F- '$3 == 139302 || $3 == 994' inputfile > conditiontrue
comm -23 inputfile conditiontrue > conditionfalse
Last edited by humaemo; 04-12-2011 at 05:40 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all
That's another problem from me, i wanna do a lot of if statement checking for correct input by user, will be prompt input again if the input not meet the requirement defined by If or while statement...
like this one ....
while
I know it's less effiency write the program... (14 Replies)
Discussion started by: trynew
14 Replies
2. Shell Programming and Scripting
Hi all ,
Recently i came across this in FAQ's.
I have a file
cat rem.txt
sreedhar 20
sreedhar 10
sreedhar 15
sreedhar 18
sreedhar 16
sreedhar 30
I have to replace sreedhar with "Sridhar" if the second parameter is > 18.
I need to do it in "sed" only. I am wondering how this... (4 Replies)
Discussion started by: panyam
4 Replies
3. Shell Programming and Scripting
Hi.. Gurus
I Have a list of .zip files in a directory. I want to check whether each .zip file having some particular file or not (say .jsp) if it's having .Jsp file then create a directory as per the .zip file and extract the content to that directory except the .jsp file, If .zip not having... (3 Replies)
Discussion started by: posix
3 Replies
4. Shell Programming and Scripting
testfile.csv
0","1125209",,"689202CBx18888",,"49",,,"NONMC",,,,,"01112010",,,,,,,"MTM-
"1","",,"689202ABx19005",,"49",,,"NONMC",,,,,"01072010",,,,,,,"MTM-
testfile.csv looks like above format
if the second column is null then get 23rd column and store in a different varible .. add all the... (1 Reply)
Discussion started by: mgant
1 Replies
5. Shell Programming and Scripting
SHELL SCRIPT
Hi,
I have 3 separate files within a folder. Every File contains data in a single column like
File1 contains data
mayank
sushant
dheeraj
File2 contains
DSA_AT
MG_AT
FLAT_09
File3 contains data
123123
232323 (2 Replies)
Discussion started by: mayanksargoch
2 Replies
6. Shell Programming and Scripting
Hi am trying to write a script which find the existence of a file from a find command output and perform a task if the file exists. Help me out with the correct syntax . Am trying with the following one but unable to get the output.
if
then <some tasks>
else
echo "file not exists"
fi (5 Replies)
Discussion started by: rogerben
5 Replies
7. Shell Programming and Scripting
Hi,
I have one requirement, create separate files (".csv") from one excel file(xlsx) with multiple sheets. These ".csv" files are my source files. So anybody please suggest me the process.
Thanks in Advance.
Regards,
Harris (3 Replies)
Discussion started by: harris
3 Replies
8. Shell Programming and Scripting
i have a script where i have to find the age of a file,
if
then
echo "dnb file is present for the monthly load" >> $RUNLOG
dnb="1"
else
echo "dnb file has not arrived yet" > $ERRLOG
dnb="0"
fi
i know the file is available so... (3 Replies)
Discussion started by: lovelysethii
3 Replies
9. Shell Programming and Scripting
hi,
i am using a simple condition
end_ct=`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID << EOF
select description from bravo_statistics
where trunc(time_stamp)=trunc(sysdate)-1
and description='END CAT';
EOF`
echo $end_ct;
echo... (30 Replies)
Discussion started by: lovelysethii
30 Replies
10. UNIX for Dummies Questions & Answers
I need to write the list of files to a new file in one column , the second column would contain the first line of that file (header record extracted through head -1 ) and the third column would contain the last record of that file (trailer record tail -1 ) .
Example :- folder where the files... (8 Replies)
Discussion started by: IshuGupta
8 Replies
LEARN ABOUT SUSE
truncate
TRUNCATE(1) User Commands TRUNCATE(1)
NAME
truncate - shrink or extend the size of a file to the specifed size
SYNOPSIS
truncate OPTION... FILE...
DESCRIPTION
Shrink or extend the size of each FILE to the specified size
A FILE argument that does not exist is created.
If a FILE is larger than the specified size, the extra data is lost. If a FILE is shorter, it is extended and the extended part (hole)
reads as zero bytes.
Mandatory arguments to long options are mandatory for short options too.
-c, --no-create
do not create any files
-o, --io-blocks
Treat SIZE as number of IO blocks instead of bytes
-r, --reference=FILE
use this FILE's size
-s, --size=SIZE
use this SIZE
--help display this help and exit
--version
output version information and exit
SIZE is a number which may be followed by one of the following suffixes: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P,
E, Z, Y.
SIZE may also be prefixed by one of the following modifying characters: `+' extend by, `-' reduce by, `<' at most, `>' at least, `/' round
down to multiple of, `%' round up to multiple of.
Note that the -r and -s options are mutually exclusive.
AUTHOR
Written by Padraig Brady.
REPORTING BUGS
Report truncate bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
COPYRIGHT
Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
dd(1), truncate(2), ftruncate(2)
The full documentation for truncate is maintained as a Texinfo manual. If the info and truncate programs are properly installed at your
site, the command
info coreutils 'truncate invocation'
should give you access to the complete manual.
GNU coreutils 7.1 July 2010 TRUNCATE(1)