parse.dcf                package:base                R Documentation

_P_a_r_s_e _D_e_b_i_a_n _C_o_n_t_r_o_l _F_i_l_e _F_o_r_m_a_t

_D_e_s_c_r_i_p_t_i_o_n:

     Parses text read from a file in Debian control file format, e.g.,
     the `DESCRIPTION' or `CONTENTS' of a package.

_U_s_a_g_e:

     parse.dcf(text = NULL, file = "", fields = NULL, versionfix = FALSE)

_A_r_g_u_m_e_n_t_s:

    text: A character vector containing one line of the file in each
          element.

    file: Name of the file to be parsed.

  fields: A character vector of fields to return (if other fields occur
          in the file they are ignored.

versionfix: Logical, if `TRUE' than the version field is truncated at
          the first whitespace character.

_V_a_l_u_e:

     If `fields = NULL', a list with one element per entry is returned.
     Each entry is a list of character vectors, one per field. If
     `fields' are specified, then a character matrix with one row per
     entry and one column per field is returned.

_S_e_e _A_l_s_o:

     `package.contents', `library'

_E_x_a_m_p_l_e_s:

     file <- system.file("CONTENTS", pkg="mva")
     parse.dcf(file=file)

     ## same in 2 steps
     filecontent <- scan(file=file, what="", sep="\n")
     parse.dcf(text=filecontent)

