Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6650061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:50:54+00:00 2026-05-26T00:50:54+00:00

I have a long file which is written as ONLY one column. This column

  • 0

I have a long file which is written as ONLY one column.
This column contains gene names followed by a colon (:) then by the name of a microRNA fragment.
Unfortunately, the microRNA name MAY ALSO contain a colon (:).

I want to replace ONLY the first colon with a tab (\t) and then write.table to produce two columns in R.

Here is a representative sample of one gene name with multiple microRNAs:

CHD5:miR-329/362-3p:2
CHD5:miR-329/362-3p:1
CHD5:miR-30a/30a-5p/30b/30b-5p/30cde/384-5p
CHD5:miR-15/16/195/424/497
CHD5:miR-26ab/1297
CHD5:miR-17-5p/20/93.mr/106/519.d
CHD5:miR-130/301
CHD5:miR-19
CHD5:miR-204/211

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:50:55+00:00Added an answer on May 26, 2026 at 12:50 am

    Here’s a slightly more complete example if you have your ‘inFile’ and want ‘outFile’…

    lines <- readLines('inFile')
    lines <- sub(':', '\t', x)
    writeLines(lines, 'outFile')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that contains a long list of entries (one on
Suppose I have a very long file, utilities.php, which contains most if not all
Hey Folks,I have pasted my code here. Dialog.inform contains a 'long' value which is
I have this structure which I want to write to a file: typedef struct
This is what I am trying to achieve: I have a CSV file which
I have long file with the following list: /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl()
I have a long xml file the content of the file are below: <?xml
I have long HTTP request ( generating large Excel file - about 60K records
I have long recognized that any set of whitespace in an HTML file will
My problem is the following: I have a 2-minute long WAV file, and my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.