Search Results

Search: Posts Made By: goddevil
2,420
Posted By goddevil
Cheers.. It worked a charm
Cheers.. It worked a charm
2,420
Posted By goddevil
awk - writing matching pattern to a new file and deleting it from the current file
Hello ,

I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a...
3,887
Posted By goddevil
No joy there. When i insert the if...
No joy there.


When i insert the if condition there, the code doesnt work. Nothing is replaced meaning nothing is matched. C[$2] will have a different meaning since NR is now 2 right?
3,887
Posted By goddevil
The code is working now. Thanks a mil for the...
The code is working now. Thanks a mil for the explanation. It makes a lot of sense now

---------- Post updated at 05:12 AM ---------- Previous update was at 01:52 AM ----------

I am trying to...
3,887
Posted By goddevil
Yep. Solaris bash I used nawk and am not...
Yep. Solaris bash

I used nawk and am not getting any errors now but the string is not being replaced.

Please see my updated mainfile.csv.

The field 26 has blankspaces and thus will not...
3,887
Posted By goddevil
I am getting the following error when i execute...
I am getting the following error when i execute the command


awk: syntax error near line 1
awk: bailing out near line 1
3,006
Posted By goddevil
Of course Corona. I am afraid that i didnt have...
Of course Corona. I am afraid that i didnt have the liberty to post the actual data. That said, i shouldve taken the time to post a better example in order not to waste your time. I will make sure to...
3,887
Posted By goddevil
Cheers bipi. I am looking for a way to map...
Cheers bipi.

I am looking for a way to map the code to the specific column as there may be other columns with the same characters and i would not like them touched.

For eg:
...
3,006
Posted By goddevil
Hi Corona, No worries. Its great that you...
Hi Corona,

No worries. Its great that you are helping us out here.

The issue was that i was using the wrong awk. when i used the /usr/xpg4/bin/awk i got the below error

/usr/xpg4/bin/awk:...
3,887
Posted By goddevil
Mapping two files
I have a large comma delimited file from which i have to extract a specific column, compare it against a static file and replace the column value with the matching column from the static file.
...
3,006
Posted By goddevil
Hi Corona, I decided to give this a try as...
Hi Corona,

I decided to give this a try as it is much more elagant than what i am doing.

On executing the script, i am getting the below error:

bash-3.00$ awk -f vtest.awk datafile > 1234...
3,006
Posted By goddevil
It was more of a general question and not...
It was more of a general question and not specific to my example. I was playing around with the script to make the output better and it occurred me to replace the blanks with ~ and then use it as an...
3,006
Posted By goddevil
Windows can read the file but the formatting is...
Windows can read the file but the formatting is uaually lost.

Is there a command like tput that can be used for the printing as opposed to the terminal?

---------- Post updated at 09:22 PM...
3,006
Posted By goddevil
Parsing a mixed format (flatfile+xml) logfile
I am trying to parse a file that looks like the below:


There are thousands of lines like the above and the file is expected to run into hundreds of thousands.

The issue i have is the mixed...
45,501
Posted By goddevil
You dont need to export the variables $User and...
You dont need to export the variables $User and $Pwd. Just executing the parm script will export the variables.

Consider that there are two files:
Parm.sh
User="abc"
Pwd="password"
...
9,558
Posted By goddevil
Thanks Alister. I did not know that you could do...
Thanks Alister. I did not know that you could do away with the [] braces. So in effect what i've been doing is tantamount to using a double negative speech.

if echo "$VAR1" | grep 63u >/dev/null ...
9,558
Posted By goddevil
Thanks a mil for the replies everyone. I modified...
Thanks a mil for the replies everyone. I modified my code and the below code works as expected


VAR1="hostname63uf.group"
if [[ `echo "$VAR1" |grep 63u` ]]
then
SUB1="yes"
...
9,558
Posted By goddevil
I have changed my shebang to #!/usr/bin/bash and...
I have changed my shebang to #!/usr/bin/bash and this only increases the errors that i get. I still get the output that i require though



I am trying to see if VAR1 consists of the string 63u...
9,558
Posted By goddevil
My shebang is but i still get the same message.
My shebang is but i still get the same message.
9,558
Posted By goddevil
not found message
I am trying to execute a script called tfile.sh in a bash shell in solaris and it throws up the following message



I am getting the required output after this message. How do i get the...
1,146
Posted By goddevil
not found message
I am executing the following script in a bash shell in solaris and it throws up the following message :



But i get the output that i require nevertheless. Can anyone please spot what is...
17,545
Posted By goddevil
The menus are efficient and the code is...
The menus are efficient and the code is brilliant.. It eliminates 100's of lines..
As for line 58, its the following line
Do maintenance) set -- submenu1 "$*" ;;
17,545
Posted By goddevil
I tried the exact code that you posted and it...
I tried the exact code that you posted and it works a charm. But if i modify it as highlighted above, then i am getting the following error.


In addition, if i define the menus your way, they...
17,545
Posted By goddevil
Thanks a mil...That looks very interesting.. I...
Thanks a mil...That looks very interesting.. I will try it as soon as i have access to a terminal.

The only thing is, the number is options in my menus are usually 10 or more and the option is...
17,545
Posted By goddevil
Sorry.. I should have been more specific... My OS...
Sorry.. I should have been more specific... My OS is solaris.. Shell is bash... Everything in my script is a function.. The script itself is over 2000 lines with every "do something" in the code a...
Showing results 1 to 25 of 51

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