• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to modify phone number from a text file then print to the terminal using Sed and Extended Regular Expression?

Resolved: How to modify phone number from a text file then print to the terminal using Sed and Extended Regular Expression?

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am trying to modify the phone number from a text file and display it the following ways using the Sed and Extended Regular Expression. I am new to Regular Expression so not sure what to do.
  • The first two numbers will be in parentheses and there are underscores after the second and sixth number. For example :(04)_1234_5678

  • The first number will become +61, followed by a space. For every three other digits, add a dash. For example +61 412-435-678


phone.txt
I have tried sed 'S/04/()/_1234_5678'

Answer:

Using sed
or individually

If you have better answer, please add a comment about this, thank you!

expression regex sed
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Resolved: Using AWK to count multiple patterns in a file

01/04/2023

Resolved: significance letter above bar graphic in wrong order

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.