Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sorry, I haven't been able to hobble this together... Post 302924183 by Don Cragun on Thursday 6th of November 2014 07:32:38 PM
Old 11-06-2014
This could be done with awk, but you don't need that much power for this. A simple editor (e.g., ed, ex, sed, or vi is all you need for this. Here is an example using sed:
Code:
sed 's/../&,00,/g; s/,;/;/' input

After massaging your sample input and output to get rid of spaces in the middle of your lines (since you didn't use CODE tags), I also found that this code does not produce the sample output you said you want; you're missing a ,00 close to the end of each line and a ,00, in the middle of the line.
This User Gave Thanks to Don Cragun For This Post:
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

haven`t the right of root?

I install solaris 8. I want to use netconfig command, but it dispear "you haven`t the right",why? Is there somebody can help me? (3 Replies)
Discussion started by: yycokr
3 Replies

2. Shell Programming and Scripting

I thought I asked the question before but I haven't sorry

:D could any one answer my previous question... just looked through logg and found no such question that I had asked.. please any input would help \.. :confused: (2 Replies)
Discussion started by: moxxx68
2 Replies
GREP(1) 						      General Commands Manual							   GREP(1)

NAME
grep - search a file for lines containing a given pattern SYNOPSIS
grep [-elnsv] pattern [file] ... OPTIONS
-e -e pattern is the same as pattern -c Print a count of lines matched -i Ignore case -l Print file names, no lines -n Print line numbers -s Status only, no printed output -v Select lines that do not match EXAMPLES
grep mouse file # Find lines in file containing mouse grep [0-9] file # Print lines containing a digit DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1 occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is returned. SEE ALSO
cgrep(1), fgrep(1), sed(1), awk(9). GREP(1)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy