Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion change all files
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tim Chase  
View profile  
 More options Nov 7 2012, 8:56 am
From: Tim Chase <v...@tim.thechases.com>
Date: Wed, 07 Nov 2012 07:56:29 -0600
Local: Wed, Nov 7 2012 8:56 am
Subject: Re: change all files
On 11/07/12 07:07, vicky b wrote:

> I was able to do that but i have some unwanted lines in a file

> i just want line that have a pattern , below is the file

> #Generated by ResourceBundle Editor
> # en Resource Bundle
> #
> # filename: FormsNRefsPortletResource_en.properties
> # Portlet Info resource bundle example
> Matches , \u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A
> Select , \u0E40\u0E25\u0E37\u0E2D\u0E01
> choice1Label ,
> \u0E40\u0E02\u0E49\u0E32\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E23\u0E31\u0 E01\u0E29\u0E32

> desired file should be like

> Matches , \u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A
> Select , \u0E40\u0E25\u0E37\u0E2D\u0E01
> choice1Label ,
> \u0E40\u0E02\u0E49\u0E32\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E23\u0E31\u0 E01\u0E29\u0E32

> that i want lines whic have \u0E15 these kind of stsring others i want to
> delete

Well, there are a couple options, again using ":argdo" to iterate
over all the files.  If you want to keep lines that contain
"backslash u hex-digit hex-digit hex-digit hex-digit", you can do

  :set hidden
  :argdo v/\\u\x\x\x\x/d

then review your changes and either save/abandon the changes.

Alternatively, if you have your original file and just want to keep
the "=" lines even if they don't have hex digits on them (might be
integers or something else?), you can preprocess with

  :argdo v/=/d

to delete all the lines that don't contain an "=".  You can then run
the previously-provided command to change the "=" to ",".

If you just want to delete those lines starting with a hash, you can use

  :argdo g/^\s*#/d

to delete them.

-tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.