Search Results

Search: Posts Made By: charandevu
743
Posted By charandevu
How to read muliple lines in a file?
for file in *.txt
do
echo "file names" $file
while read x
do
list[$k]=`echo $x |cut -d"=" -f2`
echo "${list[$k]}"
k=`expr $k + 1`
done <$file

echo...
1,522
Posted By charandevu
Kindly help : sort
Iam new to Unix ....analyzing the code
Can any one pls explain what does it mean by below code
sort +0 -1 +1 -2 +2 -3n +3 -4n +4 -5n file.txt -o





awaiting for reply .....
5,505
Posted By charandevu
very urgent
hi friend,
file1.
12345|DZ012|20071220|FG456|234567|IND
| |20080101|DE345|456789|USA
|DZ012| | |500001|AUS
45678|ED456|20011203|ED345|456789|CAN
...
5,248
Posted By charandevu
awk script for date conversion
hi
awk script for dd/mm/yyyy to yyyymmdd
awk script for dd-mon-yyyy to yyyymmdd
awk script for dd-mm-yyyy to yyyymmdd formate
..............urgent.............

Thanks in advanced
5,505
Posted By charandevu
hi
awk '{gsub(/^\|| +\|/,"") if(NF!=10){for(i=1;i<=(10-NF);i++)printf("%s|",k[i]);print;next} {for(i=1;i<=3;i++)k[i]=$i}print}' FS='|' key.txt


when i am using this entire comand in a single line...
2,728
Posted By charandevu
hi
i am getting the date in the excel sheet.

If i have a file like
E001|0|23/01/2007|CHARAN,DEVUPALLI|4000|INDIA| !INPUT

E001,0,23/01/2007,CHARAN,DEVUPALLI,4000,INDIA| !OUTPUT

I CAN CONVERT...
1
1,752
Posted By charandevu
date
Input file:
E102,0,21/22/1995,0,2/2/1996,E003,A,125400,10450,60.2884620
E102,0,11-23-1994,0,2/25/1994,E003,A,125400,10450,60.2884620
E103,0,1/23/1994,0,12-27-1995,E003,A,125400,10450,60.288462...
4,543
Posted By charandevu
color,bold
hi friend ,

I am generating a csv file i,e output file

E104|0|06/04/1994|The values E005 and E001 are not equal.
E106|0|01/09/1993|The values E001 and E002 are not equal....
2,728
Posted By charandevu
hi
$ cat > in6
E102|0|1-23-1994|0|12-5-1994|E003|A|charan,devupalli|2000
$ sed 's/|/,/g' in6 > out6.csv
$ cat out6.csv
E102,0,1-23-1994,0,12-5-1994,E003,A,charan,devupalli,2000
in the excel


in...
2,728
Posted By charandevu
replace
hi
i have input file in this format
E102|0|1-23-1994|0|12-5-1994|E003|A|10450|charan,devupalli|5000

how to convert this into outfile...
3,576
Posted By charandevu
Date Function
Hi,

My file format is:

E102,0,21-04-2007,0,2/25/1994,E003,A,125400,10450,60.2884620
E103,0,21/04/2007,0,2/2/1996,E003,A,125400,10450,60.2884620...
3,793
Posted By charandevu
Date Function
Hi,

My file format is:

E102,0,21-04-2007,0,2/25/1994,E003,A,125400,10450,60.2884620
E103,0,21/04/2007,0,2/2/1996,E003,A,125400,10450,60.2884620...
10
4,440
Posted By charandevu
hi
file
E102,0,1/23/1994,0,1/9/1993,1/9/1993,A,6/4/1994,10450,60.288462
E104,0,6/4/1994,0,E001,E003,A,6/4/1994,7916.667,45.673077
1/23/1994,0,7/30/1993,0,6/4/1994,E003,A,87000,7250,41.826923...
10
4,440
Posted By charandevu
hi,problem with nawk
$ awk -f char.awk myfile > out7
$ cat out7
E108,0,2/3/1995,0,E001,E003,A,15000,1250,7.211538,20081214
$ gawk -f char.awk myfile > out7
$ cat out7...
10
4,440
Posted By charandevu
hi
it is not working


$ cat > char.awk
BEGIN {
FS=OFS=","
}
{
split($2, a, "/")
$2=a[3] a[1] a[2]

split($NF, a, "/")
$NF=a[3] a[1] a[2]
print
}
^D$
$ sh char.awk...
10
4,440
Posted By charandevu
date
file1
E108,0,2/3/1995,0,E001,E003,A,15000,1250,7.211538,12/14/2008
E109,0,2/15/1995,0,E001,E001,A,78000,6500,37.5,2/3/1995



resultant date should be in this formate...
32,691
Posted By charandevu
replacing multiple columns ???
If iam having multiple columns to be replaced ....does the above code works ... please provide the code for the below.....
Below i have to replace 3 rd and 5 th column to 'CC' & 'XXX' ...
32,691
Posted By charandevu
Thanks ...
Hi ....
It is working fine ....thanks .....
I will get back if any required in the above .......:)
7,863
Posted By charandevu
hi
it is not working.......
file1
E108,0,2/3/1995,0,E001,E003,A,15000,1250,7.211538
E109,0,2/15/1995,0,E001,E001,A,78000,6500,37.5
E110,0,10/12/1995,0,E001,E001,A,56000,4666.667,26.923077

I wann...
32,691
Posted By charandevu
replace the column values.
I have the below file ...where some of the column values should replaced with desired values ....below file u can find that 3 column where ever 'AAA' comes should replaced with ' CC '

NOTE...
5,505
Posted By charandevu
hi era
I am new to this awk command ...........can you give a sample code on this requirment....that would be a helpful.....

Thanks your response
charan
7,863
Posted By charandevu
hi
Hi i am getting this error

file7: line 4: printf: `(': invalid format character

Please let me know on this asap........

Thanks for your response
charan
7,863
Posted By charandevu
hi
I getting this error


$ sed -e 's/([0-9][0-9])-([[:alpha:]]+)-([0-9]{4})/\3\2\1/' file6
sed: -e expression #1, char 48: invalid reference \3 on `s' command's RHS

$ sed -e...
7,863
Posted By charandevu
hi
I checked the code but it is not working
cat > file6
E106,0,1/9/1993,0,E001,E003,A,45200,3766.667,21.730769
$ cat file6 | sed -e 's/([0-9][0-9])-([[:alpha:]]+)-([0-9]{4})/$3$2$1/'...
5,505
Posted By charandevu
Fill the Key fields : Please help us
Hi ....

we are having the below file .Column 1, Column 2 ,column 3 are key fields...
In the below ...for 2 nd , 3 rd row the repeated key column is missing ....

i want the new file to be...
Showing results 1 to 25 of 30

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