Sponsored Content
Top Forums Shell Programming and Scripting print remaining file after a condition is satisfied Post 302116638 by aigles on Monday 7th of May 2007 10:01:40 AM
Old 05-07-2007
Quote:
Thanks, It is working fine from command line, but when i put it in a script it gives me this error and also, could you please let me know the last "enable" why have you used it????
Quote:
awk: Cannot find or open file 3284
3284 is the value of the variable $xxxx
The awk command is valid.
Show us your script.


Another way to do the work with awk :
Code:
awk -v xxxx=$xxxx ' ($1 ~ "^[0-9][0-9]*$" && $1 > xxxx),0 ' file


Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to create folder wen the condition satisfied

hi i hav files ha1j ha2m ha3n ha4q ha5s ...like tat im having some 20 files ..and i want to create a folder as the same amount of files which im having wen the condition if loop is satisfied .. thank you (5 Replies)
Discussion started by: maximas
5 Replies

2. UNIX for Dummies Questions & Answers

Changing old file name to new one if the old file name satisfied certain condition

Hi guys, I desperately need your help on my problem:- I got a folder in my directory that has many files in it. Most of the file's name is starting with certain prefix. Eg: ABC, CDE, EFG, etc. I only want to change file name that is starting from certain prefix and the rest I want them to... (1 Reply)
Discussion started by: balzzz
1 Replies

3. Shell Programming and Scripting

Insert first line of a file to first column of remaining files

I want to extraxt data from a html table the html file is downloaded from UG / PG Univ - Exam.Results April/May 2008 After processing the html file using sed i got the output like this 11305106082,RANJANI R, CS1251,20,69,P CS1302,20,45,P EC1006,20,52,P EC1351,20,53,P... (5 Replies)
Discussion started by: a_artha
5 Replies

4. UNIX for Dummies Questions & Answers

until loop : running even if condition is satisfied

I am checking one until loop with the following logic until || |||| do sleep 30 done before running this i am exporting above variables to SUCCESS.But the loop is running in infinite loop.My requirement is to make the loop run until all the 3 variables are SUCCESS or any of the 3... (2 Replies)
Discussion started by: dr46014
2 Replies

5. UNIX for Dummies Questions & Answers

print remaining part from the first-match within a file

Hi, i was looking for unix command(s) for : find the first occurrence of a given pattern with in a file and print the remaining part. below is an example of what i am looking for: lets say, a file named myfile.txt now, the command i am looking for will do the following (4 Replies)
Discussion started by: nurulamin862
4 Replies

6. Shell Programming and Scripting

Awk to print on condition in input file

I need only those records which has $2 equal to "DEF" independent of case (i.e upper or lower) nawk -F"," '$2 ~ //{print $0}' file This returns 3rd record also which i dont want I tried this but this doesnt work as expected. nawk -F"," '$2 == ""{print $0}' file i dont... (3 Replies)
Discussion started by: pinnacle
3 Replies

7. Shell Programming and Scripting

remove values of a file one by one from 2nd file and then print the remaining values of 2nd file

Hi all, I have 2 files. One contains only 1 column and other one contains 2 columns, let say 1_col.txt and 2_col.txt respectively. Here, I will try to explain with an example. Input files : 1_col.txt 2_col.txt a a b x a c p ... (5 Replies)
Discussion started by: AshwaniSharma09
5 Replies

8. Shell Programming and Scripting

If both condition satisfied

pattern tin loop 3 tin xarg 1 tin jim 5 tin icon 2 tin tour 4 patn.out tin loop 3 tin jim 5 tin icon 1 tin tour 2 while read one two three do awk '$2 ~ /'"$two"'/' patn.out || while read four five six do awk -v n1=$three -v n2=$six '{BEGIN (n2<n1)?1:0}' done<patn.out... (3 Replies)
Discussion started by: Roozo
3 Replies

9. Shell Programming and Scripting

Print remaining lines using grep

