Search Results

Search: Posts Made By: rrb2009
2,648
Posted By hanson44
It would help to post meaningful test input case,...
It would help to post meaningful test input case, and the expected output. And of course use those code tags.
2,648
Posted By Scrutinizer
What did not work? What is your OS and version?...
What did not work? What is your OS and version? :)


Also, what field separator do your CSV's use?
2,648
Posted By Scrutinizer
Try: awk 'NR==FNR{A[$1]=$2} $3 in A{print $0,...
Try:
awk 'NR==FNR{A[$1]=$2} $3 in A{print $0, A[$3]}' FS='\t' OFS='\t' file2 file1
2,648
Posted By anurupa777
This is the code used for the above mentioned...
This is the code used for the above mentioned purposeawk 'FNR==NR{a[$1]=$0 FS $0;next}{ print $0, a[$1]}' file1 file2 I worked it with text files not sure about csv files
8,064
Posted By ahamed101
Can you try modifying ORS="\r\n" to ORS="\n" in...
Can you try modifying ORS="\r\n" to ORS="\n" in the totalcap.awk script?

--ahamed

---------- Post updated at 09:09 PM ---------- Previous update was at 08:55 PM ----------

Make the following...
8,064
Posted By ahamed101
Works for me though [root@Imperfecto_1 ~]#...
Works for me though

[root@Imperfecto_1 ~]# cat input_file
server name,total capacity,server utilization,used capacity
server1, 5 TB, 20%,1 TB

[root@Imperfecto_1 ~]# awk 'NR==1{$0= $0 OFS...
8,064
Posted By pamu
Try paste -sd, temp_1 temp_2
Try

paste -sd, temp_1 temp_2
8,064
Posted By ahamed101
Please use code tags. Useless use of cat...
Please use code tags. Useless use of cat (http://partmaps.org/era/unix/award.html)

I suppose totalcap.awk is giving you all the output to which you want to add the License data. If you can modify...
1,603
Posted By Corona688
The output you want, by the way, can't be used...
The output you want, by the way, can't be used for import into excel... how would it tell the difference between cell-separating spaces and word-separating spaces? So I've given you what you...
1,603
Posted By Corona688
You know, I could tell the input you posted was...
You know, I could tell the input you posted was edited and reduced, so I was very very careful to make sure my code could include things you didn't ask for :D

I guess I guessed in the wrong...
1,603
Posted By Corona688
$ cat totalcap.awk # Field separator is two...
$ cat totalcap.awk

# Field separator is two or more spaces
# ORS="\r\n" makes the text Windows-readable,
# omit it to make an ordinary flatfile.
BEGIN { FS=" *"; ORS="\r\n" }
# Ignore...
10,842
Posted By Bernard
A little complement... If the variable you use...
A little complement...
If the variable you use in awk contains blanks (" ") you will need to add quotes like following:

for i in ` hostname ` ; do
df -k | awk -v i="$i" '{print $1, $2, i}' ...
10,842
Posted By jim mcnamara
Re-read my post above. the red part - that is...
Re-read my post above. the red part - that is your help.
1,274
Posted By rdcwayx
grep -f <(grep -f file1 file2 ) file3
grep -f <(grep -f file1 file2 ) file3
1,274
Posted By anurag.singh
There is a EXAMPLES section in man page of comm. ...
There is a EXAMPLES section in man page of comm.
That has exactly what you want. Get common data for 3 files.
Idea is, pipe the output of 2 files to the 3rd file.
Pls try. If you get further...
1,274
Posted By anurag.singh
Look at man comm comm...
Look at man comm
comm (https://www.unix.com/man-page/POSIX/1/comm/)
2,154
Posted By Chubler_XL
I suppose the thing is rsync manages all this for...
I suppose the thing is rsync manages all this for you, it examines all the files in the source directory and any that have changed, are missing (or optionally have been removed) are synced up with...
2,154
Posted By Chubler_XL
I agree rsync is the tool of choice, if you don't...
I agree rsync is the tool of choice, if you don't have it the following should do what you want:

SRC=/path/to/source/files
DEST=/path/to/dest/files
cd $SRC
find . -type f -mtime -2 | while...
2,154
Posted By migurus
if you have rsync available this is ideal tool -...
if you have rsync available this is ideal tool - it will not re-copy the files that have been copied already
man rsync
7,910
Posted By
try exit 0
try

exit 0
7,910
Posted By methyl
I don't think that this can be done from a unix...
I don't think that this can be done from a unix script. The "script" command intercepts commands typed from the keyboard and exits when it sees "exit" or ctrl/d. Even writing to the terminal device...
7,910
Posted By drl
Hi. Suppose your script is "s1". I would...
Hi.

Suppose your script is "s1". I would remove the command script from file "s1", then run as:
script -c ./s1
It looks like you may be running on SCO. I don't have access to that, however, my...
Showing results 1 to 22 of 22

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