Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a 0 at end of data in a text file

Status
Not open for further replies.

gogo36

Programmer
Jun 3, 2005
7
US
I'm trying to add a zero at the end of the data that start with 62018 (it will always start with 62018) and the number is sequential so the next one would be 62018000100021 and then 22 and so on. I just want to add an O at the end no matter what the number is.

UNB+UNOA:1+5030917029608:14+5000119000006:14+070509:0850+62018000100020++INVOIC

any help would be appreciated.

Thank you
JG
 
Something like this ?
Code:
sed 's!+62018[0-9]*!&0!' /path/to/input > output

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top