Hi All, I am having a text file like below ERROR - Not a valid ID : 123 ERROR - Not a valid hello ID : 124 SUCCESS - Valid ID : 12 I need to display like below after reading the file if it finds the error keyword along with displaying this first line when error pattern... (10 Replies)
Discussion started by: rohit_shinez
10 Replies

10. Shell Programming and Scripting

Awk: duplicate column and print remaining as is

Hello there I'd like to make a copy of 2nd column and have it printed in place of column 1. Remaining columns are needed as it. test data: ProbeSet GeneSymbol X22565285 X22566285 ILMN_1050008 MYOCD 6.577 7.395 ILMN_1050014 GPRC6A 6.595 6.668 ILMN_1050017 ... (2 Replies)
Discussion started by: genome
2 Replies
__gnu_pbds::trie< Key, Mapped, E_Access_Traits, Tag, Node_Updat__gnu_pbds::trie<xKey, Mapped, E_Access_Traits, Tag, Node_Update, Allocator >(3cxx)

NAME
__gnu_pbds::trie< Key, Mapped, E_Access_Traits, Tag, Node_Update, Allocator > - SYNOPSIS
Inherits __gnu_pbds::basic_tree< Key, Mapped, Tag, detail::trie_traits< Key, Mapped, E_Access_Traits, Node_Update, Tag, Allocator >::node_update, __gnu_cxx::typelist::create2< E_Access_Traits, detail::trie_traits< Key, Mapped, E_Access_Traits, Node_Update, Tag, Allocator > >::type, Allocator >. Public Types typedef Allocator allocator_type typedef base_type::const_iterator const_iterator typedef key_rebind::const_pointer const_key_pointer typedef key_rebind::const_reference const_key_reference typedef mapped_rebind::const_pointer const_mapped_pointer" typedef mapped_rebind::const_reference const_mapped_reference" typedef base_type::const_point_iterator const_point_iterator" typedef value_rebind::const_pointer const_pointer typedef value_rebind::const_reference const_reference" typedef Tag container_category typedef allocator_type::difference_type difference_type" typedef E_Access_Traits e_access_traits typedef base_type::iterator iterator typedef key_rebind::pointer key_pointer typedef allocator_type::template rebind< key_type >::other key_rebind" typedef key_rebind::reference key_reference typedef allocator_type::template rebind< Key > ::other::value_type key_type" typedef mapped_rebind::pointer mapped_pointer typedef allocator_type::template rebind< mapped_type >::other mapped_rebind" typedef mapped_rebind::reference mapped_reference typedef Mapped mapped_type typedef detail::trie_traits < Key, Mapped, E_Access_Traits, Node_Update, Tag, Allocator > ::node_update node_update" typedef base_type::point_iterator point_iterator typedef value_rebind::pointer pointer typedef value_rebind::reference reference typedef allocator_type::size_type size_type typedef allocator_type::template rebind< value_type >::other value_rebind" typedef base_type::value_type value_type Public Member Functions trie (const e_access_traits &t) template<typename It > trie (It first, It last) template<typename It > trie (It first, It last, const e_access_traits &t) trie (const trie &other) trie & operator= (const trie &other) void swap (trie &other) Detailed Description template<typename Key, typename Mapped, typename E_Access_Traits = typename detail::default_trie_e_access_traits<Key>::type, typename Tag = pat_trie_tag, template< typename Const_Node_Iterator, typename Node_Iterator, typename E_Access_Traits_, typename Allocator_ > class Node_Update = null_trie_node_update, typename Allocator = std::allocator<char>>class __gnu_pbds::trie< Key, Mapped, E_Access_Traits, Tag, Node_Update, Allocator > A concrete basic trie-based associative container. Definition at line 586 of file assoc_container.hpp. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ __gnu_pbds::trie<2Key, Mapped, E_Access_Traits, Tag, Node_Update, Allocator >(3cxx)
All times are GMT -4. The time now is 11:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy