Search Results

Search: Posts Made By: msalam65
6,205
Posted By msalam65
Thanks Tyler. This worked but I need to take out...
Thanks Tyler. This worked but I need to take out the entire word that is -Z<number>. In the above case it is leaving the words after cleaning up -Z<number>. For example.

Input :
IBM -Z12X...
6,205
Posted By msalam65
It will always be -Z<number>. The word can be in...
It will always be -Z<number>. The word can be in beginning or end or in middle and needs to be taken out. Just looking for -Z<numbers> .
Please advise.
6,205
Posted By msalam65
Hi, I need one more help in this regard. I...
Hi,

I need one more help in this regard. I now have a rule which indicates removing anything that starts with a -Z followed by number, or -Z by itself (word). Do not remove -Z followed by alphas...
2,203
Posted By msalam65
Thanks thegeek. It worked great.....
Thanks thegeek. It worked great.....
2,801
Posted By msalam65
Thanks thegeek. It worked great.....
Thanks thegeek. It worked great.....
2,801
Posted By msalam65
Pull Data After Comma if 2 word before comma
Hi,

I am trying to truncate word after comma in a file ONLY if there are already 2 words BEFORE comma. If there is one word or 3 or more words BEFORE comma, then I have to leave the data AS IS....
2,203
Posted By msalam65
Cleanup between parenthesis
Hi,

I am trying to clean up data between parenthesis () in a file.

See example below....



Input File :

(New York) Chicago (London)
New York (Chicago) London
New...
4,886
Posted By msalam65
I already tried sed earlier but the character is...
I already tried sed earlier but the character is not a M- . It is some special character that is not getting cleaned up.

See below.


grep "PRISCILLA" test.dat | sed 's/M- //g' | cat -v

...
4,886
Posted By msalam65
Cleanup Weird character in Unix
Hi,

I have a pipe delimited file and I am running into an issue where a field is having some weird character and I am not able to clean it up. It is 2nd field and the weird character is M- . See...
3,757
Posted By msalam65
Thanks durden_tyler. The perl command worked....
Thanks durden_tyler. The perl command worked. Thanks again.
3,757
Posted By msalam65
Any help on this will be greatly appreciated as...
Any help on this will be greatly appreciated as the code is working fine but cleaning out all numbers that are more than 1. I need it to be more than 7. Please advise.
3,757
Posted By msalam65
The issue with this solution is it is also...
The issue with this solution is it is also removing 2 or more numbers which I not want it. I only want to remove numbers if it 7 or mor bytes.



sed 's/\([0-9]\{2,\}\)/ /g;s/ / /g'...
3,757
Posted By msalam65
Remove Multiple numbers from file.
Hi,

I am trying to cleanup 7 or 10 digits numeric from the file. So for example :


Input :

3M Corporation
3M Inc. 888-356-8765
3M Inc. 356-8765
3M Inc. 3568765
3M Inc. 356-8765 ...
8,362
Posted By msalam65
If field9 already have data populated then we...
If field9 already have data populated then we need to leave the data "As Is". Else we take 2nd part of data from field2, if field2 have ATTN, C/O or %, and move it to field9 on output.
...
8,362
Posted By msalam65
Cut 2 fields and write to a output file
Hi,

I am writing a code where the file is a pipe delimited and I would need to extract the 2nd part of field2 if it is "ATTN", "C/O" or "%" and check to see if field9 is populated or not. If...
6,205
Posted By msalam65
This worked. Thanks.....
This worked. Thanks.....
6,205
Posted By msalam65
The below code is changing all alphabets that...
The below code is changing all alphabets that begin with 2 or more letters in begiining to clear out.


tr -d \\015 < zzz_test.dat | sed "s/^\(.\)\1\{1,\}//;s/\(.\)\1\{1,\} *$//"

Before :...
3,469
Posted By msalam65
Thanks...Eagle solution work for me but it still...
Thanks...Eagle solution work for me but it still had 1 space after the '|'. Still I can live with it but would be nice to also take one spae after |.

Thanks...
3,469
Posted By msalam65
I need the "|" in the file but take out the...
I need the "|" in the file but take out the spaces after the "|".

Input File :

3| JJJJ| 123 MAIN AVE| || ATLANTA|GA|30317||0

So the output should look as follow :

...
3,469
Posted By msalam65
Remove '| ' from file
Hi,

I am using paste command to concat different fields from different files to create a new file. The new file is creating fine and is creating as a pipe delimited. The issue I am getting into...
6,205
Posted By msalam65
Yeap this worked. Thanks a lot anbu23 and all...
Yeap this worked. Thanks a lot anbu23 and all others for your help.
6,205
Posted By msalam65
Ah...It is having ^M at end of record. cat...
Ah...It is having ^M at end of record.

cat -ver zzz_test.dat
ZZZZIBM Corporation ^M$
ZZZZIBM Corporation ZZZZZ^M$
IBM ZZZZ Corporation ^M$

I will replace ^M and try the sed...
6,205
Posted By msalam65
It is end of line character at end. No Space....
It is end of line character at end. No Space. Everything else is working fine except the last ZZZ.

$ sed "s/^\(.\)\1\{1,\}//;s/\(.\)\1\{1,\} *$//" zzz_test.dat
IBM Corporation
IBM Corporation...
6,205
Posted By msalam65
Maybe it is Linux that is causing issue. $...
Maybe it is Linux that is causing issue.

$ awk '{sub(/^Z+/,"");sub(/ Z+$/,"")}1' zzz_test.dat
IBM Corporation
IBM Corporation ZZZZZ
IBM ZZZZ Corporation

Please advise.

Thanks....
6,205
Posted By msalam65
$ cat zzz_test.dat ZZZIBM Corporation ZZZIBM...
$ cat zzz_test.dat
ZZZIBM Corporation
ZZZIBM Corporation ZZZZZ
IBM ZZZ Corporation
$ sed "s/^\(.\)\1\{1,\}//;s/\(.\)\1\{1,\}$//" zzz_test.dat
IBM Corporation
IBM Corporation ZZZZZ
IBM ZZZ...
Showing results 1 to 25 of 28

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