Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sed 's/\(.*\)...........

Posted on 2002-05-15
5
Medium Priority
?
470 Views
Last Modified: 2013-12-26
Hi
I am trying this
sed 's/\(.*\),\(.*\),\(.*\),\(.*\),\(.*\),\(.*\),\(.*\),\(.*\),\(.*\),\(.*\)/10' <file>

I am not able to get the \10 printed. It prints the \1 instead.

Is this the limitation of SED or of my system.
I am on Tandem OSS.

Or is there a way around to do what i am doing.
Yep i know i can do it with AWK and i am doint it that way.
But i want to do with SED.

Thanks
Ilikenine
0
Comment
Question by:ilikenine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
ecw earned 150 total points
ID: 7011473
limitations of sed, positional replacement only understands a single digiti after the \
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7012059
as ecw said.

and your command also might not work, 'cause .* is greedy.
I suggest:
     awk -F, '{print $10}' file
0
 
LVL 5

Expert Comment

by:ecw
ID: 7012571
good point, even if it could print \10, that'd be nul
0
 
LVL 1

Author Comment

by:ilikenine
ID: 7013800
na but .* goes till the next comma(,) only . It is not that greedy.

so the awk i am using is
awk '{FS=","}{print $10}'

will give points to ECW.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7014521
> It is not that greedy.
Hmm, may depend on sed version: AT&T vs. GNU
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question