Search Results

Search: Posts Made By: Aditya_001
2,387
Posted By Aditya_001
File size check
I am trying to check whether two files are empty or not using below if condition but its checking for only one file


if [[ -s file1.csv && -s file2.csv ]]



Again I tried

if [[ -s...
852
Posted By Aditya_001
Ok Champs thanks very much for your help!! its...
Ok Champs thanks very much for your help!! its really much appreciated
852
Posted By Aditya_001
Shell script issue on date and day
Hi friends,

I wanna check if any given date is Friday, as an example I have written a simple script as shown below



#!/bin/ksh
v_date=20140325
if [ $($v_date +%a) == "Fri" ] ; then...
1,078
Posted By Aditya_001
Date format issues
I would like to get the below in YYYY MMDD format,

Last date of the week
Last date of the month
Last date of the year

And then compare d_date with the above if it matches it has to send...
913
Posted By Aditya_001
Reading contents of files from a directory
I have a directory with the files,

1st: I want to Diplay each filename, underline it
2nd: Display the contents under the filename and
3rd: Redirect the above content to other file
4th:...
2,907
Posted By Aditya_001
Autosys job scheduling issue,
Hi Friends,

There is an Autosys scheduled job that runs on the second day of the month, and it is using the Business day calendar.

So when the month starts on a weekend or there is a holiday...
1,310
Posted By Aditya_001
Yep Unix.com is much appreciated and I too like...
Yep Unix.com is much appreciated and I too like this forum and it scores way beyond others!!
1,595
Posted By Aditya_001
Try rediecting all those emails to trash /dev/null
Try rediecting all those emails to trash /dev/null
5,888
Posted By Aditya_001
Why don't you try using sort -u...
Why don't you try using


sort -u temp6.csv > $5$DATE.csv



Cheers,
Adi
7,292
Posted By Aditya_001
Try the below code, #!/bin/sh echo...
Try the below code,



#!/bin/sh
echo "Please provide the file name Corresponding to DC..."
cd $HOME
read file
ls $HOME/*.txt | grep $file
mv $file Article_01082014.log
echo "The file...
1,057
Posted By Aditya_001
Yes you can try this grep -A (num of lines...
Yes you can try this

grep -A (num of lines after) -B (num of lines before) Jak file



Cheers,
Adi
3,014
Posted By Aditya_001
Let me tell you When you just type 1....
Let me tell you

When you just type

1. ls -d it just shows the present directory which is denoted by ' . '
2. If you try using
ls -d * it just lists all the files inside the current...
1,176
Posted By Aditya_001
Merging data horizontally with newlines in files
Hi Everyone,

I have two files file1 and file2 with these contents



cat file1
AAAAA 01/03/2014 04:01:23
BBBB 01/03/2014 03:03:34

CCCcc ...
897
Posted By Aditya_001
Thanks very much its much appreciated
Thanks very much its much appreciated
897
Posted By Aditya_001
Grep issue in for loop
Hi friends,

I am trying to use a grep command in for loop but i keep getting an error message on the grep,

here is the code



grep -i "Target connection group" $LogName | awk...
1,173
Posted By Aditya_001
awk to place value at 24 field in a flat file issue
I am trying to add 0393 value at 24th feild using the below command, but its adding at all the lines including header and trailer






Input file:...
1,304
Posted By Aditya_001
Thanks very much Akshay, I tried the above...
Thanks very much Akshay,

I tried the above one Akshay, but if we have more than one line then its appending the pipe to all the lines rather than appending a pipe if feilds are more than 15,

...
2,078
Posted By Aditya_001
I tried the above command but its not working,...
I tried the above command but its not working, request you to have a look at the below example,



$ (panp@cortina:PANTAT0) [XXXX] $ awk 'NF>17{for (i=17; i<=30; i++) $i=$(i+1); NF=31;...
1,304
Posted By Aditya_001
Cut command issue
Need help to append a pipe at end of the line immediately after the cut command,

I have an Input flat file with 16 feilds and I am removing the 16th feild by using the cut command as shown,

...
2,047
Posted By Aditya_001
Thanks very much for your help Akshay, I really...
Thanks very much for your help Akshay, I really appreciate your clear cut explanation,

A quick doubt, When I am trying to divert the output of the below command to temp file its actually adding...
2,078
Posted By Aditya_001
Yes Akshay I tried the ones you posted on post...
Yes Akshay I tried the ones you posted on post #5, but they didn't work as expected



test.txt
754|47406|
492|3076394|SP40|1030028694570|20120125|20120207|13530392|||31||CHAPMAN...
2,047
Posted By Aditya_001
Hi Franklin, the above command is not removing...
Hi Franklin, the above command is not removing the 16th feild which starts with 354 line in a file.

I have executed the above command on my unix box and this is how it shows,


...
2,078
Posted By Aditya_001
Thanks very much Akshay, unfortunately after...
Thanks very much Akshay, unfortunately after trying all those they don't work as expected,
Lets say input file test.txt contains as shown below



test.txt
754|47406|...
2,047
Posted By Aditya_001
I tried both the commands provided above on a...
I tried both the commands provided above on a sample file as shown below,



Input file:

ZHV|3011|D0171001|L|LPN|Z|PAN|20131104000148||||OPER|
748|49790|...
2,078
Posted By Aditya_001
Hi Ravinder, Thanks very much for your...
Hi Ravinder,

Thanks very much for your response, but we just can't hard code any characters in the below command



sed 's/.EMEB|N|.*//g' check_fil1 | awk -vs1="|EMEB|N" '{print...
Showing results 1 to 25 of 33

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