Mr Akkara,

On 8 October 2012 05:20, Rantony <antony.akk...@ge.com> wrote:
>
> Here i have a csv file, it contain like this
>
> NAME   UPDATED
> ---------   --------------
> ABC        INDIA
> XYZ         UK
>
> My requirement what is, i need to change the value inside the csv file
> (instead of INDIA i need to make it USA).
>
> NAME   UPDATED
> ---------   --------------
> ABC        USA
> XYZ         UK
>
>
How about:

> read.data(csv-file-name, header=TRUE, stringsAsFactors=FALSE) ->
nameAndUpdated
> nameAndUpdated[nameAndUpdated[,2] == 'USA',2] <- 'INDIA'
> write.csv(nameAndUpdated, csv-file-name, header=TRUE)

-- 
Sent from my mobile device
Envoyait de mon portable

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to