![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find lines with space between strings | Galt | Shell Programming and Scripting | 5 | 05-07-2008 03:06 PM |
| To find multiple strings count in a file | salaathi | Linux | 3 | 11-28-2007 06:31 AM |
| Take a folder name and find it in another folder (Complicated) | hkhan12 | Shell Programming and Scripting | 5 | 09-06-2006 01:25 PM |
| Using grep to find strings of certain lengths? | crabtruck | UNIX for Dummies Questions & Answers | 4 | 11-04-2003 06:25 AM |
| How do I find information about the hardware? | Fwurm | UNIX for Dummies Questions & Answers | 3 | 10-31-2001 05:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Find information from complicated strings
Hi experts,
I have the file with these lines: var1=thu_13:12:32,var2=Microsoft,var3=240ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53 var1=thu_13:13:32,var2=Microsoft,var3=213ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53 var1=thu_13:16:32,var2=Microsoft,var3=654ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1xcv23.53 How can I transform it to: thu_13:12:32,Microsoft,240ms,Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53 thu_13:13:32,Microsoft,213ms,Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53 thu_13:16:32,Microsoft,654ms,Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1xcv23.53 Fundamentally, I would like to remove "XXXXX=". Thank you |
|
||||
|
Thank you very much that helps
however, There are some occasions that the equal sign can be inside a text. var1=thu_13:12:32,var2=Microsoft,var3=240ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_reg=edit_windows.;_NET_1.1323.53) so this one should give the result thu_13:12:32,Microsoft,240ms,Mozilla/4.0_(sun;_MSIR_3-4;_reg=edit_windows.;_NET_1.1323.53) |
|
||||
|
Hope this will help u
$ var="thu_13:12:32,var2=Microsoft,var3=240ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_reg=edit_windows.;_NET_1.1323.53)
" $ echo $var |awk '{gsub("var.=","");print}' thu_13:12:32,Microsoft,240ms,Mozilla/4.0_(sun;_MSIR_3-4;_reg=edit_windows.;_NET_1.1323.53) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|