Just one more .........what if i need to to move a file which does not have ID .....to afolder ? for the below code, what changes do i need to make:
while read filename
do
line=$(head -1 $filename)
if [[ $line = *ID* ]] ; then
echo "Found ID in $filename"
else
echo "No ID in $filename"
fi;
done < list_of_filenames.txt
do we
Thanks again for ur help
Code:
while read filename
do
line=$(head -1 $filename)
if [[ $line = *ID* ]] ; then
echo "Found ID in $filename"
else
# move the file to some folder
mv $filename /some/folder
fi;
done < list_of_filenames.txt
Hi Experts,
I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line.
File is comma (,) seperated.
Eg:
ID,Client ,SNo,Rank
37,Airtel \n... (8 Replies)
Good Morning/Afternoon All,
I am using the nawk utility in korn shell to find the longest field and display that result.
My Data is as follows:
The cat ran
The elephant ran
Milly ran too
We all ran
I have tried nawk '{ if (length($1) > len) len=length($1); print $1}' filename
The... (5 Replies)
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
2eleven
2twelve
1thirteen
2fourteen
The output should be: (5 Replies)
Hi ,
I have a scenario where i have to find the incorrect records in the file.
In our comma delimited file , we have the following to be taken care :
1) if there is new line character then we have to capture the current line and the next line as error record
Ex : In a comma... (8 Replies)
I have a file, in which a single record spans across multiple lines,
File 1
====
14|\n
leave request \n
accepted|Yes|
15|\n
leave request not \n
acccepted|No|
I wanted to remove the '\n charecters. I used the below code (foudn somewhere in this forum)
perl -e 'while (<>) { if... (1 Reply)
Need to add end of line character to last record in a fixed width file.
When i take the record length of each line, for all the records it gives example like 200 except the last line as 199.
Due to this my other script fails.
Please help me on this. (4 Replies)
Hello,
I do have folders containing having funny strings in their names and one space.
First, I do remove the funny strings and replace the space by an underscore.
find . -name '* *' | while read file;
do
target=`echo "$file" | sed 's/... (2 Replies)
Dear All,
I have getting data as follows, the second field signifies table name and last one is time stamp. I have return always latest record based on time stamp. Could you please help me ?
I/P
====
... (1 Reply)
Discussion started by: srikanth38
1 Replies
LEARN ABOUT CENTOS
hwloc_get_next_obj_covering_cpuset_by_type
Finding a set of similar Objects covering at least a CPU set(Hardware Locality (hwlFinding a set of similar Objects covering at least a CPU set(3)NAME
Finding a set of similar Objects covering at least a CPU set -
Functions
static inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth,
hwloc_obj_t prev)
static inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t
type, hwloc_obj_t prev)
Detailed DescriptionFunction Documentation
static inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_ttopology, hwloc_const_cpuset_tset, unsigneddepth,
hwloc_obj_tprev) [static]
Iterate through same-depth objects covering at least CPU set set. If object prev is NULL, return the first object at depth depth covering
at least part of CPU set set. The next invokation should pass the previous return value in prev so as to obtain the next object covering at
least another part of set.
Note:
This function cannot work if objects at the given depth do not have CPU sets or if the topology is made of different machines.
static inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type (hwloc_topology_ttopology, hwloc_const_cpuset_tset, hwloc_obj_type_ttype,
hwloc_obj_tprev) [static]
Iterate through same-type objects covering at least CPU set set. If object prev is NULL, return the first object of type type covering at
least part of CPU set set. The next invokation should pass the previous return value in prev so as to obtain the next object of type type
covering at least another part of set.
If there are no or multiple depths for type type, NULL is returned. The caller may fallback to
hwloc_get_next_obj_covering_cpuset_by_depth() for each depth.
Note:
This function cannot work if objects of the given type do not have CPU sets or if the topology is made of different machines.
Author
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
Version 1.7 Sun Apr 7 2013 Finding a set of similar Objects covering at least a CPU set(3)