Search Results

Search: Posts Made By: whatisthis
3,971
Posted By whatisthis
nawk if within if condition
Hi,
I tried to use two if statement within one if statement in nawk and it keeps giving me the error message:
What did I go wrong here?

Thanks a lot!


#input file: qa2g:qa2_3:qa2,00380,1,Cat...
10,340
Posted By whatisthis
awk
Thank you for your reply.
The things is everytime the file that passed to awk is different.
So I don't know the exact number of columns.
But I only modify $1,$2. There might be over 10 fields...
10,340
Posted By whatisthis
AwK printf question
Hi,
Does anyone know a easy way to printf $3,$4, ... all the way to the last field in the file? I will need to modify $1 and $2 and then printf modified $1 and $2 and the rest of the fields(which...
Forum: Programming 06-26-2006
26,965
Posted By whatisthis
Can we send email with C program on Unix?
Hi,
I just wanted to know if there is any way to send email using C program on Unix.

Thanks for your help!

Julie
Forum: Programming 05-01-2006
9,823
Posted By whatisthis
sprintf function
Hi,
Can someone help me to figure out whether this code is to write file to /tmp/TIMECLOCK directory or just to asign a variable with "/tmp/TIMECLOCK/name.log_copy.pid" as the string?

I am...
Forum: Programming 05-01-2006
1
3,584
Posted By whatisthis
iret
Hi,
I am new to C in UNIX.
I am trying to understanding the C code someone wrote 10 years ago and hoping to get it work again.
While reading his code, I found 'iret ' variable, what does this...
10,844
Posted By whatisthis
send mail in sh program
Hi,
I have a bsh program that needs to send out mail everytime someone runs.
How do I send out mail without attach any file?

I only need to write one line of message.

Thanks for your help!
8,999
Posted By whatisthis
OFS change in awk
Thank you so much for your help!

I don't know what to do without this website!
8,999
Posted By whatisthis
awk OFS
Oh, my god, I think I am too bad at communication.
Maybe that's why I am still just a poor programmer...

OK.
This is the file I originally had:
1089, KEVIN_RIDDLE
1137, STEPHEN_SMITH
1214,...
8,999
Posted By whatisthis
Sorry. OK. first one is what I got by running...
Sorry.
OK. first one is what I got by running the code you provided:
1089, KEVIN_RIDDLE 0000 00

The one below is the one that I desired:

1089 KEVIN_RIDDLE ...
8,999
Posted By whatisthis
OFS in awk
I am still getting "," as OFS.
So I changed OFS=', ' to OFS=' ' ,
But the same thing happend again.

1089, KEVIN_RIDDLE 0000 00
1137, STEPHEN_SMITH ...
8,999
Posted By whatisthis
change FS from "," to blank
Hi,
I forgot to mention: I need to change FS from "," to balnk space before I do add strings.
1089, KEVIN_RIDDLE
1137, STEPHEN_SMITH
1214, MELISA_someone
1267, SANDY_name

I am trying to...
8,999
Posted By whatisthis
insert string in awk
sorry,
Here is the sample:
1089 KEVIN_RIDDLE
1137 STEPHEN_SMITH
1214 MELISA_someone
1267 SANDY_name

Here is the file I am looking for:

1089 KEVIN_RIDDLE 0000 00...
8,999
Posted By whatisthis
Is there anyway that I can do it within awk?
Hi,
I am trying to utilize length function to calculate the postion to insert the string.


BEGIN { FS = "," }
i=length($2)
{printf "%s %s %s\n", $1,$2,substr("0",28-i}


It's just idea now....
8,999
Posted By whatisthis
How to insert strings at certain position
Hi,
I need to insert strings "0000 00" at the each line within the file.
The postion is 37 to 42.

ex.
name1 name2 0000 00
nam name 0000 00

The "0000 00" in two...
10,904
Posted By whatisthis
ftp from windows to Unix
Hi,
I am still doing something wrong here.
All I wanted to ftp some files.
I found one ftp.exe on the windows shared drive.
I put the file I need to transfer in the same directory(called...
10,904
Posted By whatisthis
pass the argument.
OK. Thanks for the tip.
I tried to set up the task.
The only problem is my ftp.exe needs to have arguement to run.
How do I set up argument while set up the task?
10,904
Posted By whatisthis
ftp file from Windows to Unix automatically
Hi,
Is there a way to ftp file from windows to Unix directory by using crontab to set up a job ?


Thanks!
4,744
Posted By whatisthis
extra line in the file
Hi,
Thanks for the help.
I used it and also got an extra line at the end of the file:


[+pos1 [-pos2]] [-k field_start[type][,field_end[type]] [file...]


????
4,744
Posted By whatisthis
delete multiple empty lines
Hi,
I need to delete the lines with empty name.

What is the best way to do it?

Thanks a lot for your help!


EMID MMDDYY HOURS JOB EMNAME
0241 051605 11.40 52062 someone
0520...
2,470
Posted By whatisthis
What is the command to add heading to a file?
Hi,
I'd like to add one line to the top of my file.
I know there is a command to be able to do it.
But I forgot ......



Please help if you can ....
1,766
Posted By whatisthis
How to concatnate two file ?
Hi,
How to cancatnate two one column file into one two column file?

Ex: file1 :
aaaa
bbbb

file2:
cccc
dddd

final file:
aaaa cccc
bbbb dddd


Thanks for your help!
5,898
Posted By whatisthis
AWk convertion
Thank you soooo much for your quick reply!!!!
:D :D :D
5,898
Posted By whatisthis
It's DD0300312310250588 CA8440300444 220 ...
It's
DD0300312310250588 CA8440300444 220



:confused:
5,898
Posted By whatisthis
How to calculate with awk
Hi,
I have below awk statement and I need to convert the second field ( substr($0,8,6))from minutes to hours with 2 decimail place. How can I achieve this?


/usr/bin/awk '{print...
Showing results 1 to 25 of 173

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