Search Results

Search: Posts Made By: yale_work
13,782
Posted By yale_work
Thanks.
Thanks.
13,782
Posted By yale_work
Grep on a value in a specific column
I need to grep all records from a file that has 1072 in 3rd column. 1072 can be prefixed by "SBC.", "CLS." or "DPT.". My search is just based on string 1072 in 3rd column. Delimiter in the file is...
2,445
Posted By yale_work
Thanks.
Thanks.
2,445
Posted By yale_work
Remove duplicate based on Group
Hi,

How can I remove duplicates from a file based on group on other column? for example:

Test1|Test2|Test3|Test4|Test5
Test1|Test6|Test7|Test8|Test5
Test1|Test9|Test10|Test11|Test12...
3,246
Posted By yale_work
Recursive Grep with replace
I have seen some useful infomation about recursive grep in one of the thread. Can it is possible to combine resursive grep and replace togather? Means I need to replace old server names in all the...
4,046
Posted By yale_work
Filling the empty columns in a fixed column file
Hi,

I have a file with fixed number of columns (total 58 columns) delimeted by pipe (|). Due to a bug in the application the export file does not come with fixed number of columns. The missing...
46,198
Posted By yale_work
Multiply whole column with a value
Hi,
I need to multiply 3rd column (comma seperated) of entire file by a value say 2.2.

Suppose the file is:
C,Gas $ YTD(TRI),15512.36,01/01/2010

New file should be (3rd column value...
3,734
Posted By yale_work
Thanks durden_tyler and rdcwayx.
Thanks durden_tyler and rdcwayx.
3,734
Posted By yale_work
Data
Even the files are same but code shows that there is a difference (it is tab delimited):

filea

Mechanical.Markdown.Directed.POS.$ WK17 10.5

fileb

Mechanical.Markdown.Directed.POS.$ WK17...
3,734
Posted By yale_work
PM
I tried this one and it returns
I have tried this but it does not work on actual code. I have sent you one line of real data in your private message and this code fails even if you make both the...
3,734
Posted By yale_work
.............. ---------- Post updated at...
..............

---------- Post updated at 01:25 PM ---------- Previous update was at 01:24 PM ----------

Following suggested command is getting integer part based on the decimal(.):
awk -F \....
3,734
Posted By yale_work
Sorry
Sorry. Yes you are right. Please consider the layout of files as follows:
File A (three columns):
X1,Y1,1.01
X2,Y2,2.02
X3,Y3,4.03


File B (three columns):
X1,Y1,1
X2,Y2,2
X3,Y3,5.0005
3,734
Posted By yale_work
Compare two files based on integer part only
Please see how can I do this:

File A (three columns):
X1,Y1,1.01
X2,Y2,2.02
X3,Y3,4.03


File B (three columns):
X1,Y1,1
X2,Y2,2
X3,Y3,4.0005

Now I have to compare file A and B based...
1,797
Posted By yale_work
Thanks Devaraj and Franklin, I will use the...
Thanks Devaraj and Franklin,

I will use the following:

awk 'BEGIN{FS=OFS=","}{print $1,$3,$10,$5,"FILE1"}' Input.txt >> output.txt
1,797
Posted By yale_work
I have tried cut, paste options but that is not...
I have tried cut, paste options but that is not what I want to use....If I use the following command
awk '{print $1,$3,$6,$4,$5,"FILE1" > "output1.file"}' inputfile I don't get the desired...
1,797
Posted By yale_work
Thanks for your reply but it gives syntax...
Thanks for your reply but it gives syntax error....also if I run only for one file I get problems if some column has % symbol (column 10 has it).....example:

Input file:...
1,797
Posted By yale_work
Portion of a file in a new files
Hi,

I need to devide one file into 3 files based on column numbers and put a string (FILE1, FILE2, FILE3) in the last.....

Input file:...
4,652
Posted By yale_work
THANKS MUCH for your kind help.
THANKS MUCH for your kind help.
4,652
Posted By yale_work
Thanks vgersh99....I will start next thread as...
Thanks vgersh99....I will start next thread as you suggested but one more help as it is related to this one only......if it had been a column 4 (instead of column 1)of file 1 and column 5 (instead of...
4,652
Posted By yale_work
Please help me in fixing the following command: ...
Please help me in fixing the following command:

awk -F "|" 'FNR==NR {a[$1]++; next} {print $0,a[$1]}' file1 file2 >>file3

File1
3308100100|C|20.83|21.87|22.91|04/APR/2009|2009|02|MAR...
2,836
Posted By yale_work
Please help me in fixing the following command: ...
Please help me in fixing the following command:

awk -F "|" 'FNR==NR {a[$1]++; next} {print $0,a[$1]}' file1 file2 >>file3

File1
3308100100|C|20.83|21.87|22.91|04/APR/2009|2009|02|MAR...
2,836
Posted By yale_work
Thanks... I am using the following...you...
Thanks...

I am using the following...you have to guide me a bit on this....

awk -F "|" '{print $1}' file1|xargs -i grep {} file2|awk '{print$1}' file2

say file1 is:
12345,X,Y
file2 is:...
2,836
Posted By yale_work
Hi Devaraj, It did not work...there is some...
Hi Devaraj,

It did not work...there is some syntax error.....I copied it from console so full error message is not appearing here but I tried many time and tried to modify as well but no clue...
2,836
Posted By yale_work
Thanks for your suggestion. I get the following...
Thanks for your suggestion. I get the following error......Please suggest...

syntax error The source line is 1.
The error context is
NR==FNR{a[$1]=$2;next}{if ($1 in a) print...
2,836
Posted By yale_work
Is it possible? I am trying to explain more: ...
Is it possible? I am trying to explain more:

File1:
51999900,34.55,2/1/2009,"XYZ"
File2:
51999900,EUROPE AREA 1
now compare on column1 of file1 with column1 of file2...if matches then put the...
Showing results 1 to 25 of 41

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