removing semicolon using sed in aix--urgent


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers removing semicolon using sed in aix--urgent
# 8  
Old 06-16-2008
just another possibility

Code:
echo "aaabbb; xxx xxix" | awk -F";" '{print $2}'

# 9  
Old 06-16-2008
or, use perl - if file1 contains "aaabbb; xxx xxix":

[mhuwiler@72 ~]$ perl -pe 's/.*;//g' < file1 > file2
[mhuwiler@72 ~]$ cat file2
xxx xxix

Matt
# 10  
Old 06-16-2008
Oh... are there multiple semicolons in the lines? If you want just the first to be removed, you'll need to tell your regex to not be "greedy" and to match the first occurance on each line. For example if file1 contains

aaabbb; xxx xxix; blah

Code:
[mhuwiler@72 ~]$ perl -pe "s/^.*?;//g" < file1 > file2
[mhuwiler@72 ~]$ cat file2
 xxx xxix; blah

Matt
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace semicolon within double quotes in a file with semicolon delimiter

Hello Team, Could you please help me with the below question? I have a file with the following properties 1) File Delimiter is ; 2) Text columns are within double quotes 3) Numeric columns will not have double quotes 4) File has total 6 columns Please see a sample record from file ... (3 Replies)
Discussion started by: sam99
3 Replies

2. AIX

Python on AIX-Need urgent Help

Hi Experts, I am new to python and AIX. I am trying to install Python 2.7 or python 3.2 on AIX 7.1 but getting the bellow error. could you please let me know how to resolve this. Note: Same has been installed on Linux Redhat successfully. $ ./configure --enable-shared ##... (1 Reply)
Discussion started by: Tamil_Arasan
1 Replies

3. UNIX for Dummies Questions & Answers

Delete a semicolon and numbers after a semicolon

I have this: ((9:0.010,(11:0.089,13:0.004)) and I would like this: ((A9,(A11,A13)) How do I delete the semi colon and the number (i.e. 0.010) after the semi colon? Also, how can I add the letter before the number that is NOT removed? Thank you in advance! ---------- Post updated... (4 Replies)
Discussion started by: MDeBiasse
4 Replies

4. AIX

Need Help Urgent AIX Hang

hello all, I'm newbie on AIX. Can any one tell why this happen ? I have expectation this error came because paging memory. This is my error : ( I cann;t read this log and need your help) --------------------------------------------------------------------------- LABEL: ... (7 Replies)
Discussion started by: Fandikurnia
7 Replies

5. AIX

Urgent!! Debugging tool for cobol in AIX

hi folks, I am a new to Aix, i worked as sys admin so no idea about software probs, my software team requires Debugging tool for cobol in AIX machine. can someone tell me the tool and also the installation procedure for the same Please drag me out from this soon :confused: (1 Reply)
Discussion started by: atulgkwd
1 Replies

6. Shell Programming and Scripting

Removing commas within semicolon in a flat file

i am recieving a flat file ( comma seperated ) with comma in between double quotes in any of the source fields . i need to remove the comma in double quotes and process the file thereafter fields in file ========= col1,col2,col3,col4 input can be any of the followng... (31 Replies)
Discussion started by: r_t_1601
31 Replies

7. Shell Programming and Scripting

Removing commas within semicolon in a flat file

Hi , Im relatively new to unix and have to process a comma serparated flat file . I recieve some of the fields in double quotes and i want to remove it .. INPUT ==== filed1,field2,field3,"fie,ld4" OUTPUT ===== field1,field2,field3,"field4" can anyone tell me how to achieve... (10 Replies)
Discussion started by: r_t_1601
10 Replies

8. AIX

URGENT: zip utility on AIX 5.x

Do you know where can I find the 'zip' binary utility for AIX 5.x ? I have the zip-2.3.0.0.bff file, but I don't have root access and I want to test the 'zip' utility. Thank you !!! (2 Replies)
Discussion started by: V3l0
2 Replies

9. AIX

(URGENT) Mounting JFS2 FileSystem on AIX 4.3

Hi Every body, I created Volume Group & FileSystem of type JFS2 with size 1.3 TB on AIX 5.2. I want to import this VG on another system AIX 4.3. It is imported successfully & I can varyon the VG but unfourtantly I couldn't mount the FileSystem. Is it possible to mount a JFS2 FileSystem on AIX... (3 Replies)
Discussion started by: aldowsary
3 Replies
Login or Register to Ask a Question