The input lines contain 12 fields instead of 11 . awk will read any space(s) as a delimiter between fields. The fact that we humans interpret a space differently because we know how to interpret the lines is not relevant to awk.
hey, somebody can help me on this broken script?
for i in `find . -name index.html`;do
echo "$i"
awk '{print $0}' $i
done
the path to index.html has space in it. For example,
./10 October/index.html
then echo "$i" will gives two lines instead of one:
./10
October/index.html
how do... (3 Replies)
Wants to print line when there exist leading or trailing space or tab in fields 2,3 and 5
The below code prints all lines in file even if they dont have leading and trailing space or tab.
nawk -F"|" '{for(i=1;i<=NF;i++) {if ($i ~ "^*" || $i ~ "*$")}}1' file
file
Ouput required:
... (5 Replies)
A solaris server with SAMBA share folder. The PC users created many folders with space on it, I want to find them out, but not list its subfolders.
For example, I have below folders
Copy of ABC/efg/xy
sa/Test again/xyt
If I use command: find . -type d |grep " " I will list 6 folders, but... (2 Replies)
find . -type f | xargs cksum
this command is failing for the files which has a space in between them
any quick solution ? preferably one liner (2 Replies)
I need to find available disk space for /home.
$ df /home
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mahhh/VolGroup11-LogVol00
32281452 45028 26034172 15% /
$df /home |tail -1| awk '{print $4}'
15%
The above result shows the... (5 Replies)
Hi,
I'm trying to find out how to see used space on RAW device.
I tried with prtvtoc -f RAWdevice but for 3 different device I'm getting the same FREE_SIZE which look a bit impossible.
root@zg8cscfb1> prtvtoc -f /dev/md/redodg/rdsk/d300
FREE_START=0 FREE_SIZE=20352 FREE_COUNT=1 FREE_PART=... (2 Replies)
Hello Awk'inas/Sed'ers;
This is keep ringing on my mind for a while, onto play in calender with awk or sed :cool:. Given a date, month and Year would like to find out the day corresponding to it. Am still a noob on awk and sed, hence would like to learn it from your responses.
Here it is;... (11 Replies)
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Hello All,
I have path
/allcode/mainld/process/recenttmp
where I get many type of file from other platforms. so in UNIX I need to process all file present in this location. but I don't want to process files with the space and delete them.
Please provide your suggestion. (7 Replies)
Discussion started by: kumar30213
7 Replies
LEARN ABOUT V7
join
JOIN(1) General Commands Manual JOIN(1)NAME
join - relational database operator
SYNOPSIS
join [ options ] file1 file2
DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard
input is used.
File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in
each line.
There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con-
sists of the common field, then the rest of the line from file1, then the rest of the line from file2.
Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis-
carded.
These options are recognized:
-an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2.
-e s Replace empty output fields by string s.
-jn m Join on the mth field of file n. If n is missing, use the mth field in each file.
-o list
Each output line comprises the fields specifed in list, each element of which has the form n.m, where n is a file number and m is a
field number.
-tc Use character c as a separator (tab character). Every appearance of c in a line is significant.
SEE ALSO sort(1), comm(1), awk(1)BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort.
The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous.
JOIN(1)