Search Results

Search: Posts Made By: ppat7046
1,586
Posted By ppat7046
Pipe delimitated line with 148 columns
I have a pipe delimitated line with 148 columns.

123|ABC|XYZ|999|8|N|PRA/PA|Search|2|E|WW|KHG|| T |Y|U|KA|9W|K45|

If I need to change a value in different column as below, how do I do that...
1,281
Posted By ppat7046
Thank you so much.
Thank you so much.
1,281
Posted By ppat7046
remove and replace
Hi Friends,

I have following string.
1:Y 2:Y 3:Y 4:Y 5:Y 6:N 7:N 8:Y 9:N 10:N 11:N 12:N 13:Y 14:Y 15:411

I need to have follwoing string....
41,930
Posted By ppat7046
Print entire line based on value in a column
Friends,

File1.txt
abc|0|xyz
123|129|opq
def|0|678
890|pqw|sdf

How do I print the entire line where second column has value is 0?

Expected Result:
abc|0|xyz
def|0|678

Thanks,...
3,884
Posted By ppat7046
Got it. Thank you very much, Prashant
Got it.

Thank you very much,

Prashant
3,884
Posted By ppat7046
Rounding issue with awk
Hi Friends,

I am trying to round following number.

0.07435000


echo "0.07435000"|awk '{printf "%s\n",$1*100}'|awk '{printf "%.2f\n",$1}'


It returns: 7.435
It should return: 7.44
...
2,136
Posted By ppat7046
I am sorry. Let me be more specific. I have...
I am sorry. Let me be more specific.

I have two files. When I do diff I get some difference. Like below.
Up to .003 difference is ok but diff fails the comparision.


File1:...
2,136
Posted By ppat7046
Threshold is less than 0.003 or equal then print the line
Friends,

I have very large data files (File1 and File2).
Search field1 of File1 into Field1 of File2.
If found then do Field1 of File1 MINUS Field1 of File2
if the answer is <= 0.003...
3,492
Posted By ppat7046
Thank you for your help and quick reply. For...
Thank you for your help and quick reply.

For multiple field is this the right syntax?

awk -F'|' '$2=="P", $4=="XYZ4"' infile > outfile

Thanks,
Prashant
3,492
Posted By ppat7046
Print the entire line if second field has value P
Friends,

I have .txt file with 3 millions of rows.

File1.txt
ABC1|A|ABCD1|XYZ1
ABC2|P|ABCD2|XYZ2
ABC3|A|ABCD3|XYZ3
ABC4|P|ABCD4|XYZ4

If second field has value P then print the entire...
3,705
Posted By ppat7046
Friends, If I have file1 with ONE column and...
Friends,

If I have file1 with ONE column and file2 has TWO columns.
I need to print the entire line from file2 where file1 column matches.

File1
ABC
123
678

File2
QWE,ABC
DFR,123...
3,705
Posted By ppat7046
Search data from one file to another
Hello Friends,

I have
File1.txt has 300,000 records
File2.txt has 90,000 records

I need to verify that all 90,000 records are exist in File1.txt.

I have following query but it takes for...
4,670
Posted By ppat7046
remove blank spaces from fields
Hi Friends,

I have large volume of data file as shown below.
Beganing or end of each filed, there are some blank spaces.
How do I remove those spaces?

AAA AAA1 | BBB BB1 BB2 ...
4,958
Posted By ppat7046
I got it. I should have tried different option. ...
I got it. I should have tried different option.

awk -F"|" '{printf "%s|%s|%.3f|%.3f|%.3f\n",$1,$2,$3,$4,$5}' filename

Thanks,
Prashant
4,958
Posted By ppat7046
Thank you very much for your reply. It works...
Thank you very much for your reply.
It works but it prints everyting in one line.

Thanks,
Prashant
4,958
Posted By ppat7046
Rounding scientific notation
Hi Friends,

I have following 50,000 records in .txt file.
I need to round field 3, 4, & 5 to 3 decimal places.

11|A123|-2.64216408856E01|3.64216408856E01|4.64216408856E-01...
11,441
Posted By ppat7046
shell script: Bind variable not declared
Hi Friends,

I am trying to run a sql query from shell script as below but I get "Bind variable "1" not declared" error.

1.sh shell script has following:
sDb="abc/xyz@aaa"
a="1.sql"
sqlplus...
9,772
Posted By ppat7046
I am geeting syntax error when I run awk...
I am geeting syntax error when I run
awk 'NR==FNR{a[$1]++;next} !(FNR in a)}' deletelistfile largetextfile > resultfile

Thanks,
Prashant
9,772
Posted By ppat7046
How to delete rows by RowNumber from a Large text file
Friends,

I have text file with 700,000 rows.
Once I load this file to our database via our cutom process, it logs the row number for rejected rows.

How do I delete rows from a Large text file...
2,371
Posted By ppat7046
Thank you all for your reply. I used...
Thank you all for your reply.

I used suggestion provided by cfajohnson and now it takes only 20 secconds to parse the 800,000 records.

Thank you very much,
Prashant
2,371
Posted By ppat7046
Parsing 286 length Character string
Hi Friends,

I have .txt file which has 13000 records.
Each record is 278 character long.

I am using below code to extract the string and it takes almost 10 minutes.
Any suggestion please.
...
3,439
Posted By ppat7046
Thank you all for your reply. nawk -F'|'...
Thank you all for your reply.


nawk -F'|' 'NF==3 && !a[$2,$3]++ {print $2,$3}' patel


I had made small change in print statment because it was not printing | symbol.

nawk -F'|' 'NF==3 &&...
3,439
Posted By ppat7046
delete two patterns and remove one pattern
Friends,

I have .txt file with following format.
START
ABC|Prashant1|Patel1
ABC|Prashant2|Patel2
ABC|Prashant1|Patel1
ABC|Prashant2|Patel2
END

I would like to do:
1) Delete line with...
4,282
Posted By ppat7046
Compare 200,000 of rows in two text files
Friends,

I have two very large plain text files with pipe delimited as below.
Both files are not sorted.
Both files have 200,000 of rows.

FName|LName|Address|HPhNumber

Is perl or shell...
Showing results 1 to 24 of 24

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