0

I am new to and have used a couple times. I am now on a new project where I have txt or excel files that have records that have similar format to below. There are thousands of records and all have different formats, so I need a way to just pull any and all 10 digit numbers it finds in each record and put those 10 digit numbers in to a new txt file.

/20180130124137_7602053275_13362514943

another example

/20180130-084548_3109217528

The end result I am looking for would be for the new file to have added 7602053275 from the first record above as that is the only 10 digit number in that record and 3109217528 from the second example above. Thanks,

Gilles Quenot
  • 143,367
  • 32
  • 199
  • 195
  • 1
    So what is stopping you from doing that? You said you used `grep`, care to show us what you tried? – Dour High Arch Feb 15 '18 at 00:48
  • also, title says `longer than 10 digits` while the sample indicates `exactly 10 digits` – Sundeep Feb 15 '18 at 06:53
  • Ya I need code for extracting any 10 digit number that is in a file and the records in file will look like above samples. So what is Grep code I can use to extract all 10 digit numbers from each record from file? I would like them put in to a new text file. Thx – Mike Moneymaker Feb 20 '18 at 15:05

0 Answers0